How jacksonsouza99/ai-document-assistant works
AI Document Assistant is a Python RAG application: it ingests PDF text into a persistent vector collection, then retrieves relevant passages to ground Gemini answers. The primary workflow runs from PDF ingestion through retrieval and response generation; a separate query script prints retrieved passages without generating an answer. The embedding demonstration and database-cleanup script are peripheral to that workflow. Edges reflect the shown calls and documented behavior; the graph does not assume relationships for unsampled code.
Main entry points: ask.py Question workflow · vector_store.py Ingestion runner · llm.py Answer generation · query.py Passage query script
Components 14
PDF ingestion
- Ingestion runner
app/vector_store.py - PDF text extraction
app/reader.py - Text chunking
app/chunker.py - Chunk embeddings
app/vector_store.py
Question answering
- Question workflow
app/ask.py - Question embeddings
app/ask.py - Semantic retrieval
app/ask.py - Context assembly
app/ask.py - Answer generation
app/llm.py - Passage query script
app/query.py
Vector storage
- Chroma collection
app/vector_store.py
Other components
- User
- PDF document
- Gemini API
Connections 17
- User → Ingestion runner: starts ingestion
README.md - PDF document → Ingestion runner: provides PDF
README.md - Ingestion runner → PDF text extraction: extracts text
app/vector_store.py - Ingestion runner → Text chunking: splits text
app/vector_store.py - Ingestion runner → Chunk embeddings: encodes chunks
app/vector_store.py - Ingestion runner → Chroma collection: upserts vectors
app/vector_store.py - User → Question workflow: asks question
app/ask.py - Question workflow → Question embeddings: encodes question
app/ask.py - Question workflow → Semantic retrieval: queries collection
app/ask.py - Semantic retrieval → Question embeddings: uses embedding
app/ask.py - Semantic retrieval → Chroma collection: retrieves passages
app/ask.py - Question workflow → Context assembly: assembles context
app/ask.py - Question workflow → Answer generation: requests answer
app/ask.py - Answer generation → Gemini API: generates response
app/llm.py - Question workflow → User: prints answer
app/ask.py - User → Passage query script: enters question
app/query.py - Passage query script → Chroma collection: queries collection
app/query.py