Skip to main content
Context is your workspace’s GTM knowledge base: an ICP definition, personas, positioning, playbooks — the qualitative knowledge that grounds agents and workflows. defineContext syncs a local folder of markdown/MDX into the workspace’s context repository as code.

Define context

context/context.ts
import { defineContext } from "@cargo-ai/cdk";

export const context = defineContext({ dir: "context" });
Everything under dir is synced on deploy:
context/
├── context.ts
├── icp.md
└── personas/
    └── head-of-growth.md
Add a .md/.mdx file and it’s picked up automatically; edit one and it re-syncs.
The sync is additive — files added in the UI are left in place. Your code is the source of truth for the files it manages, not for the whole repo.

From the CLI

cargo-ai context repository get
cargo-ai context graph get        # the knowledge graph derived from context