How yash9614/project_oo1 works
This is a secure enterprise RAG assistant. Users ask questions through the API, where the Assistant identifies the user, searches only authorized content, retries with a rewritten query when needed, generates a quote-verified answer, and records an audit event. Documents enter through upload, are parsed, deduplicated/versioned, chunked and embedded, then stored for hybrid vector and keyword retrieval. The graph preserves documented UI, audit, and containerized-product capabilities; source for the UI and schema was not sampled, so those links rely on README documentation.
Main entry points: pipeline.py Assistant workflow · retrieval.py Retriever · api.py FastAPI · ingestion.py Embed and store
Components 18
Document indexing
- Upload handling
assistant/api.py - Parse and chunk
assistant/ingestion.py - Embed and store
assistant/ingestion.py
Question answering
- Assistant workflow
assistant/pipeline.py - User identity
assistant/repository.py - Retriever
assistant/retrieval.py - Hybrid search
assistant/repository.py - Reranking
assistant/retrieval.py - Grade and rewrite
assistant/pipeline.py - Grounded generation
assistant/generation.py - Answer models
assistant/models.py
Persistence
- Audit events
assistant/repository.py - PostgreSQL and pgvector
schema.sql
External services
- OpenAI models
Other components
- User
Connections 25
- User → Web UI: asks
README.md - Web UI → FastAPI: uses
README.md - User → FastAPI: asks
assistant/api.py - User → CLI: asks
ask.py - FastAPI → Assistant workflow: invokes
assistant/api.py - CLI → Assistant workflow: invokes
ask.py - FastAPI → Upload handling: handles
assistant/api.py - Upload handling → Parse and chunk: stores document
assistant/api.py - Parse and chunk → Embed and store: chunks document
assistant/ingestion.py - Embed and store → OpenAI models: creates embeddings
assistant/ingestion.py - Embed and store → PostgreSQL and pgvector: writes documents
assistant/ingestion.py - Assistant workflow → User identity: looks up user
assistant/pipeline.py - Assistant workflow → Retriever: searches
assistant/pipeline.py - Retriever → OpenAI models: embeds query
assistant/retrieval.py - Retriever → Hybrid search: fetches candidates
assistant/retrieval.py - Hybrid search → PostgreSQL and pgvector: queries authorized chunks
assistant/repository.py - Retriever → Reranking: reranks candidates
assistant/retrieval.py - Reranking → OpenAI models: rates relevance
assistant/retrieval.py - Assistant workflow → Grade and rewrite: grades and rewrites
assistant/pipeline.py - Grade and rewrite → OpenAI models: uses helper model
assistant/pipeline.py - Assistant workflow → Grounded generation: generates answer
assistant/pipeline.py - Grounded generation → OpenAI models: drafts answer
assistant/generation.py - Grounded generation → Answer models: builds citations
assistant/generation.py - Assistant workflow → Audit events: records question
assistant/pipeline.py - Audit events → PostgreSQL and pgvector: writes event
assistant/repository.py