Inspiration

Trading agents become unsafe when they react to a price signal without remembering why similar decisions succeeded or failed. OlinckBotAI was built to make every recommendation accountable: the agent retrieves governed context, similar historical decisions, and hard risk limits before recommending an action.

What it does

OlinckBotAI is a paper-first algorithmic trading platform with a FastAPI backend and React dashboard. Before producing a recommendation, the Trading Context Agent:

  • retrieves governed market and strategy context;
  • searches CockroachDB for semantically similar past decisions;
  • checks previous strategy outcomes and risk alerts;
  • returns a paper-only recommendation with cited memory IDs and reasoning;
  • stores the new decision, context, risk level, timestamp, and later outcome;
  • exports an auditable JSON report to Amazon S3.

Real trading remains disabled by default.

How we built it

The agent memory is stored in the CockroachDB Cloud cluster olinck-agent-memory. Each memory contains the asset, market context, indicators, strategy, risk level, final decision, reasoning, timestamp, outcome, and embedding.

We use two required CockroachDB capabilities:

  1. Distributed Vector Indexing: a VECTOR(16) embedding column and vector index support semantic recall. Before each recommendation, the service orders memories by vector distance and returns the closest historical decisions.
  2. ccloud CLI: the repository includes an agent-ready setup workflow that verifies authentication, creates the memory database, applies the schema, and prepares the live cluster.

The application also includes the CockroachDB Managed MCP configuration path for read-only agent inspection.

For AWS, OlinckBotAI uses a real encrypted private Amazon S3 bucket. The AWSReportStore writes agent-context reports under date-partitioned object paths. The CloudFormation deployment and live smoke test produced a real aws-smoke-test.json object in the S3 bucket. An ECS Fargate task definition is included for the containerized FastAPI service.

DataHub provides governed metadata context, while CockroachDB provides persistent agent memory and AWS S3 preserves durable decision artifacts.

Agentic memory flow

  1. Market data, indicators, backtests, and risk limits form the current context.
  2. The agent queries CockroachDB vector memory for similar decisions.
  3. Retrieved memories and outcomes are cited in the recommendation.
  4. Hard risk controls can force the decision to wait or refuse.
  5. The new memory is saved to CockroachDB.
  6. An audit report is exported to Amazon S3.
  7. The React dashboard displays the recalled memories, reasoning, recommendation, and save confirmation.

Challenges

The main challenge was making memory useful without allowing it to bypass safety. Memory can improve context, but position limits, loss guards, stop rules, and paper-only mode remain outside the agent's control. A second challenge was keeping cloud credentials completely outside the browser, repository, logs, and documentation.

Accomplishments

  • Deployed the olinck-agent-memory CockroachDB Cloud cluster.
  • Created persistent decision memory with vector embeddings and semantic search.
  • Integrated memory retrieval before every recommendation and memory writing afterward.
  • Deployed an encrypted private S3 report bucket through CloudFormation.
  • Smoke-tested a real agent-context report artifact in AWS S3.
  • Added an Agentic Memory interface with cited history and explainable reasoning.
  • Preserved real-trading-disabled safeguards.
  • Passed targeted memory, DataHub, and AWS report tests.

What we learned

Agentic memory is most valuable when it combines semantic recall with structured transactional facts. The vector identifies similar situations, while the stored outcome, risk level, and reasoning make the recalled memory auditable. CockroachDB keeps both forms of memory consistent in one system of record.

What's next

We will attach paper-trade outcomes automatically when positions close, expand production embeddings, deploy the FastAPI container on ECS Fargate, and add regional resilience and richer memory evaluation metrics.

Built With

  • cockroachdb
Share this project:

Updates