About the project
### Inspiration
Most agents begin with an empty context and lose everything when their session ends. I wanted to explore a different kind of agentic system: one where memories survive the agents that created them and influence the generations that follow.
That idea became Verdant Signal, an autonomous science-fiction colony simulation where colonists gather resources, build settlements, form relationships, develop beliefs, survive conflicts, and create their own history.
The player does not control every colonist. Instead, the colony evolves independently while the player observes and influences the larger environment.
### What it does
Verdant Signal turns important experiences into persistent memories.
When colonists develop beliefs, complete their lives, invent technology, fight battles, or participate in civic events, the application compiles those experiences into structured records containing:
- The colonist and settlement
- The memory type and readable description
- Structured event data
- Generation and lineage information
- The original ancestor and source settlement
- A 256-dimensional similarity vector
These records are stored in CockroachDB, which acts as the long-term memory layer for the simulation.
When another colony is founded, CockroachDB’s Distributed Vector Indexing retrieves relevant ancestral memories. Selected beliefs and experiences become part of the identities of the new colonists.
For example, Ilya Reed of Verdant Reach developed the principle:
Repair first, replace only when repair fails.
Ridge Reed, a second-generation colonist in Echo Haven, inherits that belief. The system also preserves its provenance, including the original ancestor, settlement, and source memory.
The result is a continuous loop:
- Colonists act and create experiences.
- Important experiences become structured memories.
- CockroachDB stores the memories and their vectors.
- Relevant ancestral knowledge is retrieved.
- New colonists inherit beliefs with traceable provenance.
- Their experiences create the next layer of history.
### How I built it
The simulation is built with vanilla JavaScript, Canvas 2D, and a WebGL post-processing layer. It runs deterministically in the browser, so the same seed produces the same starting colony.
The simulation loop does not depend on network requests. CockroachDB operates as a persistent memory channel around that deterministic core.
A Node.js API compiles colonist lives and historical events before writing them to CockroachDB. Each record contains readable content, structured JSON data, revision information, lineage provenance, and an optional VECTOR(256) embedding.
The default embedding provider is a free, dependency-free local feature-hashing implementation. This gives the project practical similarity retrieval without requiring a paid embedding API.
CockroachDB stores the structured record and its vector together. Its Distributed Vector Index performs nearest-neighbour retrieval using the <-> distance operator.
I also integrated the CockroachDB Cloud Managed MCP Server. It provides an authorized AI development agent with secure, audited access to inspect the live schema, query memory health, and verify the vector index without maintaining a custom database proxy.
A visual memory portal renders the stored settlements, colonists, beliefs, inventions, relationships, and battles as a connected historical graph.
### Challenges I faced
The largest challenge was making memory genuinely important without making the simulation unreliable.
The simulation had to remain deterministic even when the database or an external service was unavailable. I solved this by keeping the live decision loop local while retrieving ancestral memories during colony creation and writing completed experiences back asynchronously.
Another challenge was preventing older writes from overwriting newer memories. The persistence layer uses revisions and conditional updates so stale memory content or embeddings cannot replace a more recent record.
Inheritance also needed provenance. Copying a belief alone was not enough—the application needed to preserve who created it, which settlement it came from, and how it reached the new colonist.
Finally, I wanted embeddings that could be demonstrated without usage fees. The local 256- dimensional feature-hashing implementation provides a free baseline while keeping the embedding provider replaceable if stronger semantic retrieval is needed later.
### What I learned
I learned that useful agent memory requires more than saving conversation history.
Production memory needs structure, provenance, transactional consistency, retrieval, revision protection, and a clear point where recalled knowledge can affect future behavior.
CockroachDB made it possible to keep operational memory, structured lineage data, and vectors in the same database. This removed the synchronization problems that would come from maintaining a separate vector store.
Most importantly, Verdant Signal showed me that memory becomes much more interesting when it does not only help one agent it becomes shared history for an entire population.
Log in or sign up for Devpost to join the conversation.