← Back to projects

KG-RAG for Crime Films

A Knowledge Graph + RAG system for nuanced questions about crime-film narratives.

Knowledge GraphRAGLLaMA 3.1Neo4jOllama
KG-RAG for Crime Films screenshot

The problem

Standard question answering struggles with film narratives. Character dynamics, evolving plots and implicit themes are not simple facts, and plain LLMs hallucinate when asked open-ended or non-factual questions about a script.

Approach

  • An LLM extracts entities (characters, places, objects, events) from the screenplay and builds a knowledge graph in Neo4j.
  • The script is also chunked and embedded into a vector database for broader context.
  • At question time, the system retrieves structured facts from the graph and similar passages from the vector store, then fuses them.
  • A local LLaMA 3.1 model, run through Ollama, reasons over the fused context and answers with a rationale.

Results

  • Evaluated on 50 hand-annotated question-answer pairs from the script of The Godfather Part I.
  • Questions span five types: factual, inferential, comparative/relational, causal/temporal and dialogue analysis.
  • The annotated dataset is public on Zenodo.
  • Published as a Springer book chapter (see the Research section).

At a glance

How a question is answered
  1. Movie script

  2. Entity extraction

    LLM

  3. Knowledge graph

    Neo4j

    Vector store

    Script embeddings

  4. Context fusion

  5. LLaMA 3.1

    via Ollama

  6. Answer + rationale

System design from the project README.