-
-
Project overview: a multi-agent architecture generator with CockroachDB-backed persistent memory, deployed on AWS.
-
CockroachDB SQL Shell: updated_at changed after a follow-up request — proof the session was resumed, not duplicated.
-
The backend running live on Amazon ECS (Fargate, Express Mode), with a public HTTPS endpoint provisioned automatically.
AI Software Architect is a multi-agent system (LangGraph + FastAPI) that turns a natural-language product description into a full software architecture — requirements, database schema, API spec, UML diagrams, and documentation.
Most AI agent demos lose all context the moment the process restarts. This project treats memory as a first-class part of the architecture: every generation session — its requirements, decisions, and full state — is persisted to CockroachDB, so a user (or another agent) can resume, review, or extend an architecture session at any time, from any instance of the service.
CockroachDB tools used:
- CockroachDB Cloud as the persistent memory store — a JSONB-backed
architect_sessionstable (via SQLAlchemy + sqlalchemy-cockroachdb) stores each session's full state, loaded and updated on every request. - CockroachDB Cloud Managed MCP Server, connected to Claude Code during development for direct schema exploration.
AWS services used: The backend is containerized and deployed on Amazon ECS (Fargate, Express Mode), with the image stored in Amazon ECR and traffic served through an auto-provisioned Application Load Balancer.
Try it: send a POST to /api/generate with a prompt, get back a session_id, then send a follow-up request with that same session_id — CockroachDB reloads the prior state instead of starting over.
How we built it
We started from an existing multi-agent LangGraph system (Supervisor → Requirements → Database → UML/API → Review → Documentation → Assembler) and added a persistence layer on top: a CockroachDB Cloud cluster, connected via SQLAlchemy with the sqlalchemy-cockroachdb dialect. Each session's full state is serialized to JSONB and upserted into a single architect_sessions table, keyed by session_id. We containerized the backend with Docker, pushed it to Amazon ECR, and deployed it on Amazon ECS (Fargate, Express Mode) behind an auto-provisioned Application Load Balancer.
Challenges we ran into
- CockroachDB's version string isn't parsed by SQLAlchemy's default PostgreSQL dialect — switching to the sqlalchemy-cockroachdb dialect fixed it.
- The Application Load Balancer's default 60-second idle timeout was too short for long-running LLM calls mid-stream; we increased it.
- The LLM occasionally returns JSON that doesn't fully match our schema — we added automatic retry logic (up to 3 attempts) around structured output generation.
- A stale ECS deployment left two target groups active on the same load balancer rule, which we resolved by recreating the service cleanly.
Accomplishments that we're proud of
Getting true session resumption working end-to-end in a real cloud deployment — not just a local demo. Querying CockroachDB directly and seeing the exact same row's updated_at change (not a duplicate row) after a follow-up request proves the memory is real and production-grade.
What we learned
Debugging distributed systems requires checking each layer independently — the database, the LLM provider, the container, and the load balancer can each fail in ways that look identical from the outside (a dropped connection) but have completely different root causes.
What's next for AI Software Architect
Adding CockroachDB's distributed vector indexing for semantic search over past architecture sessions, so the agent can retrieve and reuse relevant prior decisions across different projects — not just resume a single session.
Built With
- amazon-ecr
- amazon-ecs
- amazon-web-services
- cockroachdb
- docker
- fastapi
- groq
- langgraph
- nextjs
- python
- sqlalchemy
Log in or sign up for Devpost to join the conversation.