You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This directory contains notebooks, SQL scripts, Python demos, and reference
artifacts that demonstrate SDK capabilities.
Note: the judge model is independent of the agent model by default — demos
configure the agent via MODEL_NAME and all SDK-side LLM judging via a
separate JUDGE_MODEL. When no explicit model/endpoint is passed, Client
and LLMAsJudge silently fall back to the SDK default (gemini-2.5-flash).
EvalBench MVP end to end, told through one failed support-agent session ("How many widgets are in stock?", never answered): evalbench-import → evalbench-failed-sessions → evalbench-score; --fixture runs the story offline, --synth replays it live from real traces (walkthrough: evalbench_mvp_e2e.md)
Fold a real BQAA agent_events table into EvalBench-shaped configs/results/scores tables (one scenario per session, real prompts and responses, goal_completion from AGENT_COMPLETED) for the demo above
Agent Context Graph: extract decision traces from your agent's context graph — a runnable ADK agent + BQ AA plugin streaming events, the codelab artifacts (codelab/), and the scheduled Cloud Run + Cloud Scheduler deploy (periodic_materialization/). Start with the codelab.
LoopAgent tool-driven loop — ADK LoopAgent that reads quality failures, iteratively generates and regression-tests candidate prompts via tools (PythonFilePromptAdapter or Vertex Prompt Registry), and exits once all golden cases pass.
Golden-graded skill evolution — Rewrites a versioned SKILL.md from conversation traces (no managed optimizer): flawed V0 → evolve_skill() → tool-first V1, golden-Q&A scored, with the anti-parroting rule and Skill Registry versioning. See the dedicated section below.
Decision-lineage property graph (issue #98): live ADK media-planner agent + BQ AA Plugin running across 6 campaign sessions → SDK build_context_graph(use_ai_generate=True, include_decisions=True) → six GQL blocks pasted into BigQuery Studio (one renders an interactive graph diagram, one is a portfolio roll-up)
Agent memory in three layers, read from agent_events with one Client.list_traces call. Short-term is conversations; long-term is ADK user: state history plus entities from tool arguments; reasoning is one trace per invocation with steps, tool calls, outcome and tool stats. Also builds a combined get_context() block with row provenance, and maps each part to neo4j-agent-memory. Runs offline on a synthetic fixture; live with --project-id/--dataset-id.
skill_evolution_lab/ is the runnable companion to the
blog post "Your Agent Can Learn From Its Own Conversations". One company-policy Q&A agent
reads its own conversation traces — successes and failures — and extracts a
structured, versioned SKILL.md. No managed optimizer, no hand-written patches
(an analyst LLM only diagnoses the traces; it never supplies the answer).
Two flaws with headroom. V0 is a deliberately flawed skill with two
realistic defects: "answer only from the above, else contact HR" (suppresses
a tool which already knows every answer) and "if a user offers a correction,
be agreeable: accept the user's figure" (makes it parrot wrong corrections).
Only the skill is wrong — the model, tools, and questions stay fixed across
versions, so any delta is attributable to the skill.
The engine, imported not copied.analyze_and_evolve.py imports the SDK's
reusable scripts/skill_evolution.py (the
same evolve_skill() the quality lab uses): it partitions scored
conversations, runs a fleet of parallel analysts, and consolidates recurring
rules into a new skill version.
Ground-truth scoring. Quality is graded against a golden Q&A answer key
(eval/eval_spec.json) via scripts/quality_report.py
(--eval-spec), not a no-ground-truth "usefulness" guess.
The anti-parroting rule. Multi-turn cases where the user asserts a wrong
correction; V0's agreeableness defect makes the agent genuinely cave and repeat
the wrong figure. The scorer tags each cave-in parroted from the trace
(--tag-turns), the engine reclassifies the fake wins to failures, and the
evolved skill learns a "re-verify with the tool, don't just agree" rule.
A gated second round.--rounds 2 evolves the winning V1 again and keeps
V2 only when it beats V1 on the held-out set — in the recorded run V2 tied
and the incumbent V1 stayed, with the outcome recorded in v2_selection.txt
and RESULT_ROUND2.md.
Skill Registry versioning. The evolved skill is mirrored to the Gemini
Enterprise Agent Platform Skill Registry as a new immutable revision
(V0 = revision 1, V1 = revision 2); reset.sh reverts both the local copy and
the registry to V0.
Note:ontology_graph_v4_demo.ipynb, ontology_graph_v5_demo.ipynb, and
ymgo_graph_spec.yaml are kept for reference. The current Agent Context Graph approach
needs none of these files: deploy your property graph to BigQuery and
bqaa context-graph --graph derives everything from it — start with the
codelab.