A learning project to explore RAG (Retrieval-Augmented Generation), vector databases, and the building blocks of single-agent AI systems — using research papers as the data source.
Client
│
└─ sends PDF
│
▼
FastAPI endpoint
│
▼
chunked into text segments
│
▼
vector embedded (sentence-transformers)
│
▼
stored in ChromaDB
Query
│
└─ vector embedded
│
▼
ChromaDB similarity search
│
▼
top chunks → RAG prompt → Gemini
│
▼
answer returned to client
| Layer | Technology |
|---|---|
| API | FastAPI |
| ORM / Migrations | SQLAlchemy + Alembic |
| Database | SQLite |
| PDF Parsing | pypdf |
| Embeddings | sentence-transformers (all-MiniLM-L6-v2) |
| Vector Store | ChromaDB |
| LLM | Google Gemini 2.5 Flash |
- PDF uploaded → text extracted page-by-page
- Text split into 500-character chunks
- Paper metadata and chunks saved to SQLite
- Each chunk embedded → vectors stored in ChromaDB
- Query embedded into the same vector space
- ChromaDB returns top 5 most similar chunks
- Question embedded → top 5 chunks retrieved
- Chunks injected into a grounded prompt
- Gemini answers using only the provided context
- PDF ingestion and text extraction
- Text chunking
- Semantic embeddings (local, sentence-transformers)
- Vector storage and similarity search (ChromaDB)
- RAG pipeline — retrieval-augmented generation via Google Gemini 2.5 Flash
- Multi-agent router — classify question type and route to the appropriate agent
- Summarization agent — full paper summarization
- Swap local embeddings for hosted provider (Google Gemini embedding API)
- Multi-paper search and cross-paper reasoning