How anushkapunekar/custom-rag-agent-builder works
This is a local-first document RAG application with Google Drive ingestion, a main user knowledge base, and isolated configurable agents. The principal workflow is sign-in, attach documents, ingest and index them, then ask questions answered from retrieved context; users can also build agents, chat with their separate knowledge bases, and provide feedback for retrieval-level learning. The graph follows documented capabilities and sampled routes; wiring for unsampled ingestion, agent, and UI implementations is shown only at the documented subsystem level.
Main entry points: main.py FastAPI app · App.jsx App routing · agents.py Agent routes · api.js REST client
Components 22
Web client
- App routing
frontend/src/App.jsx - Main chat
frontend/src/components/Chat.jsx - Drive UI
frontend/src/components/DriveFiles.jsx - Agent workspace
frontend/src/components/AgentWorkspace.jsx - Agent builder
frontend/src/components/AgentBuilder.jsx - REST client
frontend/src/api/api.js
Backend API
- FastAPI app
backend/app/main.py - Authentication
backend/app/auth.py - Drive routes
backend/app/drive.py
Knowledge processing
- QA routes
backend/app/retriever.py - Index management
backend/app/index_routes.py - Document indexing
backend/app/indexer.py - Chunking and embeddings
backend/app/rag_utils.py - Maintenance
backend/app/maintenance.py - Embedding and generation models
Agent workflows
- Agent routes
backend/app/agents.py - Chat history routes
backend/app/chat_history.py
Persistence
- Local files and indexes
backend/data - User database
backend/app/users.db - Chroma index
backend/data/chroma
Other components
- User
- Google Drive
Connections 32
- User → App routing: uses
- App routing → Main chat: renders
- App routing → Drive UI: renders
- App routing → Agent workspace: renders
- App routing → Agent builder: renders
- Main chat → REST client: requests answers
- Drive UI → REST client: requests files
- Agent builder → REST client: creates agents
- Agent workspace → REST client: requests agent data
- REST client → FastAPI app: REST calls
- FastAPI app → Authentication: registers routes
- FastAPI app → Drive routes: registers routes
- FastAPI app → QA routes: registers routes
- FastAPI app → Index management: registers routes
- FastAPI app → Maintenance: registers routes
- FastAPI app → Agent routes: registers routes
- FastAPI app → Chat history routes: registers routes
- Drive routes → Google Drive: imports documents
- Drive routes → Document indexing: indexes documents
- Document indexing → Chunking and embeddings: chunks and embeds
- Chunking and embeddings → Embedding and generation models: encodes text
- Document indexing → Local files and indexes: writes files and vectors
- Index management → Document indexing: reindexes user
- Index management → Chroma index: reads index status
- QA routes → Local files and indexes: loads index and history
- QA routes → Embedding and generation models: retrieves and generates
- QA routes → Local files and indexes: saves chat and feedback data
- Agent routes → Chunking and embeddings: builds agent indexes
- Agent routes → Local files and indexes: stores agent documents
- Agent routes → User database: stores agent metadata
- Agent routes → Embedding and generation models: answers agent queries
- Chat history routes → Local files and indexes: reads and writes history