Inspiration
Managing expense reports and auditing receipts is a notoriously tedious task across both corporate and academic settings. Most AI chatbots simply summarize invoice text, leaving human operators to manually verify compliance rules, flag discrepancies, and update databases.
We were inspired to build the Expense Taskmaster Agent to solve this exact problem: moving beyond conversational chat loops to create a truly autonomous, event-driven agent. By leveraging Gemini 3.5 Flash, our goal was to delegate the heavy lifting of compliance verification and background database logging directly to an AI execution pipeline.
How We Built It
The system follows an asynchronous task-runner pattern using Python and the official google-genai SDK:
- Agent Logic & Core Engine: We configured
gemini-3.5-flashwith direct access to local Python functions (tools). - Native Function Calling: Instead of manually parsing text outputs with regex, the agent autonomously decides when to invoke
verify_expense_policy()andlog_to_database(). - Policy Math Engine: The policy engine checks transaction values against category limits. For example, given a threshold vector for allowed spend per category $C$:
$$L(C) = \begin{cases} 100.00 & \text{if } C = \text{Meals} \ 500.00 & \text{otherwise} \end{cases}$$
The audit condition for an expense amount $A$ evaluates as:
$$\text{Status}(A, C) = \begin{cases} \text{FLAGGED} & \text{if } A > L(C) \ \text{APPROVED} & \text{if } A \le L(C) \end{cases}$$
- Packaging & Cloud Deployment: We containerized the pipeline for Google Cloud Run using a serverless execution pattern with
--min-instances 0to keep idle operating costs near zero.
Challenges We Faced
- Tool Binding & Schema Validation: Ensuring the model consistently returned clean parameters matching our Python type annotations required carefully tuning the system instructions and setting a lower temperature ($0.2$).
- Asynchronous Execution in Colab: Packaging an environment built in Google Colab into clean standalone artifacts (
main.pyandrequirements.txt) required writing export scripts directly inside the notebook environment.
What We Learned
- Agentic Workflows > Chat Interfaces: Empowering models with direct function-calling capabilities shifts AI from a passive assistant to an active system administrator.
- Serverless Cost Efficiency: Gemini 3.5 Flash's speed and low cost make it ideal for high-volume background processing without incurring continuous runtime expenses.
Log in or sign up for Devpost to join the conversation.