How georgeaaron7/graph-rag works
GraphRAG Knowledge Assistant ingests PDFs into shared, provenance-tagged chunks, indexes them in FAISS and extracts entity relationships into Neo4j. For questions, the backend retrieves semantically similar chunks and traverses graph relationships from query entities, then fuses both rankings and generates a cited answer, optionally streamed to the frontend. The UI supports PDF upload, chat, citations, and a provenance visualization. The graph follows the sampled pipeline and endpoint calls; some modules, including PDF loading, graph extraction, and answer generation, are represented from their paths and documented behavior, but their internals were not sampled.
Main entry points: pipeline.py Ingest and query · page.tsx Chat interface · main.py HTTP endpoints · api.ts API client
Components 19
User interface
- Chat interface
frontend/app/page.tsx - API client
frontend/app/lib/api.ts - Provenance graph
frontend/app/components/ProvenanceGraph.tsx
API and orchestration
- HTTP endpoints
backend/app/main.py - Ingest and query
backend/app/pipeline.py
Ingestion and indexing
- PDF loader
backend/app/ingestion/pdf_loader.py - Document chunking
backend/app/ingestion/chunking.py - Text embeddings
backend/app/vector/embeddings.py - Graph extraction
backend/app/graph/extraction.py
Retrieval and answers
- Rank fusion
backend/app/retrieval/hybrid.py - Cited answer
backend/app/rag/answer.py - LLM client
backend/app/llm/client.py
Knowledge stores
- Vector index
backend/app/vector/store.py - Knowledge graph
backend/app/graph/store.py
Other components
- User
- LLM service
- Embedding API
- Neo4j
- FAISS index
Connections 20
- User → Chat interface: asks or uploads
- Chat interface → API client: calls
- Chat interface → Provenance graph: renders citations
- API client → HTTP endpoints: sends requests
- HTTP endpoints → Ingest and query: dispatches ingest and chat
- Ingest and query → PDF loader: loads PDF pages
- Ingest and query → Document chunking: chunks text
- Ingest and query → Text embeddings: embeds chunks and queries
- Ingest and query → Vector index: adds and searches chunks
- Ingest and query → Graph extraction: extracts chunk relations
- Graph extraction → LLM client: requests extraction
- Ingest and query → Knowledge graph: upserts graph and retrieves
- Knowledge graph → Neo4j: reads and writes
- Vector index → FAISS index: persists and searches
- Text embeddings → Embedding API: requests embeddings
- Ingest and query → Rank fusion: fuses retrieval hits
- Ingest and query → Cited answer: generates grounded answer
- Cited answer → LLM client: requests answer
- LLM client → LLM service: sends chat requests
- HTTP endpoints → API client: returns answers and citations