How dwivedi1823/prodapi works
This repository is a web-based LLM chat assistant. Its main workflow runs from browser chat submission through API validation, input security checks, cache lookup, agent/model invocation on a miss, output checks, and response delivery; the API also records request metrics. A separate document-loading utility reads local text/PDF files and web pages, but the sampled code does not connect it to chat or retrieval. The README contains no readable capability details, so this map follows the source and tree; unsampled endpoint behavior is shown only where directly evident.
Main entry points: main.py FastAPI app · agent.py LangGraph agent · document_loaders.py Document loader · app.js Chat interface
Components 15
Chat client
- Chat interface
frontend/app.js - Chat page
frontend/index.html
API workflow
- FastAPI app
app/main.py - Request models
app/models.py
Assistant runtime
- Security pipeline
app/security.py - Response cache
app/cache.py - LangGraph agent
app/agent.py - Settings
app/config.py
Operations
- Metrics collector
app/monitoring.py
Document loading
- Local documents
data - Document loader
document_loaders.py
Other components
- Chat user
- Primary model
- Fallback model
- Web documents
Connections 16
- Chat user → Chat interface: uses
- Chat interface → FastAPI app: posts chat
- FastAPI app → Chat page: serves page
- FastAPI app → Request models: validates payload
- FastAPI app → Security pipeline: checks input
- FastAPI app → Response cache: looks up
- FastAPI app → LangGraph agent: invokes on miss
- LangGraph agent → Primary model: invokes
- LangGraph agent → Fallback model: falls back to
- FastAPI app → Security pipeline: validates output
- FastAPI app → Response cache: stores response
- FastAPI app → Metrics collector: records requests
- FastAPI app → Settings: loads settings
- LangGraph agent → Settings: loads settings
- Document loader → Local documents: reads
- Document loader → Web documents: loads pages