A Cosmic Knowledge Intelligence Engine β Upload Documents, Build a Living Graph, Ask Smarter Questions
SYNAPSE is a full-stack GraphRAG application that turns multiple documents into a connected knowledge graph, then answers questions by combining vector retrieval + graph traversal. Instead of plain chunk similarity, it highlights relationships across entities, concepts, and evidence paths.
- Overview
- Application Preview
- Features
- Architecture
- Tech Stack
- Project Structure
- Installation
- Usage
- API Reference
- Configuration
- Deployment
SYNAPSE helps you reason across documents, not just search inside them.
It:
- extracts named entities and concepts from uploaded PDFs/TXT files
- builds a graph with relationship edges and connection weights
- creates embeddings for retrieval context
- answers with graph-aware synthesis powered by Groq
- lights up activated nodes for visual explanation
| Feature | Description |
|---|---|
| π Cosmic Graph UI | D3-driven interactive graph with glowing nodes, drifting particles, and animated edges |
| π§Ύ Multi-Doc Upload | Upload up to 5 .pdf/.txt files per run |
| π§ GraphRAG Retrieval | Combines vector chunk search with graph-neighborhood traversal |
| β‘ Live Processing Events | WebSocket events for upload, extraction, activation, and answer stages |
| π Node Inspector | Click any node to inspect linked evidence and relationship context |
| π Useful Insights Panel | Top nodes, relation counts, and practical graph signals |
| πΌ Business Summary Button | One-click executive summary (insights, risks, opportunities, 30/60/90 actions) |
| π§ͺ Complex Sample Dataset | Included complex_*.txt docs for meaningful cross-domain demo graphs |
Documents (.pdf/.txt)
-> Text extraction + cleaning
-> Entity / concept extraction (spaCy)
-> Relationship extraction (co-occurrence + relation verb hints)
-> Knowledge graph nodes + edges (in-memory)
-> Embeddings + vector store (ChromaDB)
-> Query pipeline:
Vector retrieval + relevant-node scoring + subgraph context
-> Groq answer synthesis
-> Frontend activation + visualization
| Layer | Technology |
|---|---|
| Frontend | React, D3.js, Framer Motion, Axios |
| Backend | FastAPI, Uvicorn, Pydantic |
| NLP | spaCy (en_core_web_sm) |
| Vector Store | ChromaDB |
| LLM Provider | Groq (llama-3.3-70b-versatile) |
| Embeddings | Groq embeddings (nomic-embed-text-v1.5) |
| Parsing | PyMuPDF for PDFs |
synapse-graphrag/
βββ backend/
β βββ main.py
β βββ document_processor.py
β βββ entity_extractor.py
β βββ graph_builder.py
β βββ graph_store.py
β βββ graph_retriever.py
β βββ groq_service.py
β βββ requirements.txt
β βββ .env.example
βββ frontend/
β βββ src/
β βββ public/
β βββ package.json
β βββ vercel.json
βββ sample_docs/
β βββ ai_trends.txt
β βββ market_analysis.txt
β βββ company_strategy.txt
β βββ complex_*.txt
βββ docs/screenshots/
βββ DECISIONS.md
βββ LICENSE
βββ README.md
βββ render.yaml
- Python 3.11+
- Node.js 18+
- Groq API key
cd backend
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
python -m spacy download en_core_web_sm
copy .env.example .envEdit backend/.env:
GROQ_API_KEY=your_groq_api_key_here
GROQ_MODEL=llama-3.3-70b-versatile
GROQ_EMBEDDING_MODEL=nomic-embed-text-v1.5Run backend:
uvicorn main:app --reload --host 0.0.0.0 --port 8000cd ../frontend
npm install
npm startFrontend: http://localhost:3000
Backend: http://localhost:8000
- Open
http://localhost:3000 - Upload 1-5 documents
- Wait for graph build completion
- Ask custom questions or click Business Summary
- Click nodes to inspect linked evidence
For a richer demo, upload:
sample_docs/complex_board_memo_q3.txtsample_docs/complex_market_intel_2027.txtsample_docs/complex_incident_and_postmortem.txtsample_docs/complex_finance_and_hiring_plan.txt
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Health check |
POST |
/upload |
Upload docs and build graph |
GET |
/graph |
Return current graph |
POST |
/query |
Ask graph-aware question |
GET |
/status |
Graph status and counts |
WS |
/ws |
Live processing events |
backend/.env:
GROQ_API_KEY=...
GROQ_MODEL=llama-3.3-70b-versatile
GROQ_EMBEDDING_MODEL=nomic-embed-text-v1.5frontend optional env:
REACT_APP_API_URL=http://localhost:8000
REACT_APP_WS_URL=ws://localhost:8000/ws- Uses
render.yaml - Set env var:
GROQ_API_KEY
- Deploy
frontend/ - Set env vars:
REACT_APP_API_URL=https://your-backend-urlREACT_APP_WS_URL=wss://your-backend-url/ws
This project is licensed under the MIT License. See LICENSE.
Built with β€οΈ for GraphRAG-first document intelligence.
