Inspiration

When an autonomous AI agent manages production cloud infrastructure, loss of context isn't an inconvenience—it's a critical outage. Traditional databases were built for human-scale interactions, but autonomous agentic swarms spawn dynamically, write state constantly, and execute complex workflows across distributed regions.

If an agent crashes mid-remediation or suffers a network partition, a typical in-memory or single-region vector store loses context. The agent either halts or, worse, hallucinates destructive commands based on fragmented memory.

We built Chitin.ai to solve this exact problem. Named after nature’s tough, indestructible exoskeleton molecule (chitin), Chitin.ai provides autonomous infrastructure remediation agents with an unbreakable, persistent memory layer powered by CockroachDB and AWS.

What it does

Chitin.ai is an autonomous incident remediation engine that intercepts live cloud infrastructure failures, matches them against historical post-mortems, and safely executes repair workflows with zero loss of state.

Listens & Ingests: Monitored via AWS EventBridge and CloudWatch, system error logs and stack traces are captured in real-time.

Semantic Memory Retrieval: The agent converts incoming error payloads into 1536-dimensional vector embeddings via Amazon Bedrock (Titan Text V2) and queries CockroachDB’s Distributed Vector Index to retrieve the most relevant historical post-mortems using cosine distance (<=>).

ACID Transactional State Management: Before taking action, the agent writes its execution state, decision tree, and intent into CockroachDB transactional tables (active_remediations), ensuring that if the agent process terminates, another node picks up the exact execution step with zero context drift.

Safe Diagnostic & Action Execution: Using the CockroachDB Cloud Managed MCP Server for safe, read-only system inspection and the agent-ready ccloud CLI, Chitin.ai adjusts cluster sizing, provisions nodes, or updates configuration state dynamically on AWS.

How we built it

Chitin.ai is built using a resilient multi-agent architecture across CockroachDB and AWS:

CockroachDB Tooling Integration CockroachDB Distributed Vector Indexing: Stores and indexes 1536-dimensional embeddings directly inside CockroachDB using VECTOR(1536) and CREATE VECTOR INDEX. This eliminates the need for a separate vector database while ensuring strict transactional consistency between operational data and semantic embeddings.

CockroachDB Cloud Managed MCP Server (https://cockroachlabs.cloud/mcp): Connects the reasoning agents natively to CockroachDB clusters to run audit logs and inspect diagnostic metadata safely without custom proxy overhead.

ccloud CLI (Agent-Ready): Embedded directly into the agent executor module to issue JSON-structured control-plane commands (ccloud cluster list, ccloud backup, etc.) with service-account-based RBAC.

Open-Source Agent Skills Repo: Encodes CockroachDB expertise for automated schema tuning, query optimization, and cluster node health verification.

AWS Infrastructure Integration Amazon Bedrock: Powers the core reasoning loop and embedding generation via Amazon Titan Text Embeddings V2 (amazon.titan-embed-text-v2:0).

AWS Lambda & EventBridge: Functions as the event-driven entry point, converting CloudWatch log streams into structured incident triggers.

Amazon S3: Stores raw log dumps and generates verifiable post-mortem PDF audit reports after each automated incident resolution.

Challenges we ran into

Formatting Vector Strings in SQL: Ensuring sub-second similarity search required fine-tuning how vector embeddings were cast into CockroachDB's VECTOR type in Python (psycopg3) while retaining distributed indexing efficiency across scale.

Preventing Race Conditions in Agent Swarms: Multi-agent swarms competing to remediate the same incident can cause race conditions. We resolved this by utilizing CockroachDB’s serializable isolation levels and FOR UPDATE transaction locks in our state tables.

Safe CLI Execution: Teaching the agent executor to safely invoke the ccloud CLI required wrapping terminal outputs in structured JSON validators to guarantee that destructive actions are blocked unless explicit execution confidence metrics are met.

Accomplishments that we're proud of

True Zero-Downtime Agent Memory: Created a system where an agent can be hard-killed mid-execution, and a secondary agent instance will read the transaction log from CockroachDB and resume the exact step within milliseconds.

Unified Data Layer: Successfully consolidated operational transactional data, active agent state, and semantic vector embeddings into a single, globally resilient CockroachDB cluster—eliminating consistency gaps between vector indexes and relational data.

Deep Tool Utilization: Built a project that natively harnesses all four CockroachDB tools alongside multiple AWS serverless services.

What we learned

Agentic Systems Require Relational Guarantees: We learned that unstructured long-term memory (like plain vector stores) is insufficient for production agents. Autonomous agents need ACID transactional guarantees for state tracking combined with vector similarity for semantic search.

The Power of MCP: Integrating the CockroachDB Managed MCP Server showed us how clean and secure client-to-database communication becomes when AI agents can query database telemetry using standard model context protocols.

What's next for Chitin.ai

Multi-Region Active-Active Swarms: Expanding Chitin.ai across multi-region AWS deployments using CockroachDB's geo-partitioning to enable local incident remediation agents with sub-millisecond memory access worldwide.

Self-Expanding Incident Memory: Automatically synthesizing every resolved outage into a new post-mortem embedding, creating a continuously learning, self-healing enterprise infrastructure network.

Community Agent Skills Expansion: Contributing new automated CockroachDB remediation skills back to the open-source CockroachDB Agent Skills Repo.

Built With

Share this project:

Updates

posted an update

** Chitin.ai — Project Log & Progress Update**

Here is a breakdown of how Chitin.ai has evolved from initial architecture design to a fully deployed, fault-tolerant autonomous agent engine.


Development & Feature Timeline

  • Core Agent & Database Setup:
  • Configured the base FastAPI, Next.js, and Streamlit execution environments.
  • Integrated CockroachDB Cloud as the primary distributed database tier for ACID-compliant state storage.

  • Vector Memory Integration:

  • Enabled pgvector alongside AWS Bedrock Titan embeddings to index telemetry logs and match historical outage playbooks via cosine similarity search.

  • Chaos Mode & Fault Tolerance:

  • Built and tested automated checkpointing. Injected mid-pipeline process terminations to confirm state recovery in under 1.2 seconds.

  • Streamlit Cloud Deployment:

  • Successfully deployed the interactive control dashboard to Streamlit Cloud.


Code Snippet: Transactional Checkpoint Model

Here is how Chitin.ai schema defines state persistence with vector support in SQLAlchemy:

from pgvector.sqlalchemy import Vector
from sqlalchemy import Column, Integer, String, JSON, DateTime
from src.database.cockroach import Base
import datetime

class AgentCheckpoint(Base):
    __tablename__ = "agent_checkpoints"

    id = Column(Integer, primary_key=True, index=True)
    session_id = Column(String, nullable=False, index=True)
    execution_step = Column(String, nullable=False)
    state_payload = Column(JSON, nullable=False)
    telemetry_vector = Column(Vector(1536))  # AWS Bedrock Titan Embedding
    created_at = Column(DateTime, default=datetime.datetime.utcnow)


Try the Live App

What features or additional infrastructure integrations would you like to see next? Drop your thoughts in the comments!

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

posted an update

** Chitin.ai — Update #1: Indestructible Agentic Memory Is Live!**

We’re excited to share a major milestone for Chitin.ai, an autonomous infrastructure remediation engine built to ensure AI agents never lose state during production cloud outages!


What's New & Key Highlights

  • ACID-Compliant State Checkpointing: Every action and state transition is transactionally stored in CockroachDB, preventing orphaned tasks and corrupted pipelines.
  • Vector Memory Integration: Powered by pgvector and AWS Bedrock Titan embeddings to execute cosine similarity searches over historical telemetry logs and match verified playbooks.
  • Instant Chaos Recovery: Tested mid-execution process terminations with Chaos Mode—Chitin.ai recovers execution state in under 1.2 seconds.
  • Live Interactive Dashboard: Deployed directly on Streamlit Cloud for real-time cluster node health monitoring, active checkpoints, and knowledge graphs.

Code Snippet: State Checkpoint Engine

Here is a look at how Chitin.ai handles transactional state persistence using SQLAlchemy and PostgreSQL/CockroachDB vector extensions:

from pgvector.sqlalchemy import Vector
from sqlalchemy import Column, Integer, String, JSON, DateTime
from src.database.cockroach import Base
import datetime

class AgentCheckpoint(Base):
    __tablename__ = "agent_checkpoints"

    id = Column(Integer, primary_key=True, index=True)
    session_id = Column(String, nullable=False, index=True)
    execution_step = Column(String, nullable=False)
    state_payload = Column(JSON, nullable=False)
    telemetry_vector = Column(Vector(1536))  # Titan Text Embedding
    created_at = Column(DateTime, default=datetime.datetime.utcnow)


Try the Live App

What features or integrations would you like to see next in Chitin.ai? Drop your feedback and thoughts below!

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