| Field | Value |
|---|---|
| Course | CSE474 Social Network Analysis |
| Instructor | Assoc. Prof. Alper Ozcan |
| Students | 20210808067 - Munevver Nur Topluyurek 20220808617 - Ahmet Faruk Tekeli |
This project presents a Knowledge Graph-Infused Retrieval-Augmented Generation (KG-Infused RAG) system for multi-hop question answering in the Turkiye cinema domain.
The system combines a curated cinema-focused subgraph, baseline retrieval pipelines, and a graph-guided reasoning workflow to answer multi-hop questions with traceable evidence. In addition to the backend QA pipeline, the repository includes an interactive dashboard and a live chat interface for exploring graph structure, Cypher queries, evaluation outputs, and explainable evidence trails.
- Knowledge graph construction over the Turkiye cinema domain
- Multi-hop question answering with KG-guided retrieval and reasoning
- Baseline comparison pipelines for retrieval and answer generation
- FastAPI backend exposing chat, dashboard, evaluation, and graph endpoints
- Next.js frontend with dashboard, knowledge graph, Cypher, GNN, XAI, and live chat views
- Generated experiment artifacts used directly by the application
The backend is implemented with FastAPI and organizes the QA pipeline into modular components for providers, KG-RAG execution, baseline methods, evaluation, and chat orchestration.
Main responsibilities:
- provider integration for Groq, Neo4j, and local fallback services
- KG-RAG execution and answer tracing
- baseline retrieval and generation workflows
- evaluation metric loading and comparison endpoints
- session-based live chat support
The frontend is implemented with Next.js and provides an application-style interface for inspecting the project outputs and interacting with the QA system.
Main views:
- Dashboard
- Knowledge Graph
- Cypher Queries
- GNN
- XAI Evidence
- Live Chat
The artifacts/ directory stores generated outputs used by the interface and backend views, including graph summaries, dataset metadata, baseline retrieval outputs, KG-RAG traces, and evaluation results.
This project was developed using a locally downloaded copy of Wikidata5M-KG provided by Alphonse7 on Hugging Face. The dataset package supplies the triplets, entity aliases, relation aliases, and text descriptions used throughout the pipeline to:
- extract a Turkiye-centered cinema subgraph
- build Neo4j-ready entity and relationship exports
- generate the verified multi-hop QA benchmark used for evaluation
During development, this was the only external dataset package used from the project root for graph construction and dataset generation. The downstream outputs produced from that source are stored under artifacts/.
Primary data package:
| Layer | Technologies |
|---|---|
| Backend | FastAPI, Uvicorn, Pydantic, HTTPX |
| Graph / Data | Neo4j Aura, CSV/JSON/SQLite artifacts |
| LLM Provider | Groq |
| Frontend | Next.js, React, TypeScript |
| Visualization | React-based custom UI and graph rendering components |
.
|-- artifacts/
| |-- phase-2/
| |-- phase-3/
| |-- phase-4/
| |-- phase-5/
| |-- phase-6/
| `-- phase-7/
|-- backend/
| |-- app/
| | |-- api/
| | | `-- routes/
| | |-- baselines/
| | |-- chat/
| | |-- core/
| | |-- evaluation/
| | |-- kg_rag/
| | `-- providers/
| |-- requirements.txt
| `-- requirements-dev.txt
|-- docs/
| `-- .gitkeep
|-- frontend/
| |-- app/
| |-- components/
| |-- lib/
| |-- package.json
| `-- tsconfig.json
|-- scripts/
| |-- explore_turkiye_cinema.py
| |-- extract_turkiye_cinema_subgraph.py
| |-- generate_verified_multihop_qa_dataset.py
| `-- load_turkiye_cinema_subgraph_to_neo4j.py
|-- .env.example
|-- start_backend.bat
|-- start_frontend.bat
`-- dev_frontend.bat
Copy .env.example to .env and provide the required credentials.
Expected variables:
GROQ_API_KEYGROQ_MODEL(optional override)GROQ_MODEand quota guardrail values (optional)NEO4J_URINEO4J_USERNAMENEO4J_PASSWORDNEO4J_DATABASENEXT_PUBLIC_BACKEND_API_BASE_URLandBACKEND_API_BASE_URLfor the frontend
Install backend dependencies from the project root:
python -m pip install -r backend/requirements.txtStart the backend:
start_backend.batBackend default address:
http://127.0.0.1:8000
Install frontend dependencies from the frontend/ directory:
npm installBuild the frontend:
npm run buildStart the production frontend:
start_frontend.batFor development mode:
dev_frontend.batFrontend default address:
http://127.0.0.1:3000
Before presenting or deploying, run the backend and frontend checks from the project root:
python -m compileall -q backend/app scripts server.py api/index.py
python -m pytest backend/tests -qThen run the frontend production build from frontend/:
npm run buildProject documentation files can be placed under the docs/ directory.
For the Vercel production workflow used on the prod branch, see the dedicated manual deployment guide:
This repository focuses on:
- graph-centered multi-hop QA in a domain-specific knowledge graph
- comparison between retrieval strategies and graph-guided reasoning
- explainability through structured traces, Cypher inspection, and evidence visualization
- an interactive interface for presenting the full project workflow