feat: Add InMemoryTraceStore, live benchmark, and interactive agent#2
Merged
Conversation
Major changes: - InMemoryTraceStore: drop-in replacement for TraceStore that uses numpy cosine similarity instead of PostgreSQL+pgvector. Enables running the full benchmark and agent with zero infrastructure. - run_live_benchmark.py: sends all 30 tasks through the real LLM across 3 strategies, producing actual TSA/PV/PCR/ESA numbers with bootstrap CIs. Only needs a GOOGLE_API_KEY, no PostgreSQL. - validate_pipeline.py: 30-check validation script that tests the entire pipeline end-to-end with mock services, zero external deps required. - Interactive agent mode (python -m agent.app --interactive) with /compare and /memory commands. - Made all components store-agnostic: PlanEngine, Deduplicator, Gatekeeper, BenchmarkRunner, and graph nodes now accept both TraceStore and InMemoryTraceStore via duck typing. - Updated README with honest documentation: clearly marks paper numbers as paper-sourced, documents how to reproduce them, and adds quick-start guide. - 104 tests passing, 30/30 pipeline validation checks passing. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR makes the behavioral-memory framework actually runnable end-to-end without PostgreSQL:
TraceStorethat uses numpy cosine similarity. No PostgreSQL needed.examples/run_live_benchmark.py) — runs the real 30-task benchmark through 3 strategies with a real LLM. Only needsGOOGLE_API_KEY. Produces actual TSA/PV/PCR/ESA numbers with bootstrap CIs and McNemar's test.examples/validate_pipeline.py) — 30-check end-to-end validation with zero external deps.python -m agent.app --interactive) — REPL with/compare(with vs without memory) and/memorycommands.What changed
in_memory_store.py,run_live_benchmark.py,validate_pipeline.py,test_in_memory_store.pyengine.py,dedup.py,pipeline.py,token_budget.py,graph.py,retrieve.py— all now store-agnosticapp.pyrewritten with interactive mode,/compare,/memoryTest plan
pytest tests/ -v)python examples/validate_pipeline.py)Made with Cursor