tutorial: Add Google ADK with Couchbase MCP Server#3
Conversation
Add agent script and frontmatter for building an AI agent using Google's Agent Development Kit (ADK) with the Couchbase MCP Server. Jupyter notebook to follow.
|
Caution Notebooks or Frontmatter Files Have Been Modified
1 Notebook Files Modified:
1 Frontmatter Files Modified:
|
There was a problem hiding this comment.
Code Review
This pull request introduces a tutorial and a test script for building an AI agent using Google's Agent Development Kit (ADK) and a Couchbase MCP server. The changes include a sample environment file, tutorial metadata, and a Python script to verify the agent's functionality. Review feedback identifies several critical issues: the CB_BUCKET_NAME and GOOGLE_GENAI_API_KEY environment variables are missing from the loading, validation, and MCP server configuration logic. Additionally, the model identifier gemini-2.5-flash is invalid and must be updated to a supported version such as gemini-1.5-flash to prevent initialization errors.
Adds an interactive notebook with step-by-step tutorial covering: - MCP and Google ADK concepts for beginners - Agent setup with Couchbase MCP Server - 5 example queries (data exploration, SQL++ aggregation, flight/hotel recommendations, sightseeing, budget search)
…flash A/B testing showed gemini-2.5-flash-lite refused to use the landmark collection for the UK sightseeing question and lost conversational context on the budget hotel follow-up. Switch the agent default to gemini-2.5-flash and tighten the system prompt with a schema cheatsheet plus concrete query templates so the agent reliably handles all five notebook questions. Also add test_flash_agent.py and test_flash_lite_agent.py covering all five notebook questions, replacing the older three-question test_agent.py. The slim ask_agent helper now retries on transient 429/503 responses from the Gemini API.
nithishr
left a comment
There was a problem hiding this comment.
You have failing checks as well
- Port iteration-6 production-grade prompt: discovery-first, hallucination
guard, error recovery, read-only awareness, price-string handling. Removes
the test_cluster_connection workaround (fixed in couchbase-mcp-server 0.7.1).
- Add CB_BUCKET_NAME to env loading, validation, MCP config, and .env.sample.
- Add GOOGLE_API_KEY / GOOGLE_GENAI_API_KEY explicit validation.
- Suppress the google-genai SDK "non-text parts in the response" warning
via logging.getLogger("google_genai.types").setLevel(logging.ERROR).
- Fix Jupyter kernel PATH issue: augment os.environ["PATH"] with
~/.local/bin and /opt/homebrew/bin so the uvx subprocess can be found.
- Update documentation links to mcp-server.couchbase.com.
- Add mcp-server.couchbase.com to Additional Resources.
- Reword Q5 to explicitly anchor to the UK trip context.
- Clear all cell outputs for a clean re-run.
- Update test_flash_agent.py with the same prompt and 0.7.1 fix notes.
|
Hey @nithishr, pushed all review fixes in 44384e7:
On the test scripts: they're QA harnesses I used to A/B compare flash vs flash-lite — not tutorial content. Happy to remove both once the notebook is approved. On the failing CI check: the On the gemini-code-assist bot saying |
couchbase-mcp-server doesn't read CB_BUCKET_NAME — verified by grep across src/ and confirmed in the README's Additional Configuration section. The agent already passes bucket_name explicitly to every run_sql_plus_plus_query call, so the env var was redundant noise. Removes CB_BUCKET_NAME from: - .env.sample - the env loading cell (and its print line) - the StdioServerParameters env dict in the agent cell - the .env example block in the setup markdown
|
@nithishr, will remove the test scripts once the notebook is approved. |
nithishr
left a comment
There was a problem hiding this comment.
Remove the test scripts before merging please
Summary
Adds a new tutorial for building an AI agent using Google's Agent Development Kit (ADK) and the Couchbase MCP Server, following the same pattern as the existing
langchain_mcp_adapterandopenai_agentstutorials.This accompanies the Couchbase integration page recently merged into Google's ADK docs (google/adk-docs#1475).
What's included
google_adk/test_agent.py— Agent script that connects to Couchbase via MCP, tested againsttravel-samplebucketgoogle_adk/frontmatter.md— Frontmatter for the developer portalgoogle_adk/.env.sample— Environment variable templateWhat it does
uvx couchbase-mcp-server)Still to come
Test plan