How kashish1530/ai-assistant works
This repository is a Groq-backed assistant served through chat and HTTP interfaces. A request enters either interface, reaches the capstone agent, loads and updates per-user preferences, then runs a tool-calling loop with guardrails and an approval gate for dangerous actions. Tool results inform the final response, which is checked before return. The README also documents request auditing, metrics, and a monitoring dashboard. The sampled source supports the capstone internals and Streamlit wiring; FastAPI and dashboard links follow README documentation, while detailed implementation for those unsampled modules is not established here.
Main entry points: day5_s1_capstone.py Capstone agent · day5_s2_fastapi_server.py FastAPI endpoint · day5_s2_streamlit.py Streamlit chat · metrics.py Request metrics
Components 16
User interfaces
- Streamlit chat
DAY5/day5_s2_streamlit.py - FastAPI endpoint
day5_s2_fastapi_server.py
Agent workflow
- Capstone agent
day5_s1_capstone.py - User preferences
day5_s1_capstone.py - Guardrail checks
day5_s1_capstone.py - Approval gate
day5_s1_capstone.py - Tool loop
day5_s1_capstone.py
Tools and services
- Groq LLM
- Assistant tools
day5_s1_capstone.py - SMTP email
- JSON memory files
DAY5/memory_store
Monitoring
- Audit log
logs/audit.jsonl - Request metrics
metrics.py - Monitoring dashboard
dashboard.py - Metrics endpoint
day5_s2_fastapi_server.py
Other components
- User
Connections 19
- User → Streamlit chat: sends message
- User → FastAPI endpoint: sends request
- Streamlit chat → Capstone agent: calls agent
- FastAPI endpoint → Capstone agent: calls agent
- Capstone agent → User preferences: loads and updates
- User preferences → JSON memory files: reads and writes
- Capstone agent → Guardrail checks: checks input
- Capstone agent → Tool loop: runs agent
- Tool loop → Groq LLM: requests completion
- Groq LLM → Tool loop: returns response
- Tool loop → Assistant tools: dispatches calls
- Assistant tools → SMTP email: sends email
- Tool loop → Approval gate: requests approval
- Approval gate → Assistant tools: permits action
- Tool loop → Guardrail checks: checks output
- Capstone agent → Audit log: records events
- Capstone agent → Request metrics: records metrics
- Monitoring dashboard → Request metrics: reads metrics
- FastAPI endpoint → Metrics endpoint: serves summary