How tusharsharmasecurity-coder/rag-agentic-ai works
This repository implements a logistics-focused AI assistant with a Streamlit interface, an API entry point, and backend capabilities for SQL question answering, document retrieval, analytics, and data upload. The main user path is navigation through the UI to the assistant page and its API client; the SQL engine is a major backend component that validates and runs database queries and can use schema retrieval, memory, model routing, and answer generation. The README is empty, so capability scope comes from the source tree and index; links for unsampled modules are limited to indexed references.
Main entry points: sql_engine.py SQL engine · app.py Streamlit app · upload_page.py Upload center · database.py Operational database
Components 24
User interface
- Streamlit app
app.py - Assistant page
ui/assistant_page.py - Upload center
ui/upload_page.py - Admin dashboard
ui/admin_dashboard.py
Request routing
- API entry
api/main.py - Agent entry
src/agent.py - Supervisor
src/supervisor/supervisor.py - Model routing
src/models/router.py - API client
src/api_client.py
Question answering
- SQL engine
src/sql_engine.py - Schema retrieval
src/schema/schema_retriever.py - SQL validation
src/sql_validator.py - Answer generation
src/result_generator.py
Knowledge and memory
- RAG agent
src/agents/rag_agent.py - Knowledge retrieval
src/knowledge/retriever.py - Embeddings
src/memory/embedding_manager.py - SQL memory
src/memory/memory_manager.py - Vector memory
src/memory/vector_memory.py
Data and analytics
- Operational database
src/database.py - Dataframe analysis
src/analytics/dataframe_agent.py - Excel import
src/excel_importer.py - Upload validation
src/schema_validator.py
Other components
- User
- Model service
Connections 25
- User → Streamlit app: uses
- Streamlit app → Assistant page: routes to
app.py - Streamlit app → Upload center: routes to
app.py - Streamlit app → Admin dashboard: routes to
app.py - Assistant page → API client: uses
ui/assistant_page.py - Assistant page → Operational database: uses
ui/assistant_page.py - Upload center → Operational database: uses
ui/upload_page.py - Upload center → Excel import: imports
ui/upload_page.py - Upload center → Upload validation: validates with
ui/upload_page.py - API entry → Agent entry: imports
api/main.py - Supervisor → RAG agent: dispatches to
src/supervisor/supervisor.py - Supervisor → Dataframe analysis: dispatches to
src/supervisor/supervisor.py - Supervisor → SQL engine: dispatches to
- RAG agent → Knowledge retrieval: retrieves from
src/agents/rag_agent.py - Knowledge retrieval → Embeddings: embeds with
src/knowledge/retriever.py - Knowledge retrieval → Model routing: expands query via
src/knowledge/retriever.py - SQL engine → Schema retrieval: retrieves schema
src/sql_engine.py - SQL engine → SQL validation: validates SQL
src/sql_engine.py - SQL engine → Operational database: executes SQL
src/sql_engine.py - SQL engine → SQL memory: searches and saves
src/sql_engine.py - SQL engine → Answer generation: generates answer
src/sql_engine.py - SQL engine → Model routing: requests SQL
src/sql_engine.py - SQL memory → Vector memory: searches and adds
src/memory/memory_manager.py - SQL memory → Operational database: reads and writes
src/memory/memory_manager.py - Model routing → Model service: routes requests