How hariharan024/ai-research-assistant works
AI Research Assistant is a local PDF question-answering application. Users upload a PDF through the React UI; the API extracts pages, chunks text, and indexes it. Users then ask questions, which the RAG pipeline rewrites when conversation history exists, retrieves document chunks, and sends context to a local Ollama model. The API returns the answer and source metadata for display. The graph follows the sampled runtime; the README documents the broader capabilities, while unsampled implementation details are not inferred.
Main entry points: api.py FastAPI endpoints · rag_pipeline.py RAG pipeline · App.jsx React interface · query_rewriter.py Query rewriting
Components 10
Web client
- React interface
frontend/src/App.jsx
API and ingestion
- FastAPI endpoints
app/api.py - PDF extraction
app/pdf_loader.py - Text chunking
app/chunker.py
RAG and generation
- RAG pipeline
app/rag_pipeline.py - Query rewriting
app/query_rewriter.py - Answer generation
app/local_llm.py
Document storage
- Chroma vector store
app/vector_store.py
Other components
- Researcher
- Ollama model
Connections 11
- Researcher → React interface: asks and uploads
frontend/src/App.jsx - React interface → FastAPI endpoints: sends requests
frontend/src/App.jsx - FastAPI endpoints → PDF extraction: extracts pages
app/api.py - FastAPI endpoints → Text chunking: chunks pages
app/api.py - FastAPI endpoints → Chroma vector store: indexes chunks
app/api.py - FastAPI endpoints → RAG pipeline: dispatches questions
app/api.py - RAG pipeline → Query rewriting: rewrites queries
app/rag_pipeline.py - RAG pipeline → Chroma vector store: retrieves chunks
app/rag_pipeline.py - RAG pipeline → Answer generation: generates answer
app/rag_pipeline.py - Query rewriting → Ollama model: calls model
app/query_rewriter.py - Answer generation → Ollama model: calls model
app/local_llm.py