← Back to cookbooks
Intermediate · 40-70 min
Gemini API tool-grounding workflow for coding assistants
Design a grounded coding assistant using Gemini API tools, explicit context retrieval, and deterministic response formatting.
Last reviewed Feb 25, 2026
Use case
Build a coding assistant that answers with grounded, source-linked recommendations.
Architecture
- Query intake
- Context retrieval (repo + docs)
- Tool execution (search, file reads, tests)
- Structured response with citations
Prompt contract
Require these output sections:
- decision summary
- referenced files
- command evidence
- confidence and risks
Validation checklist
- every recommendation maps to a source
- no invented file paths
- no unverified runtime claims
Operational tips
- cache retrieval for repeated prompts
- separate planning from execution calls
- keep tool budget and timeout limits explicit