Skip to content

Commit b24c95d

Browse files
committed
docs(readme): replace false +0.227 headline with honest third-party benchmarks
- Retract the measurement-artifact +0.227 Graphiti claim (now a documented tie). - Lead with CoNLL04 third-party leaderboard (strict directional+typed scorer): claude-haiku 0.604, glm-5.2 0.589, gemini-flash-lite 0.560, minimax-m3 0.541, deepseek-v4-flash 0.525, deepseek-v3.2 0.514. - State the real moat: parity accuracy at 1 vs 2.55 measured LLM calls/episode, fully local, $0. Update reproduce section (conll04 + cost-efficiency + local).
1 parent 66f7e96 commit b24c95d

1 file changed

Lines changed: 40 additions & 30 deletions

File tree

README.md

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,29 @@ ctxgraph query "why did we move away from Redis?"
1616
1717
---
1818

19-
## Headline result (measured 2026-05-13)
19+
## Benchmarks (measured, third-party + reproducible)
2020

21-
Same LLM, same fixture, same scoring code. ctxgraph's single-call schema-typed prompt vs Graphiti's 6-call pipeline:
21+
> **Correction (2026-06):** an earlier headline here claimed "+0.227 combined F1 over Graphiti." That was a **measurement bug** — an un-scoped Graphiti relation query (`LIMIT 50`, no `group_id`) scored Graphiti against the whole accumulating graph. Fixed. The honest picture: **extraction quality is at parity with Graphiti and with cloud frontier models; the win is architectural — one LLM call, fully local, $0.** Full detail + audit in [docs/BENCHMARKS.md](docs/BENCHMARKS.md).
2222
23-
| Metric (Gemma 4 26B-A4B in both columns) | ctxgraph | Graphiti | Δ |
24-
|---|---|---|---|
25-
| entity F1 (pair-fuzzy) | 0.819 | 0.824 | -0.005 |
26-
| **relation F1 (pair-fuzzy)** | **0.555** | 0.096 | **+0.459 (5.8×)** |
27-
| **combined F1** | **0.687** | 0.460 | **+0.227** |
23+
**Third-party accuracy — CoNLL04** (standard RE dataset neither tool authored), **strict directional + typed** relation scorer, 80 test sentences, single call. Reproduce: `scripts/conll04_bench.py`.
24+
25+
| Model (single call) | entity F1 | relation F1 (directional + typed) |
26+
|---|---|---|
27+
| anthropic/claude-haiku-4.5 | 0.864 | **0.604** |
28+
| z-ai/glm-5.2 | 0.867 | **0.589** |
29+
| google/gemini-2.5-flash-lite | 0.846 | 0.560 |
30+
| minimax/minimax-m3 | 0.840 | 0.541 |
31+
| deepseek/deepseek-v4-flash | 0.844 | 0.525 |
32+
| deepseek/deepseek-v3.2 | 0.861 | 0.514 |
2833

29-
The win **replicates** with Gemma 4 31B (ctxgraph 0.739 vs Graphiti 0.467, +0.272 combined / +0.499 relation). It's architectural, not model-specific. Graphiti's 6-call pipeline tops out at combined F1 ≈ 0.46 regardless of which Gemma you feed it.
34+
**vs Graphiti — same model (gemini-2.5-flash-lite), same fixture, same scorer** (after fixing the bug): combined F1 **0.638 (ctxgraph) vs 0.636 (Graphiti)** — a statistical tie on extraction. The real, measured advantage is efficiency:
3035

31-
Fixture: 29 hand-labeled cross-domain episodes covering 25 domains (`crates/ctxgraph-extract/tests/fixtures/cross_domain_v2.json`). Scoring code: `scripts/openrouter_bench.py` + `scripts/graphiti_openrouter_bench.py`. Raw per-episode outputs: `scripts/results/v0.9_cross_domain_v2/*.json`. Total cost to reproduce: ~$0.15.
36+
| | LLM calls / episode (measured) | local Gemma-4-12B latency |
37+
|---|---|---|
38+
| **ctxgraph** | **1.0** | **~33 s/ep** |
39+
| Graphiti | 2.55 | ~84 s/ep |
3240

33-
[Full benchmark detail → docs/BENCHMARKS.md](docs/BENCHMARKS.md)
41+
**equivalent extraction quality at ~2.6× fewer LLM calls, fully local, $0 marginal cost.** That — not an accuracy edge — is the moat.
3442

3543
---
3644

@@ -199,31 +207,33 @@ crates/
199207
└── ctxgraph-mcp/ MCP server
200208
```
201209

202-
## Reproducing the benchmark
210+
## Reproducing the benchmarks
203211

204212
```bash
205213
export OPENROUTER_API_KEY=sk-or-...
206-
python scripts/openrouter_bench.py \
207-
--model google/gemma-4-26b-a4b-it \
208-
--out bench.json \
209-
--skip-tech \
210-
--cd-fixture crates/ctxgraph-extract/tests/fixtures/cross_domain_v2.json
211-
212-
# Spin up Neo4j for Graphiti
213-
docker run -d --name neo4j-bench -p 7687:7687 \
214-
-e NEO4J_AUTH=neo4j/benchpass123 neo4j:5.26-community
215-
216-
# Graphiti through OpenRouter (needs Python 3.12 venv)
217-
python3.12 -m venv /tmp/graphiti_venv
218-
/tmp/graphiti_venv/bin/pip install graphiti-core neo4j openai
219-
/tmp/graphiti_venv/bin/python scripts/graphiti_openrouter_bench.py \
220-
--model google/gemma-4-26b-a4b-it \
221-
--out graphiti.json
222-
223-
python scripts/compare_v2.py
214+
215+
# 1) Third-party accuracy on CoNLL04 (auto-fetches the dataset; strict directional+typed scorer)
216+
python scripts/conll04_bench.py --model google/gemini-2.5-flash-lite --out conll04.json --limit 80
217+
# …or against a LOCAL model via ollama (no API cost):
218+
python scripts/conll04_bench.py --model 'hf.co/<your>/gemma-gguf:Q4_K_M' \
219+
--base-url http://localhost:11434/v1/chat/completions --out conll04_local.json --limit 40
220+
221+
# 2) Cross-domain model bake-off (ctxgraph single-call prompt)
222+
python scripts/openrouter_bench.py --model deepseek/deepseek-v3.2 --out bench.json \
223+
--skip-tech --cd-fixture crates/ctxgraph-extract/tests/fixtures/cross_domain_v2.json
224+
225+
# 3) ctxgraph-vs-Graphiti, same model, same scorer (needs Neo4j + graphiti venv)
226+
docker run -d --name neo4j-bench -p 7687:7687 -e NEO4J_AUTH=neo4j/benchpass123 neo4j:5.26
227+
python3 -m venv .venv-graphiti && .venv-graphiti/bin/pip install graphiti-core neo4j fastembed
228+
.venv-graphiti/bin/python scripts/graphiti_openrouter_bench.py \
229+
--model google/gemini-2.5-flash-lite --out graphiti.json
230+
231+
# 4) Cost/efficiency: measure Graphiti's ACTUAL LLM calls/episode vs ctxgraph's 1
232+
.venv-graphiti/bin/python scripts/cost_efficiency_bench.py --model google/gemini-2.5-flash-lite
224233
```
225234

226-
Total cost: ~$0.15. Total wall-clock: ~90 minutes.
235+
Each model run costs ~$0.005–0.02 on OpenRouter; the CoNLL04 dataset is fetched
236+
from HuggingFace at run time (no third-party data committed to the repo).
227237

228238
## Contributing
229239

0 commit comments

Comments
 (0)