Inspiration

Cancer evolution is not a single prediction—it is a sequence of observations, competing hypotheses, treatment pressures and branching possibilities. Yet many AI systems forget earlier evidence, repeat completed work and cannot explain how one agent’s finding influenced another agent’s decision.

We created OncoTwinDB to explore a different model: an agentic cancer-evolution digital twin whose memory persists across missions, agents and application restarts. The goal is to help cancer researchers explore synthetic longitudinal evidence while preserving uncertainty, provenance and human oversight. This is a research demonstration, not a diagnostic or treatment system.

What it does

OncoTwinDB reconstructs and visualizes how cancer clones may evolve across time. Its Bioinformatics Agent identifies resistance signals, the Evolution Agent generates memory-conditioned future paths, and the ML Guardian challenges confidence and weak evidence. These agents exchange structured handoffs, vote on competing paths and stop at a human approval gate before any consequential hypothesis advances. CockroachDB stores the complete agent memory: • Patient and clinical-event context • Agent runs, checkpoints and idempotency keys • Semantic memories and embeddings • Agent-to-agent handoffs • Human approvals • Observed evolution frames • Projected paths, votes and divergences • Tamper-evident operational receipts Users can replay previous cancer states, inspect a 3D genome helix, compare possible evolutionary branches and search prior agent memory using natural-language questions.

How we built it

The application uses FastAPI for its backend and JavaScript, CSS and Three.js for its interactive interface. CockroachDB Cloud is the persistent coordination and memory layer. Its Distributed Vector Index performs semantic retrieval directly beside transactional patient, workflow and evolution data—eliminating the need for a separate vector database. AWS Lambda runs the open-source BAAI/bge-small-en-v1.5 FastEmbed model. Lambda generates embeddings for stored memories and user queries, which are then searched through CockroachDB’s vector index. The public application runs in Docker on AWS Lightsail behind Caddy HTTPS. Amazon ECR stores the Lambda container image, while CloudWatch provides invocation logs. Our read-only Operations Agent uses: • The official CockroachDB MCP Server for typed cluster inspection • The ccloud CLI to verify cloud inventory • The official reviewing-cluster-health Agent Skill as its diagnostic workflow • SHA-256 receipts persisted in CockroachDB as evidence of every verification run

Challenges we ran into

Secure database connectivity behaved differently across macOS, AWS Lambda and the Linux container. We had to solve TLS certificate verification correctly without disabling security. The open-source embedding model produces 384-dimensional vectors, while our existing memory schema used a 1024-dimensional vector contract. We implemented deterministic dimension adaptation and validation while preserving a single distributed-index design. The CockroachDB Cloud MCP connection initially returned authorization errors for several tools. We switched to the official MCP Server using a local stdio transport, exposed only read tools and verified that no write tools were available or invoked. We also worked through Lambda authentication, container memory limitations on a small Lightsail instance, schema migrations, restart recovery and secure transfer of runtime configuration without committing secrets.

Accomplishments that we're proud of

Our strongest accomplishment is that memory is genuinely operational—not decorative. An agent can store a resistance finding, restart the application, retrieve that memory semantically and use it to generate new evolutionary paths. The demonstrated query, “What treatment resistance mechanism is emerging?”, retrieves the persisted MET-mediated resistance memory through AWS Lambda and CockroachDB Distributed Vector Indexing. We also created an independently verifiable production-proof workflow. The Operations Agent successfully runs MCP inspections, confirms the CockroachDB Cloud cluster through ccloud, follows an official Agent Skill and persists a tamper-evident receipt. It fails safely if any evidence source is unavailable. Finally, all hypotheses remain evidence-linked, uncertainty-aware and protected by a human approval gate.

What we learned

We learned that production agentic systems need more than conversation history. They require durable checkpoints, idempotency, structured handoffs, semantic recall, transactional consistency, governance and audit evidence. Keeping vectors and operational data inside CockroachDB makes memory easier to reason about: the agent’s semantic context remains consistent with the patient, workflow and approval records that produced it. We also learned that agent safety becomes stronger when infrastructure can prove its own state. MCP, ccloud, Agent Skills and persisted receipts allow the system to show what was inspected rather than merely claiming that it is healthy. Most importantly, agents become more useful when each one inherits the evidence, uncertainty and unfinished work of the agents that came before it.

What's next for OncoTwinDBNext, we plan to add more cancer types, richer longitudinal mutation histories and additional evidence modalities such as de-identified genomic, spatial and treatment-response datasets.

We will expand the evolution engine with calibrated uncertainty, counterfactual branch comparison and cohort-level retrieval while maintaining a clear distinction between observed evidence and projected possibilities. For production readiness, we plan to add stronger multi-tenant authorization, automated backups, deeper observability, disaster-recovery testing and privacy-preserving data ingestion. Our longer-term vision is a collaborative research memory network in which every validated observation improves future agent reasoning—without losing provenance, human control or the ability to explain why a particular evolutionary path was proposed.

Built With

Share this project:

Updates