How harrish8248/ambient-expense-agent works
Ambient Expense Agent is an ADK-based expense-auditing application, with a separate basic assistant scaffold. The main path accepts an expense through the FastAPI/Pub/Sub service, runs threshold routing and security checks, performs Gemini risk analysis when appropriate, pauses for human decisions, then records the outcome. A separate Agent Engine runtime exposes feedback and telemetry; the basic assistant has its own weather/time tools. Workflow-stage transitions are documented in the README; service and runtime edges are limited to relationships visible in the excerpts.
Main entry points: expense_agent/agent_runtime_app.py Agent Engine runtime · agent.py Parse and route · service_app.py FastAPI service · app/agent_runtime_app.py Basic Agent Engine runtime
Components 20
Service and Sessions
- FastAPI service
expense_agent/service_app.py - SQLite sessions
expense_agent/service_app.py
Expense Audit Workflow
- Expense workflow
expense_agent/agent.py - Parse and route
expense_agent/agent.py - Threshold settings
expense_agent/config.py - Auto-approve
expense_agent/agent.py - Security checkpoint
expense_agent/agent.py - LLM risk analysis
expense_agent/agent.py - Human approval
expense_agent/agent.py - Record outcome
expense_agent/agent.py
Runtime and Observability
- Agent Engine runtime
expense_agent/agent_runtime_app.py - Feedback model
expense_agent/app_utils/typing.py - Telemetry setup
expense_agent/app_utils/telemetry.py
Basic Assistant
- Basic ADK assistant
app/agent.py - Basic Agent Engine runtime
app/agent_runtime_app.py - Feedback model
app/app_utils/typing.py - Telemetry setup
app/app_utils/telemetry.py
Other components
- Pub/Sub or HTTP sender
- Human reviewer
- Cloud Operations
Connections 22
- Pub/Sub or HTTP sender → FastAPI service: sends event
README.md - FastAPI service → SQLite sessions: reads and writes
expense_agent/service_app.py - FastAPI service → Expense workflow: runs workflow
expense_agent/service_app.py - Human reviewer → FastAPI service: submits decision
expense_agent/service_app.py - Expense workflow → Parse and route: starts at
expense_agent/agent.py - Parse and route → Threshold settings: uses threshold
expense_agent/agent.py - Parse and route → Auto-approve: routes below threshold
README.md - Parse and route → Security checkpoint: routes for review
README.md - Security checkpoint → LLM risk analysis: safe: analyze
README.md - Security checkpoint → Human approval: injection: escalate
README.md - LLM risk analysis → Human approval: requests review
README.md - Human approval → Human reviewer: requests decision
README.md - Human approval → Record outcome: resumes with decision
README.md - Auto-approve → Record outcome: records approval
README.md - Agent Engine runtime → Expense workflow: hosts app
expense_agent/agent_runtime_app.py - Agent Engine runtime → Telemetry setup: sets up
expense_agent/agent_runtime_app.py - Agent Engine runtime → Feedback model: validates feedback
expense_agent/agent_runtime_app.py - Agent Engine runtime → Cloud Operations: logs feedback
expense_agent/agent_runtime_app.py - Telemetry setup → Cloud Operations: configures telemetry
expense_agent/app_utils/telemetry.py - Basic Agent Engine runtime → Basic ADK assistant: hosts app
app/agent_runtime_app.py - Basic Agent Engine runtime → Telemetry setup: sets up
app/agent_runtime_app.py - Basic Agent Engine runtime → Feedback model: validates feedback
app/agent_runtime_app.py