How kashifali-it/contexta works
Contexta Py is an asynchronous document Q&A platform. Its implemented path accepts a PDF through the document API, stores the file and record, queues ingestion, and has a worker parse and chunk it before updating document state. The README also describes a broader agentic RAG path—hybrid retrieval, grading, fallback web search, streaming answers, and TTS—but those implementations are not present in the sampled source or populated tree. Those documented capabilities are shown as such; edges without source evidence are omitted.
Main entry points: ingestion.py Ingestion service · documents.py Document API · frontend Next.js client · nodes Agent engine
Components 21
API and documents
- Next.js client
frontend - Document API
backend/app/api/v1/documents.py - API router
backend/app/api/v1/router.py
Ingestion pipeline
- Ingestion worker
backend/app/workers/tasks.py - Ingestion service
backend/app/services/ingestion.py - PDF parser
backend/app/services/parser.py - Chunker
backend/app/services/chunker.py - LLM client
backend/app/services/llm.py
Agentic Q&A
- Agent engine
backend/app/agents/nodes - Hybrid retrieval
backend/app/agents/nodes - Relevance grader
backend/app/agents/nodes - Answer generator
backend/app/agents/nodes - Web fallback
backend/app/agents/nodes - Text-to-speech
backend/app/agents/nodes
State and storage
- PostgreSQL
- Redis queue
- Object storage
backend/app/services/storage.py - Vector store
- Tavily search
- Edge TTS
Other components
- User
Connections 22
- User → Next.js client: uploads PDF
README.md - Next.js client → Document API: sends request
README.md - API router → Document API: registers routes
backend/app/api/v1/router.py - Document API → Object storage: stores file
backend/app/api/v1/documents.py - Document API → PostgreSQL: creates record
README.md - Document API → Redis queue: enqueues job
- Ingestion worker → Ingestion service: runs ingestion
backend/app/workers/tasks.py - Ingestion service → Object storage: fetches file
backend/app/services/ingestion.py - Ingestion service → PDF parser: parses document
backend/app/services/ingestion.py - Ingestion service → Chunker: creates chunks
backend/app/services/ingestion.py - Ingestion service → LLM client: summarizes tables
backend/app/services/ingestion.py - Ingestion service → PostgreSQL: updates status
backend/app/services/ingestion.py - User → Agent engine: asks question
README.md - Agent engine → Hybrid retrieval: dispatches retrieval
README.md - Hybrid retrieval → Vector store: searches chunks
README.md - Agent engine → Relevance grader: checks relevance
README.md - Relevance grader → Answer generator: passes relevant chunks
README.md - Relevance grader → Web fallback: falls back
README.md - Answer generator → Next.js client: streams answer
README.md - Next.js client → Text-to-speech: requests speech
README.md - Text-to-speech → Edge TTS: generates audio
README.md - Web fallback → Tavily search: searches web
README.md