> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getcargo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Context

> Sync your GTM knowledge base — markdown/MDX files — into the workspace context repository with defineContext.

**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

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

export const context = defineContext({ dir: "context" });
```

Everything under `dir` is synced on deploy:

```text theme={null}
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.

<Note>
  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.
</Note>

## From the CLI

```bash theme={null}
cargo-ai context repository get
cargo-ai context graph get        # the knowledge graph derived from context
```
