How stephaniew1/agentic-rag-assistant works
Tempo Assistant answers product questions with cited help articles and acts on the caller’s Tempo account. The principal flow is an authenticated chat request through the HTTP app to a shared agent, which either searches the knowledge base or invokes account tools; uploaded PDFs are extracted and safely bounded before reaching the agent. A separate ingestion path builds the article index. The graph also preserves the documented AWS deployment path. Some subsystem links are based on README statements because their implementation was not sampled.
Main entry points: server.py Chat API · assistant-stack.ts CDK assistant stack · agent.py Function agent · rag.py Article search
Components 20
Request entry
- HTTP API gateway
infra/lib/assistant-stack.ts - Lambda adapter
app/lambda_handler.py - Chat API
app/server.py - JWT verification
app/auth.py - PDF boundary
app/documents.py
Assistant runtime
- Function agent
app/agent.py - Assistant policy
app/prompts.py - Runtime configuration
app/config.py
Knowledge retrieval
- Article search
app/rag.py - Article indexing
app/ingest.py - Help articles
data/articles - pgvector index
Account actions
- Account tools
app/tools.py - Tempo product API
mock_api/main.py
AWS deployment
- CDK assistant stack
infra/lib/assistant-stack.ts - Secrets Manager
- CloudWatch alarms
Other components
- Tempo user
- OpenAI models
- JWT identity provider
Connections 21
- Tempo user → HTTP API gateway: sends JWT
README.md - HTTP API gateway → Lambda adapter: routes requests
infra/lib/assistant-stack.ts - Lambda adapter → Chat API: adapts to
app/lambda_handler.py - Chat API → JWT verification: verifies caller
app/server.py - Chat API → PDF boundary: extracts and wraps
app/server.py - Chat API → Function agent: runs agent
app/server.py - Chat API → Tempo user: returns response
app/server.py - JWT verification → JWT identity provider: checks JWKS
app/auth.py - Function agent → Assistant policy: uses policy
app/agent.py - Function agent → Article search: registers search
app/agent.py - Function agent → Account tools: registers tools
app/agent.py - Article search → pgvector index: queries index
app/rag.py - Article search → OpenAI models: uses models
app/rag.py - Article indexing → Help articles: loads articles
app/ingest.py - Article indexing → pgvector index: rebuilds index
app/ingest.py - Account tools → Tempo product API: calls API
app/tools.py - CDK assistant stack → HTTP API gateway: configures routes
infra/lib/assistant-stack.ts - CDK assistant stack → Lambda adapter: configures function
infra/lib/assistant-stack.ts - CDK assistant stack → Secrets Manager: grants secret access
infra/lib/assistant-stack.ts - CDK assistant stack → CloudWatch alarms: sets metrics alarms
infra/lib/assistant-stack.ts - Runtime configuration → Secrets Manager: loads runtime values
README.md