Initializing Architecture
Case Study / Hackathon backend

PaperPlanes

Research assistants built as a vector store plus a chatbot cannot tell a superseded fact from a current one, and lose writes the moment more than one update lands at once.

PaperPlanes project screenshot
Approach

Built a research companion on a CockroachDB memory substrate with bi-temporal fact versioning, so every fact carries both when it was true and when it was recorded. Replaced blind upserts with an explicit ADD, UPDATE, INVALIDATE, or NOOP consolidation write path.

Model / System

LangGraph and FastAPI over CockroachDB used as a real transactional memory substrate: C-SPANN vector indexes, recursive-CTE graph traversal, LangGraph checkpoints, and a managed MCP server letting the agent introspect its own memory over read-only SQL. Amazon Bedrock (Nova Pro and Lite, Titan Embeddings) handles generation and embeddings.

Result

Every claim ships a reproduction command. 25 concurrent writers on one counter: CockroachDB kept 25 of 25 with 58 SERIALIZABLE conflicts caught and auto-retried to success, where a flat-file analog kept 1 and silently lost 24. Retrieval stays index-served at ~10,000 notes, EXPLAIN ANALYZE showing a ~15ms vector search rather than a full scan. After a live database restart mid-conversation, the next turn returns 200 where it previously returned 500.

Technical highlights

What to inspect.

01

Bi-temporal fact versioning with contradiction detection between papers, so a superseded claim is closed with valid_to and stays auditable instead of being overwritten.

02

Mem0-style consolidation write path deciding ADD, UPDATE, INVALIDATE, or NOOP per incoming fact, each branch covered by its own live integration test.

03

Every write path wrapped in a retry that backs off with full jitter on SQLSTATE 40001 only, which is precisely why 25 of 25 writers survive.

04

Tested against a real cluster rather than mocks, including an explicit test asserting the decision model is real Nova and not stubbed.