{"slug": "your-ai-agent-gave-an-answer-can-it-show-its-work", "title": "Your AI Agent Gave an Answer. Can It Show Its Work?", "summary": "A developer built the Gemini Agriculture Research Assistant, an open-source reference application that turns complex crop-research questions into transparent, citation-backed answers. The system chains Gemini via the google-genai Interactions API, Google Search Grounding, deterministic Python verification, Google ADK, and OpenTelemetry through explicit stages—planning, query fan-out, source normalization, evidence extraction, claim verification, and cited synthesis—so each step leaves an inspectable artifact. It includes a reproducible offline demo mode that runs without an API key and deliberately keeps consequential agronomic decisions under human control.", "body_md": "Generative AI can produce an answer in seconds.\n\nBut when that answer could influence a real-world decision, speed and fluency are not enough.\n\nImagine asking an AI assistant:\n\nWhat does current research say about irrigation strategies for drought-stressed tomatoes grown in clay soil, and what additional local information is needed before applying the findings?\n\nA conventional chatbot may return a polished recommendation. It may even sound authoritative.\n\nBut a researcher, agronomist, grower, or responsible AI developer should ask harder questions:\n\nThose questions inspired me to build the open-source **Gemini Agriculture Research Assistant**—an educational reference application that turns a complex question into a transparent, evidence-grounded, and observable research journey.\n\nThe project combines:\n\nIn this article, I’ll explain the architecture, why each component exists, and the patterns you can reuse when building trustworthy AI agents in other domains.\n\n**GitHub repository:**\n\nFrom complex crop questions to transparent, evidence-grounded research.\n\n**Gemini Agriculture Research Assistant** is an open-source, evidence-grounded crop research and developer-learning system. It demonstrates how **Gemini** (via the `google-genai` Interactions API), **Google Search Grounding**, **deterministic Python verification**, **Google ADK**, and **OpenTelemetry** work together to turn complex agricultural questions into transparent, citation-backed research—while keeping consequential agronomic decisions under human control.\n\nImportant\n\n**Research Assistant — Not an Autonomous Agronomist:** This system helps researchers, extension professionals, educators, and developers investigate agricultural literature. It never prescribes chemical dosages, fertilizer rates, or rigid irrigation schedules, and it never replaces field inspection or local Cooperative Extension advice.\n\nAgricultural questions involve interacting biological, soil-physics, climatic, and economic variables. Single-shot LLM answers often blend peer-reviewed findings with unverified web advice, gloss over cultivar/stage trade-offs, or emit confident schedules without knowing local soil moisture or evapotranspiration ($\\text{ET}_o$)…\n\n**PyPi Package:**\n\nThe application does not treat research as one enormous prompt.\n\nInstead, it models research as a sequence of explicit, inspectable stages:\n\n```\nUser Question\n      ↓\nResearch Planning\n      ↓\nQuery Fan-Out\n      ↓\nGoogle Search Grounding\n      ↓\nSource Normalization and Deduplication\n      ↓\nEvidence Extraction\n      ↓\nClaim Verification\n      ↓\nCited Synthesis\n      ↓\nConversational Follow-Up\n```\n\nThis separation matters.\n\nWhen retrieval, verification, and synthesis are hidden inside one model call, the final prose may look impressive while the underlying process remains impossible to inspect.\n\nIn this application, every stage leaves an artifact:\n\nThe goal is not simply to generate an answer.\n\nThe goal is to build an answer that can show its work.\n\nThe application starts with a focused interface where the user can enter a research question, select a preset, provide optional field context, and choose between live and demonstration modes.\n\nThe interface supports two execution modes.\n\nLive mode uses Gemini and Google Search grounding to retrieve current public information.\n\nDemo mode uses a reproducible offline evidence fixture and does not require an API key.\n\nThis is more important than it may initially appear.\n\nA deterministic mode allows the project to run during:\n\nIt also makes the behavior easier to test. A developer can validate the complete user journey without depending on continuously changing search results.\n\nResearch questions are rarely atomic.\n\nThe tomato irrigation question contains several independent concerns:\n\nThe Gemini-powered planner extracts the relevant context and decomposes the original question into focused research tasks.\n\nInstead of hiding this decomposition inside the model, the application exposes it to the user.\n\nA visible plan allows the user to ask:\n\nThis is one of the most reusable agent-design patterns:\n\nMake the plan inspectable before asking users to trust the result.\n\nOne search query represents only one phrasing of a problem.\n\nA useful research process often needs several targeted searches covering:\n\nThe application fans the research plan out into explicit Google Search tasks.\n\nThe Query Fan-Out view shows:\n\nThis solves an important trust problem:\n\nThere are no silent searches.\n\nThe user can see what the agent searched for and where retrieval may have missed an important angle.\n\nQuery fan-out improves recall, but more search results do not automatically create more truth.\n\nThe next step is to preserve source identity and evidence provenance.\n\nSearch results are only candidates.\n\nThe assistant normalizes and deduplicates the retrieved sources before using them as evidence.\n\nFor every source, the application preserves information such as:\n\nThere is an important difference between a URL list and an evidence record.\n\nA URL tells us where information came from.\n\nAn evidence record also tells us:\n\nThis provenance chain is useful far beyond agriculture.\n\nThe same pattern can support:\n\nWhenever users must inspect the path from a source to a conclusion, provenance must survive every stage of the pipeline.\n\nThe answer composer should not be the only component deciding whether a statement is established.\n\nBefore synthesis, the application evaluates candidate claims against the collected evidence.\n\nEach claim receives one of five statuses:\n\n| Status | Meaning | \n|---|---|\n| **Supported** | Retrieved evidence directly supports the claim. | \n| **Partially Supported** | Evidence supports only part of the statement or requires qualification. | \n| **Conflicting** | Retrieved sources disagree or describe incompatible conditions. | \n| **Unknown** | Available evidence is insufficient. | \n| **Suppressed** | The claim is withheld from established findings because of evidence-quality or safety rules. | \n\nThis gives the final answer a safer vocabulary.\n\nInstead of smoothing over disagreement, the assistant can explicitly state:\n\nThat qualification is especially important in agriculture.\n\nResults from one cultivar, climate, irrigation system, market class, growth stage, or soil profile may not transfer directly to another field.\n\nThe application is therefore a **research-transparency and decision-support tool**.\n\nIt is not an autonomous agronomist.\n\nHuman experts and local field validation remain in control.\n\nAfter verification, the answer composer produces a synthesis that distinguishes between:\n\nThe result is not merely a collection of links.\n\nIt connects the research question to:\n\nA confident sentence should never become disconnected from the evidence that produced it.\n\nA static report is useful, but users naturally want to ask follow-up questions:\n\nThe Google ADK research agent answers questions against the selected research run.\n\nThe agent can use tools to:\n\nThis grounding boundary is intentional.\n\nA normal follow-up should not silently detach itself from the evidence already under review or launch unrelated searches without making that behavior visible.\n\nThe research agent should know which run, sources, claims, and trace the user is discussing.\n\nThe visible response is only the final event in an agentic workflow.\n\nDevelopers also need to inspect:\n\nGoogle ADK Dev UI makes this behavior inspectable.\n\nIn the screenshot, we can see the agent:\n\n`get_selected_run`\nThis is valuable when debugging agent behavior.\n\nIf the final response is incomplete, we can ask:\n\nWithout this visibility, developers are left debugging only the final text.\n\n“We added observability” can mean many different things.\n\nIn this architecture, each component has a distinct responsibility.\n\n| Component | Responsibility | Question it answers | \n|---|---|---|\n| **OpenTelemetry** | Instruments the application and exports telemetry | What telemetry does the application produce? | \n| **Prometheus** | Stores and queries time-series metrics | How many runs occurred, how slow were they, and how often did they fail? | \n| **Tempo** | Stores distributed traces and spans | What happened inside this specific run? | \n| **Grafana** | Visualizes metrics and explores traces | How can developers navigate and correlate system behavior? | \n\nThis distinction prevents a common source of confusion:\n\nPromQL is used for Prometheus metrics. TraceQL is used for Tempo traces.\n\nOpenTelemetry instruments the application.\n\nIt creates telemetry describing important operations such as:\n\nThe OpenTelemetry Collector receives this telemetry and routes it to the appropriate backend.\n\nPrometheus answers aggregate operational questions:\n\nTempo answers questions about an individual execution:\n\nGrafana provides the navigation and visualization layer.\n\nIt connects aggregate metrics with individual traces and gives developers a practical place to investigate system behavior.\n\nThe Grafana overview dashboard shows the overall health of the research assistant.\n\nThe dashboard includes:\n\nThis answers the operational question:\n\nIs the research system healthy overall?\n\nBut aggregate metrics cannot explain everything.\n\nWhen one execution is unexpectedly slow or produces an unusual result, we need the trace.\n\nThe trace explorer separates different types of activity:\n\nDevelopers can filter traces by:\n\nEach trace ID opens the full parent-child waterfall in Tempo.\n\nA useful trace should mirror the mental model of the application.\n\nFor this project, that means creating spans for:\n\nWhen a run is slow or degraded, the waterfall can show whether the delay came from:\n\nThat is the difference between knowing **that** an agent failed and knowing **where and why** it failed.\n\nObservability is not only an infrastructure feature.\n\nFor AI agents, observability is part of product trust.\n\nAn agentic application is rarely one process.\n\nThis project requires:\n\nInstalling and configuring all of these components independently would create unnecessary friction for learners and contributors.\n\nDocker Compose turns the architecture into one reproducible environment.\n\nDocker provides:\n\nFrom a Docker perspective, the lesson is broader than packaging:\n\nContainers make a complex architecture teachable.\n\nThe same services and relationships can be reproduced across:\n\nClone the repository:\n\n```\ngit clone https://github.com/hastimal/gemini-agriculture-research-assistant.git\ncd gemini-agriculture-research-assistant\n```\n\nStart the deterministic demonstration stack:\n\n```\n./scripts/run_all.sh demo\n```\n\nThe script starts the complete environment and prints the available service URLs.\n\nWhen you are finished:\n\n```\n./scripts/run_all.sh stop\n```\n\nFor live Gemini and Google Search grounding, copy the environment example, configure the required Gemini API key, and use the live mode documented in the repository.\n\nYou can also install the Python package:\n\n```\npip install gemini-agriculture-research-assistant\n```\n\nExplore the CLI:\n\n```\ncrop-research --help\n```\n\nThe most reusable parts of this project are not specific to agriculture.\n\nUsers should see how a broad goal becomes smaller tasks.\n\nHidden decomposition is difficult to evaluate.\n\nShow the executed queries, not only the final citations.\n\nThis exposes both research coverage and omissions.\n\nA final sentence should be traceable to:\n\n```\nFinal Statement\n      ↓\nVerified Claim\n      ↓\nEvidence Passage\n      ↓\nNormalized Source\n      ↓\nOriginal URL\n```\n\nThe component that writes persuasive prose should not be the only component deciding whether a statement is established.\n\nConflicting, unknown, and partially supported findings should not be hidden.\n\nThey are valuable research results.\n\nAPIs time out.\n\nQuotas expire.\n\nModels become unavailable.\n\nSchemas change.\n\nA responsible system should display degraded and failed states instead of returning a confident-looking fallback without explanation.\n\nDisplay run and trace IDs in the application.\n\nA developer should be able to move from an unexpected answer directly to the trace that produced it.\n\nThe most interesting question is no longer:\n\nCan an LLM answer this question?\n\nThe better questions are:\n\nCan the system show how it planned the work?\n\nCan it identify the evidence behind every important claim?\n\nCan it surface disagreement and uncertainty?\n\nCan users inspect the searches that were executed?\n\nCan developers reproduce, observe, test, and improve the workflow?\n\nGemini provides the intelligence.\n\nGoogle ADK provides inspectable orchestration, state, agents, and tools.\n\nGoogle Search grounding supplies current public evidence.\n\nOpenTelemetry captures the workflow.\n\nPrometheus measures aggregate behavior.\n\nTempo stores individual traces.\n\nGrafana connects operational health with deep investigation.\n\nDocker makes the complete system reproducible.\n\nTogether, these technologies turn a clever AI demo into an engineering system that developers can study, challenge, and extend.\n\nAlthough this project focuses on agricultural research, the same architecture can be adapted to other evidence-heavy domains:\n\nThe domain can change while the core engineering contract remains the same:\n\n**Plan transparently. Retrieve explicitly. Verify before synthesis. Preserve provenance. Trace everything. Keep humans in control.**\n\n**GitHub:**\n\n[github.com/hastimal/gemini-agriculture-research-assistant](https://github.com/hastimal/gemini-agriculture-research-assistant)\n\n**PyPI installation:**\n\n```\npip install gemini-agriculture-research-assistant\n```\n\n**CLI:**\n\n```\ncrop-research --help\n```\n\nIf you build on the project, I would love to hear:\n\nI build and teach practical AI-agent systems across Google technologies, Docker, and cloud-native observability.\n\nAs a Cloud & AI Expert and an open-source-focused community builder, I believe the next generation of AI education should go beyond model prompts. Developers should learn how to build complete systems that are grounded, observable, reproducible, and responsible.\n\nThis project is an educational reference implementation. Its research output should support—not replace—qualified agricultural expertise and local field validation.", "url": "https://wpnews.pro/news/your-ai-agent-gave-an-answer-can-it-show-its-work", "canonical_source": "https://dev.to/hjangid/your-ai-agent-gave-an-answer-can-it-show-its-work-1jfa", "published_at": "2026-12-06 23:08:51+00:00", "updated_at": "2026-12-06 23:14:31.156850+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "large-language-models", "ai-safety", "developer-tools"], "entities": ["Gemini", "Google Search Grounding", "Google ADK", "OpenTelemetry", "google-genai", "Gemini Agriculture Research Assistant"], "also_reported_by": [], "takeaway": "Modeling research as explicit stages—planning, query fan-out, source deduplication, evidence extraction, claim verification, then cited synthesis—leaves an inspectable artifact at each step instead of hiding retrieval and verification inside one model call.", "recommendation": {"advice": "Split agent research into explicit stages with deterministic verification and a reproducible offline fixture so you can test the full journey without depending on live search results.", "playbook": "output-verification", "playbook_url": "https://wpnews.pro/playbooks/output-verification"}, "alternates": {"html": "https://wpnews.pro/news/your-ai-agent-gave-an-answer-can-it-show-its-work", "markdown": "https://wpnews.pro/news/your-ai-agent-gave-an-answer-can-it-show-its-work.md", "text": "https://wpnews.pro/news/your-ai-agent-gave-an-answer-can-it-show-its-work.txt", "jsonld": "https://wpnews.pro/news/your-ai-agent-gave-an-answer-can-it-show-its-work.jsonld"}}