Architecture & Integrations
Sentinel Memory is an incident-response command center whose memory is a database, not a context window. CockroachDB holds live incident state, the immutable event log and the vector-searchable record of what past actions actually caused; Amazon Bedrock reasons over what CockroachDB returns.
Request path
Responder / incident commander
Reports observations, proposes actions, approves or rejects recommendations.
Next.js Incident Command Center
App Router. Server components read the store directly; client components handle mutations. No secret ever reaches the browser.
Server-side agent orchestrator
embed → retrieve → ground → validate → persist. The single place the memory loop lives (src/lib/agent/orchestrator.ts).
Amazon Bedrock
Converse API with the model named by BEDROCK_MODEL_ID. Returns strict JSON validated by Zod before a responder ever sees it.
us-east-1 · amazon.nova-lite-v1:0
CockroachDB Cloud
Incident state, immutable memory events, vector embeddings, recommendations, approvals, contradictions, handoffs and the audit trail — one database, one transaction boundary.
sentinel-memory-32275.j77.aws-us-east-1.cockroachlabs.cloud:26257 · vector index present
CockroachDB Cloud Managed MCP Server
A separate, operator-facing path at https://cockroachlabs.cloud/mcp. Used during development to inspect schema and validate cluster state from the editor. It is not in the application's request path.
read-only / audit-friendly inspection · see docs/MCP.md
Episodic memory
What happened during a specific incident
Every observation, retrieval, recommendation, human decision, state change and handoff is appended to memory_events with its actor, timestamp and metadata. Rows are never updated or deleted.
This is what makes the timeline reconstructable: any agent, at any time, can rebuild the incident's history by reading the log — no session transcript required.
Tables: incidents, memory_events, action_decisions, audit_events
Semantic memory
Lessons, patterns, procedures and consequences
Historical incidents are distilled into rows in memory_embeddings, each carrying the action taken, the outcome it produced and the lesson recorded — plus a VECTOR(1024) embedding.
A new observation is embedded and matched by cosine distance, so “smoke near Machine 7” retrieves a 2025 pressure-transfer incident that shares no keywords with the query.
This is why Sentinel remembers consequences, not conversations.
Why CockroachDB is the right home for agent memory
Structured state and vector memory live together
No separate vector database to sync. A single query joins memory_embeddings to incidents, so a retrieved vector immediately carries its incident code, severity and date.
Transactional action approval
The approval record, the recommendation status, the incident state and the audit event commit as one unit. A recommendation cannot read as approved without its audit trail.
Durable incident history
Agents restart, responders change shift, processes get redeployed. The incident record does not live in a context window, so none of that loses it.
PostgreSQL-compatible access
Standard pg driver, parameterized SQL, familiar tooling. Nothing bespoke to learn or maintain.
Serializable isolation with retries
Concurrent responders deciding on the same incident contend safely: withTransaction retries SQLSTATE 40001 with exponential backoff instead of corrupting state.
Distributed and production-oriented
Survivability and horizontal scale are properties of the database, not something the application layer has to reinvent for a safety-critical workload.
Safety model
Sentinel has no machinery control path. It cannot start, stop, isolate or energize anything. Approving a recommendation records a human authorization; a person performs the action.
A post-model safety floor forces requiresHumanApproval on any high-risk physical action regardless of what the model returned, and filters out memory citations that were not actually retrieved.
Structured output is validated with Zod. A malformed or unsafe response is rejected — no recommendation is recorded — rather than shown to a responder.
Live configuration
- Store
- CockroachDB
- Reasoning
- Amazon Bedrock
- Embeddings
- Amazon Bedrock
- Vector width
- 1024d
Read live from /api/health, which returns configuration booleans and non-secret identifiers only.
Continuity
When the primary agent disconnects, nothing about the incident is lost, because nothing about the incident was ever stored in the agent. The backup reconstructs its briefing by querying memory_events, action_decisions and memory_embeddings, then asks Bedrock to compress that into what happened, what was attempted, what must not be repeated, what is still risky and what to do next. The briefing itself is stored in incident_handoffs, so it too survives.