Inspiration
As the Web3 ecosystem evolves from human traders to autonomous AI Agent Economies, thousands of micro-agents now execute sub-second transactions on networks like OKX X Layer. However, existing security copilots suffer from a fatal flaw: Single-Snapshot Blindness. A point-in-time check only asks: "Is this wallet safe right now?" It cannot see across time. Wash traders, sybil networks, and malicious service providers exploit this by staying just under detection thresholds across separate sessions—passing every individual snapshot while orchestrating multi-session fraud. We realized that for autonomous AI agents to trade safely without human supervision, security engines cannot be stateless. They need Anamnesis—the persistent decision memory layer that grants AI agents long-term episodic memory and semantic pattern recall.
What it does
Anamnesis bridges the gap between static point-in-time checks and persistent memory:
- Dual-Path Precedent Retrieval: When a counterparty wallet is evaluated, Anamnesis queries CockroachDB Cloud Serverless using dual-path lookup:
- Episodic Recall: Instant exact-address SQL matching for historical repeat counterparties.
- Semantic Recall: $1024$-dimensional
C-SPANNvector cosine similarity search to catch zero-day counterparties exhibiting identical risk profiles.
- Precedent-Grounded LLM Synthesis: Passes retrieved database records to Amazon Bedrock (Claude Sonnet), which explicitly cites historical decision UUIDs in its reasoning and shifts verdicts (e.g. upgrading payment structure from upfront to Escrow).
- Fail-Open Downtime Resilience: If database or LLM services experience network latency, Anamnesis falls back near-instantly to Custos's baseline deterministic engine so agent payment flows never freeze.
How we built it
CockroachDB Cloud Serverless: Serves as our distributed transactional memory bank. Uses native VECTOR(1024) column types and C-SPANN indexing to combine strict ACID transactional consistency with sub-$35\text{ms}$ hybrid vector queries.
- AWS Bedrock:
- Amazon Titan Text Embeddings v2: Generates unit-normalized $1024$-dim behavioral vector embeddings from evaluation metrics.
- Claude Sonnet 4.5: Synthesizes human-readable reasoning text mandated to cite exact precedent UUIDs.
- OKX X Layer Testnet: Fetches real-time on-chain signals (wallet age, transaction volume, price deviation ratio, wash-trading entropy).
- Frontend: Custom white neumorphic dashboard built with Vite, React, and glassmorphism design tokens deployed on Vercel.
Challenges we ran into
- Precedent Citation Hallucination Defense: Large Language Models can occasionally hallucinate citation IDs not present in prompt context. We engineered a post-synthesis validation filter that cross-checks every cited ID against the exact
Setof rows returned by CockroachDB, stripping unverified LLM citations. - Read-Your-Own-Writes Consistency: In high-frequency agent economies, an agent might evaluate the same counterparty twice within seconds. We implemented synchronous database commits so Pass 1's decision vector is committed to CockroachDB before Pass 2 executes.
- Fail-Open Resilience: Security must never freeze payment flows. We implemented a 7-second Promise timeout race that catches infrastructure degradation and falls back to deterministic on-chain signals with honest fallback reasoning.
Accomplishments that we're proud of
- Proving Transactional Vector Intelligence: Demonstrating that CockroachDB's hybrid SQL + C-SPANN vector search solves race conditions that break pure vector databases like Pinecone.
- Sub-35ms Memory Retrieval: Achieving sub-35ms dual-path queries across distributed serverless clusters in AWS
us-east-1. - Bulletproof Production Deployment: Achieving 100% test coverage for fail-open downtime resilience and deploying live to production on Vercel.
What we learned
We learned that pure vector databases are insufficient for Web3 agent security. High-frequency agent micropayments require strict ACID transactional guarantees to prevent race conditions or double-approvals during concurrent evaluation requests. Combining relational metadata filters with C-SPANN vector distance inside CockroachDB proved to be the ultimate architecture for autonomous decision memory.
What's next for Anamnesis
- Decentralized Cross-Agent Memory: Expanding precedent sharing across multi-agent networks on OKX X Layer.
- On-Chain Fraud Proofs: Anchoring CockroachDB decision Merkle proofs to X Layer smart contracts for automated decentralized escrow dispute resolution.
Built With
- ai-agents
- amazon-titan
- aws-bedrock
- claude-sonnet
- cockroachdb
- express.js
- node.js
- okx-x-layer
- react
- typescript
- vector-database
- vercel
- vite
- web3
Log in or sign up for Devpost to join the conversation.