## Inspiration
AI agents are moving from research labs to production systems. They're analyzing code, managing infrastructure, and making decisions autonomously. But they have a critical flaw: when they crash, they lose everything.
We've all experienced the frustration of a long-running process failing halfway through. For AI agents performing complex, multi-step tasks, this isn't just annoying - it's a fundamental reliability problem that prevents real-world deployment.
We built AgentOS to solve this.
## What it does
AgentOS is an operating system for AI agents with built-in crash recovery. Every agent gets:
Persistent Memory - Four memory types stored in CockroachDB:
- State memory for current task checkpoints
- Episodic memory for conversation history
- Vector memory for semantic search over experiences
- Shared memory for multi-agent communication
Automatic Checkpointing - Agents save progress after each significant step. When they crash and restart, they resume exactly where they left off.
Production Infrastructure - Built on CockroachDB for distributed persistence, AWS Bedrock for AI reasoning, S3 for artifact storage, and CloudWatch for observability.
The demo shows an interactive agent analyzing a codebase. Mid-analysis, we crash it with Ctrl+C. When restarted, it recovers its checkpoint from CockroachDB and continues without losing any work.
## How we built it
Core Runtime - Python-based agent runtime with lifecycle management (start, pause, resume, stop). Each agent runs with error handling and automatic recovery.
Memory Layer - PostgreSQL-compatible interface to CockroachDB using psycopg2. We implemented four memory types:
- Key-value state storage with JSON serialization
- Episodic memory with timestamps and agent interactions
- Vector embeddings for semantic search
- Shared memory tables for agent coordination
AWS Integration -
- Bedrock for language model inference (Amazon Nova Pro)
- S3 for storing code artifacts and analysis results
- CloudWatch for metrics and centralized logging
Chat Agent - Interactive demo agent that accepts natural language commands, analyzes codebases, and persists all state to CockroachDB. It demonstrates crash recovery in real-time.
## Challenges we ran against
Checkpoint Granularity - Too frequent checkpointing slows execution. Too infrequent loses too much work. We checkpoint after each logical unit (file analyzed, task completed) rather than on a fixed schedule.
Connection Resilience - CockroachDB connections can drop during long operations. We implemented connection pooling and automatic retry logic with exponential backoff.
Serialization - Agent state includes complex Python objects. We built a JSON serialization layer that handles dataclasses, timestamps, and nested structures while remaining PostgreSQL-compatible.
AWS Permissions - Bedrock models require explicit permission grants per region. We implemented graceful fallback when models aren't accessible, allowing the system to work with reduced functionality.
Natural Language Commands - The chat agent needs to distinguish between similar commands like "check my memory" versus "check this code". We use keyword priority ordering to route commands correctly.
## Accomplishments that we're proud of
We built a complete operating system for AI agents in under a week. The crash recovery actually works - agents genuinely resume from checkpoints without losing state.
CockroachDB's distributed architecture means our agents can survive not just process crashes, but node failures and network partitions. The memory layer is production-ready.
The demo is clean and works reliably. No mock data or simulated crashes - it's a real agent doing real work with real recovery.
## What we learned
Distributed systems are hard - Even with CockroachDB handling replication and consistency, building reliable stateful applications requires careful thought about failure modes.
Checkpointing is not backup - Checkpoints are recovery points within a task. We learned to design them as resumption points, not just state snapshots.
PostgreSQL compatibility matters - CockroachDB's PostgreSQL wire protocol compatibility meant we could use standard Python libraries and patterns. This accelerated development significantly.
Agent infrastructure is infrastructure - AI agents need the same reliability primitives as any distributed system: persistent state, crash recovery, observability, and coordination mechanisms.
## What's next for AgentOS
Multi-agent workflows - Add DAG-based orchestration where agents hand off work to each other, all coordinated through shared memory in CockroachDB.
Distributed execution - Deploy agents across multiple nodes with CockroachDB handling state synchronization.
Time-travel debugging - Use CockroachDB's historical queries to replay agent execution and debug failures.
Agent marketplace - Build a registry where agents can discover and invoke each other's capabilities.
CLI and daemon - Complete the command-line interface and background daemon service for production deployment.
The foundation is solid. AgentOS provides the infrastructure that production AI agents need: memory that never goes down, automatic recovery, and coordination primitives. We're ready to scale it.
Built With
- amazon-web-services
- cockroachdb
- distributed
- linux
- python

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