Skip to content

Add an extracted graph condition to the agent benchmark - #722

Open
jaywyawhare wants to merge 1 commit into
hydra-db:bench/agent-repeatsfrom
jaywyawhare:bench/agent-extracted
Open

jaywyawhare wants to merge 1 commit into
hydra-db:bench/agent-repeatsfrom
jaywyawhare:bench/agent-extracted

Conversation

@jaywyawhare

@jaywyawhare jaywyawhare commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add an extracted condition to the agent benchmark: the same read-only graph tools over a graph SelfGraph builds itself from the documents, next to the hand-written gold graph. The existing graph condition is now described as the gold-graph upper bound, and the run reports how close extraction gets to it.

Implementation details

Decisions

  • The extracted graph is built through the server's upsert_text, one document at a time oldest first, with source_id and event_time from the document, the benchmark schema, and contradiction="supersede". --extract-model picks the model (default --model).
  • Default conditions are now baseline,graph,extracted.
  • The MCP server holds one graph per process, so conditions run in phases: build a graph, ask its questions, close it, then the next. Questions inside a phase still run concurrently.
  • A fidelity report against the gold graph: entity recall by normalized name or alias, relation precision and recall over (from, type, to) triples including retired ones, extraction seconds, and warnings. It is in the output and under extracted.fidelity in the results JSON.
  • The test fakes extraction the way tests/test_cli.py does, with FakeLLM from tests/helpers.py, so precision and recall are checked exactly with no network model.

Validation

  • The changed test fails on base and passes here.
  • scripts/precheck.py passes (384 changed lines, clean trial merge).
  • tests/test_agent_benchmark.py passes on Kuzu. Ruff passes.

Limits

Extraction tokens and cost are not measured, since upsert_text does not return LLM usage. The estimate has an extract row instead.

Linked issue

Closes #718

AI Assistance

AI tools helped write and test parts of this. I reviewed and ran every change.

Checklist

  • Implements an issue a maintainer has /approved.
  • Small and scoped to that issue.
  • New errors have a code and hint, the same on API, CLI, and MCP in both SDKs (see AGENTS.md). No new codes.
  • Breaking changes described below, or none.

Breaking changes

None. --conditions baseline,graph gives the old run.


Start Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@arrry-hydraDB arrry-hydraDB added feature New capability area: extraction LLM extractor and clients effort: M Several files, both SDKs labels Dec 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: extraction LLM extractor and clients effort: M Several files, both SDKs feature New capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants