Inspiration
Agent memory is powerful - and dangerous. In incident response, operators paste unverified chatter into the chat (“flush the cache now”), and naive systems will promote that noise into long-term memory. Once poisoned, every future session recalls the wrong runbook.
We wanted a different contract: CockroachDB as the durable memory layer, with a hard gate between “what the agent heard” and “what the organization will trust forever.” That led to PDX-CRDB Agent Memory - dual-layer memory where transcripts stay append-only, and only PDX-verified + human-approved lessons become recallable canon.
What it does
PDX-CRDB Agent Memory is an approval-gated agent memory stack for incident-response workflows:
- Interaction layer: noisy chat turns append freely (they never auto-become long-term memory).
- Proposal layer: Amazon Bedrock (Nova) proposes a durable runbook lesson as
pdx_memory_proposal_v1, after reading approved memory via CockroachDB Managed MCP (select_queryonmemory_item).- Verification + Approve: the host runs PDX Artifact Engine verification (
allow_mock=False), then a human Approve promotesproposed → writtenin a single CockroachDB transaction.- Semantic recall: Amazon Titan Text Embeddings V2 (
VECTOR(1024)) embeds the query; CockroachDB Distributed Vector Indexing ranks withembedding <=> query_vec. Poison phrases do not appear.
It ships as:
- an embeddable Python library (
AgentMemory) for third-party hosts, and - a live Lambda container demo (public Function URL) for judges.
How we built it
- CockroachDB Cloud as the persistent memory layer: sessions, candidates, write requests, approval events, and
memory_item+ distributed vector index. - Managed MCP (required tool #1): host-enforced read allowlist for the Bedrock agent -
select_querysucceeds onmemory_item; no agent INSERT/DDL. - Distributed Vector Indexing (required tool #2): Titan v2 1024-d embeddings stored in CRDB; next-session recall via SQL vector distance (not a side vector DB).
- Amazon Bedrock: Nova Converse for the IR loop; Titan v2 for embeddings.
- AWS Lambda (container image, Function URL in
us-east-1) as the public demo host (Engine + app in-image). - PDX Artifact Engine (peer, not a fork): plan → verify → run/artifact manifests bound to the lesson payload digest.
- Evidence-first path: local
submission_demo.py+ sanitizeddocs/evidence/; public URL Approve verified live (ir=live, MCP success, PDXwritten, VECTOR recall).
Challenges we ran into
- Managed MCP ~16KB query limit: full 1024-d VECTOR literals cannot ride inside MCP
select_querytext. We split paths: short MCP reads for the agent; parameterized SQL for Titan vectors. - Honest evidence vs lucky PASS: early runs could “pass” even when MCP queried a non-existent table. We fail-closed: no successful allowlisted
select_query⇒ no submission PASS; request-scoped 0→1memory_itemchecks replace fragile global counts. - Live Bedrock propose quality:
ir=liveonce proposed poison after a bad table name; we require MCP success + a safe quorum lesson before Approve, and reject unsafe proposals. - Lambda packaging for real PDX: zip was too thin; we moved to a container image, fixed OCI attestation rejection, and run as Image package type.
- Demo slides vs Rules: UI screenshots alone under-sold “CRDB memory layer at work”; we added explicit framework/flow/CRDB slides naming MCP + VECTOR + the promotion transaction.
Accomplishments that we're proud of
- A clear dual-layer story judges can follow in under three minutes: poison chatter → MCP propose → PDX Approve → CRDB
written→ next-session VECTOR recall. - Live Function URL path with
ir=live: Managed MCPselect_querysuccess, PDX verify, CRDB promotion, Titan 1024 recall - poison not recalled. - Local Full E2E publishable evidence bundle (
docs/evidence/) with digest-verifiable manifests and no local secrets/paths. - An embeddable façade (
AgentMemory) so this is a library other hosts can adopt, not only a one-off demo URL. - Rules-aligned tool story: ≥2 CockroachDB tools (MCP + Vector) and ≥1 AWS (Bedrock + Lambda), meaningfully integrated - not initialized-only.
What we learned
- Agentic memory needs identity separation: agent/MCP reads ≠ ingest writer ≠ approval writer.
- “The model called a tool” is not enough - demos need tool success gates and digest-bound promotion evidence.
- Vector memory on CockroachDB works best when embeddings stay on the SQL path; MCP is excellent for short, allowlisted reads.
- Treat demos as evidence products: say out loud that Titan embeds and CockroachDB stores and ranks.
What's next for PDX-CRDB Agent Memory
- Stronger Cloud SQL GRANTs, retention/expiry, and production-shaped credential split.
- Broader host adapters beyond the reference Lambda container while keeping the same approve-gated CRDB transaction core.
- Optional richer IR UX on the public demo while keeping the same fail-closed memory contract.##
Log in or sign up for Devpost to join the conversation.