Where Documents Come Alive 🌌
The Art of Intelligent Document Conversation
Static PDFs → Living Dialogues ✨
What if your documents could speak back?
Synapse transforms static files into conversational companions.
Instead of scrolling endlessly, you ask questions like you would to a colleague:
- “Summarize section 2 in three lines.”
- “Compare results from table 3 with the conclusion.”
- “What assumptions are hidden in the methodology?”
Behind this, the system runs Retrieval-Augmented Generation (RAG):
- Splits the document into small chunks 📄
- Embeds them into a vector space 🌐 (where meaning is geometry)
- Retrieves the closest knowledge for your query 🔍
- Feeds both your question + retrieved chunks into an LLM 🧠
The answer is grounded, contextual, and transparent.
Not AI hallucination — but AI amplified by retrieval.
- 📄 PDF Uploads → Any report, research, policy, or notes.
- 💬 Natural Language Q&A → Just ask, no syntax needed.
- 🔍 Source Transparency → Exact page + snippet citations.
- ⚡ Local & Fast → Privacy-first, no external API calls.
- 🎨 Elegant UI → Next.js + Tailwind design, sleek & minimal.
- 🧠 Configurable AI → Swap models, tweak chunk size, tune temperature.
| Layer | What We Use | Why It Matters |
|---|---|---|
| Frontend 🎨 | Next.js · React · TypeScript · TailwindCSS | Smooth, modern, responsive UI. |
| Backend 🔧 | FastAPI (Python) | Lightweight, async API server for handling queries + embeddings. |
| AI Core 🧠 | LangChain · Ollama · Phi-3 / LLaMA models | Orchestrates retrieval + generation. Models run locally via Ollama. |
| Vector DB 📊 | ChromaDB | Stores embeddings of document chunks, enabling fast semantic search. |
| Embeddings 🔮 | Sentence Transformers / Instructor models | Converts text → vectors in high-dimensional space (meaningful proximity). |
Here’s how Synapse works under the hood:
┌──────────────┐
│ PDF Upload │ 📄
└───────┬──────┘
│
┌───────▼─────────┐
│ Preprocessor │ ✂️
│ (chunk + clean) │
└───────┬─────────┘
│
┌───────▼─────────┐
│ Embeddings │ 🔮
│ (Vectorization) │
└───────┬─────────┘
│
┌───────▼─────────┐
│ Vector DB │ 📊
│ (Chroma) │
└───────┬─────────┘
│
┌───────▼─────────┐
Query │ Retriever │ 🔍
💬 ──▶│ (find relevant) │
└───────┬─────────┘
│
┌───────▼─────────┐
│ LLM Engine │ 🧠
│ (Phi-3 / LLaMA) │
└───────┬─────────┘
│
┌───────▼─────────┐
│ Response + │ ✨
│ Citations │
└─────────────────┘
Synapse was deployed using ngrok, tunneling the local FastAPI backend to the web.
This meant the app was accessible publicly through a temporary URL — but only as long as my system was running.
⚡ It wasn’t production-grade hosting, but it made Synapse come alive for real-time demos.
A reminder that AI isn’t just about models — it’s about the entire pipeline, from embeddings to deployment.
For long-term usage, consider deploying with Docker + cloud hosting (AWS, GCP, Railway, etc.).
- Node.js ≥ 18
- Python ≥ 3.10
- Ollama installed
- 4GB+ RAM
git clone https://github.com/muskan-khushi/Synapse
cd synapsecd server
python -m venv venv
source venv/bin/activate # (Mac/Linux)
.\venv\Scripts\activate # (Windows)
pip install -r requirements.txtcd ../client
npm install# Download Phi-3 Mini (3.9 GB) from HuggingFace
cp phi3.Modelfile.example phi3.Modelfile
# Update file path to gguf model
ollama create phi3-local -f phi3.Modelfileollama pull phi3:miniBackend (Terminal 1):
cd server
uvicorn main:app --reload --port 8000Frontend (Terminal 2):
cd client
npm run dev🌐 Visit → http://localhost:3000
Ask your documents like a friend:
- “Summarize this in 5 bullet points.”
- “Which section mentions neural networks?”
- “Explain section 4 as if I’m 12 years old.”
- “Compare methodology with conclusion.”
Every answer → with citations & context 🔍.
Tune your AI in server/.env:
MODEL_NAME=phi3-local
OLLAMA_BASE_URL=http://localhost:11434
CHUNK_SIZE=1000
TEMPERATURE=0.1CHUNK_SIZE: how much text per vector sliceTEMPERATURE: creativity of responses (0 = factual, 1 = creative)
Synapse is not just code — it’s a belief.
That documents are meant to be alive, not static.
That AI should be transparent, not black-boxed.
That embeddings + neural nets can feel almost poetic in how they connect meaning across dimensions.
It is research, but it is also art.
A bridge between mathematical rigor and dreamy interaction ✨.
MIT License — free to use, remix, and explore.