How shaik-nowshinfarhana/federated_knowledge_graph works
Federated Knowledge Graph turns organizational documents into provenance-bearing Neo4j facts, then exposes graph exploration, GraphRAG answers, entity resolution, conflict detection, failure simulation, temporal views, and a fact ledger. The main path is upload or directory ingestion through parsing, chunking, LLM extraction and workflow validation into graph storage; the API serves the resulting capabilities to the React UI. Edges reflect README architecture and the shown imports, calls, and endpoint requests; several feature modules were not excerpted, so their internals are represented at directory level.
Main entry points: main.py FastAPI service · pipeline.py Ingestion workflow · graphrag.py GraphRAG answers · LiveGraphPage.jsx Live graph page
Components 26
Ingestion
- Document parser
backend/ingestion/parsers.py - Image OCR
backend/ingestion/ocr.py - Text chunker
backend/ingestion/chunker.py - Directory watcher
backend/ingestion/watcher.py
Knowledge construction
- Ingestion workflow
backend/workflow/pipeline.py - Triple extractor
backend/llm/extractor.py - Local LLM
- Entity resolver
backend/resolution/resolver.py - Entity embeddings
backend/resolution/embeddings.py - Neo4j graph
backend/graph/neo4j_client.py
Graph analysis
- Graph queries
backend/graph/queries.py - Chunk and summary store
backend/rag/chunk_store.py - GraphRAG answers
backend/rag/graphrag.py - Failure simulation
backend/simulation/failure.py - Fact provenance ledger
backend/provenance/ledger.py - Conflict detection
backend/graph/queries.py - Temporal lineage
backend/graph/queries.py
API and interface
- FastAPI service
backend/main.py - React application
frontend/src/App.jsx - Question interface
frontend/src/components/QueryBox.jsx - Live graph page
frontend/src/pages/LiveGraphPage.jsx - Graph visualization
frontend/src/components/GraphView.jsx - Ingestion progress
frontend/src/components/IngestionPipelineViz.jsx - Failure panel
frontend/src/components/FailureSimPanel.jsx
Other components
- User
- Source documents
Connections 33
- User → Source documents: provides
README.md - Source documents → Document parser: parsed by
backend/ingestion/parsers.py - Document parser → Image OCR: dispatches images
backend/ingestion/parsers.py - Document parser → Text chunker: produces text
README.md - Directory watcher → Ingestion workflow: starts ingestion
- Text chunker → Ingestion workflow: provides chunks
backend/workflow/pipeline.py - Ingestion workflow → Triple extractor: invokes extraction
backend/workflow/pipeline.py - Triple extractor → Local LLM: requests extraction
- Ingestion workflow → Neo4j graph: persists facts
README.md - Ingestion workflow → Chunk and summary store: stores chunks
backend/workflow/pipeline.py - Ingestion workflow → Fact provenance ledger: records provenance
README.md - Ingestion workflow → Entity resolver: runs resolution
backend/workflow/pipeline.py - Entity resolver → Entity embeddings: uses embeddings
backend/resolution/resolver.py - Entity embeddings → Local LLM: requests vectors
backend/resolution/embeddings.py - Entity resolver → Neo4j graph: merges entities
backend/resolution/resolver.py - FastAPI service → Ingestion workflow: starts jobs
backend/main.py - FastAPI service → GraphRAG answers: answers questions
backend/main.py - GraphRAG answers → Graph queries: retrieves graph facts
backend/rag/graphrag.py - GraphRAG answers → Chunk and summary store: searches excerpts
backend/rag/graphrag.py - GraphRAG answers → Local LLM: generates answers
backend/rag/graphrag.py - Graph queries → Neo4j graph: runs Cypher
backend/graph/queries.py - FastAPI service → Failure simulation: simulates failures
backend/main.py - FastAPI service → Conflict detection: serves conflicts
README.md - FastAPI service → Temporal lineage: serves temporal graph
README.md - FastAPI service → Neo4j graph: serves graph data
backend/main.py - User → React application: uses
README.md - React application → Live graph page: renders
frontend/src/App.jsx - Live graph page → Question interface: renders
frontend/src/pages/LiveGraphPage.jsx - Live graph page → Graph visualization: renders
frontend/src/pages/LiveGraphPage.jsx - React application → FastAPI service: starts ingestion
frontend/src/App.jsx - Question interface → FastAPI service: asks questions
frontend/src/components/QueryBox.jsx - Live graph page → Failure panel: renders
frontend/src/pages/LiveGraphPage.jsx - Ingestion progress → FastAPI service: polls job status
frontend/src/components/IngestionPipelineViz.jsx