How aasrithadevireddy/privacy-budget-autopilot-v2 works
Company GPT is an enterprise AI copilot. A browser request reaches FastAPI and the chat service, which classifies the task, optionally retrieves role- and project-filtered knowledge, applies privacy controls, selects an OpenAI or local response, and records conversation/audit state. Separate capabilities include project-ingestable TF-IDF RAG, code/SQL task handling, feedback, history, and budget inspection. Edges reflect the excerpts and README; unsampled frontend/API wiring and training behavior are not inferred beyond documented capabilities.
Main entry points: service.py Chat orchestrator · database.py Conversation and audit store · app.py FastAPI endpoints · rag.py Project-filtered TF-IDF RAG
Components 17
User interface
- Browser client
frontend/app.js
API and orchestration
- FastAPI endpoints
backend/app.py - Request schemas
backend/schemas.py - Chat orchestrator
backend/service.py - Task and language analysis
backend/request_analyzer.py - Task strategy policy
backend/task_policy.py - Runtime configuration
backend/config.py
Knowledge and policy
- Project-filtered TF-IDF RAG
backend/rag.py - Project knowledge documents
knowledge_base - Role authorization
backend/rbac.py - Privacy budget policy
backend/privacy.py
Answer generation
- OpenAI generation
backend/llm.py - Deterministic task solver
backend/task_solver.py
Persistent state
- Conversation and audit store
backend/database.py - SQLite database
Other components
- Copilot user
- OpenAI service
Connections 22
- Copilot user → Browser client: sends request
README.md - Browser client → FastAPI endpoints: calls API
- FastAPI endpoints → Request schemas: validates chat
backend/app.py - FastAPI endpoints → Chat orchestrator: dispatches chat
backend/app.py - Chat orchestrator → Task and language analysis: analyzes request
backend/service.py - Chat orchestrator → Task strategy policy: chooses strategy
backend/service.py - Chat orchestrator → Project-filtered TF-IDF RAG: retrieves context
backend/service.py - Project-filtered TF-IDF RAG → Project knowledge documents: indexes and searches
backend/rag.py - Project-filtered TF-IDF RAG → Role authorization: checks document access
backend/rag.py - Chat orchestrator → Role authorization: gets role level
backend/service.py - Chat orchestrator → Privacy budget policy: decides disclosure
backend/service.py - Chat orchestrator → OpenAI generation: requests generation
backend/service.py - Chat orchestrator → Deterministic task solver: uses local fallback
backend/service.py - OpenAI generation → OpenAI service: generates response
README.md - Chat orchestrator → Conversation and audit store: reads and records history
backend/service.py - Privacy budget policy → Conversation and audit store: reads and updates budget
backend/privacy.py - FastAPI endpoints → Conversation and audit store: records feedback and reads audits
backend/app.py - Conversation and audit store → SQLite database: persists records
backend/database.py - Project-filtered TF-IDF RAG → Runtime configuration: loads paths
backend/rag.py - Conversation and audit store → Runtime configuration: loads database path
backend/database.py - OpenAI generation → Runtime configuration: loads model settings
backend/llm.py - Privacy budget policy → Runtime configuration: loads budget settings
backend/privacy.py