Inspiration
Current agentic memory systems (like RAG, window compressors, or conversational buffers) are designed to remember only what the agent saw. But in critical production software systems, what the agent could NOT see is just as important.
If an agent attempts to diagnose a system outage but was blind to network metrics during that specific timeframe, it will confidently assign false causality (hallucination) because it lacks a structured record of its own blind spots. I built SCOPE (Semantic Conditions Of Persistent Experience) to solve this. SCOPE doesn't just remember agent observations, it structurally records, indexes, and queries the agent's observation gaps so the agent knows when it is operating blind.
What it does
SCOPE is a persistent "observation coverage and blind spot" memory layer that protects agents from hallucinating cause-and-effect relationships:
- Telemetry & Blackout Tracking: It continuously tracks the coverage intervals of metrics. If a metric source goes offline, a serverless AWS Lambda function detects the heartbeat failure and writes a structural
observation_gapdirectly to CockroachDB Cloud. - Causal Audit (Bedrock): When an agent evaluates an incident, it queries CockroachDB via the Managed MCP Server to verify if it has coverage during that timeframe. If a gap overlaps the incident, the Amazon Bedrock reasoning engine lowers its confidence and flags causality as
UNSUPPORTED. - Semantic Similarity Search: When a new incident occurs, the agent generates text embeddings and uses pgvector HNSW Cosine Similarity (
<=>) on CockroachDB to locate historically similar blind spots, warning the operator of recurring observability failures. - Transactional Resolution: Once offline logs are recovered, SCOPE uses a single database transaction to ingest the missing metrics, update the gap status to
FULLY_RESOLVED, and elevate the agent's causal confidence (e.g. from 41% to 89%), guaranteeing data consistency across the memory layer.
How I built it
- Database Layer: CockroachDB Cloud Serverless on AWS. I utilized the
pgvectorextension and built an HNSW Approximate Nearest Neighbor index onvector(1536)columns. - Agent Interfacing: The agent interacts with the database strictly through the official CockroachDB Managed MCP Server endpoint over SSE (Server-Sent Events) to invoke queries, record observations, and update inferences.
- Reasoning & Embedding: Powered by Amazon Bedrock (using
amazon.titan-text-express-v1for reasoning andamazon.titan-embed-text-v1for generating 1536-dimensional semantic vectors) using the unifiedconverseAPI. - Orchestrator: AWS Lambda monitors heartbeats and records system outages.
- Frontend Dashboard: A premium Vanilla CSS glassmorphic dashboard featuring an interactive HTML5 Canvas timeline that maps metric streams, outages, and blind spot envelopes in real-time, backed by a FastAPI Python server.
Challenges I ran into
- SSL Certificate Verification in Serverless: In Vercel's serverless environment, accessing the trusted root store for verifying CockroachDB's SSL certificate required adjusting connection flags. I solved this by configuring
sslmode=requirein my cloud connection string, ensuring transport encryption while bypassing Vercel filesystem constraints. - pgvector Operand Casting: Psycopg2 automatically formats python lists as PostgreSQL
decimal[]. I solved this by adding explicit parameter casting(embedding <=> %s::vector)to execute fast HNSW cosine searches. - Handling AWS Bedrock Sandbox Restrictions: To accommodate account-specific sandbox limits on Anthropic models, I implemented a dual-mode engine: the agent dynamically uses Amazon Titan models or falls back to local rule-based parsing if needed, guaranteeing the application never crashes during live evaluations.
Accomplishments that I'm proud of
- I designed and built a working agentic memory system that represents the absence of information (gaps) as a first-class database model.
- I achieved a fully cloud-native, end-to-end pipeline linking Vercel, AWS Lambda, Amazon Bedrock, and a live CockroachDB Cloud database.
- The interactive timeline canvas visually demonstrates the exact moments the agent went blind and how recovering that telemetry shifts agent confidence.
What I learned
- CockroachDB Cloud's pgvector makes semantic spatial search incredibly easy to write and exceptionally fast to query.
- Building agents with epistemic boundaries (knowing what they don't know) is a crucial step toward building reliable, safe AI operators in production environments.
What's next for SCOPE
I plan to package SCOPE as a drop-in middleware library for popular agent frameworks (like LangChain, LlamaIndex, and AutoGen), allowing developers to add a persistent, self-auditing observation envelope to any production AI agent.
Built With
- agentic-memory
- amazon-bedrock
- amazon-web-services
- artificial-intelligence
- aws-lambda
- cockroachdb
- cockroachdb-cloud
- css3
- fastapi
- hnsw
- html5
- javascript
- llms
- mcp
- model-context-protocol
- pgvector
- python
- rest-api
- semantic-search
- serverless
- sse
- vector-database

Log in or sign up for Devpost to join the conversation.