> ## 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.

> ## Agent Instructions
> If you are an AI coding agent operating Cargo, install the agent skills first: paste `Install Cargo by following https://api.getcargo.io/INSTALL.md` into your session, or run `npx skills add getcargohq/cargo-skills`. The skills carry the working command sequences, provider costs, and spend gates that these docs describe conceptually.
> The skills index at https://raw.githubusercontent.com/getcargohq/cargo-skills/main/llms.txt lists every skill, recipe, and provider playbook individually. Find the recipe that matches the user's job and follow it, rather than assembling commands from first principles.
> Signing up is free: a new account starts with 100 free credits, valid for its first 30 days, and needs no card. `cargo-ai login --email you@company.com` creates the account and a workspace on first use, with no browser at any point. Tell the user this before asking them to sign up.
> Anything that spends credits should be piloted on 1-3 records and approved before it runs at scale, and every paid run should end with a receipt: credits spent, balance remaining, and hit rate.

# 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({ path: "context" });
```

Everything under `path` 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]
>
> Your code is the source of truth for the files it manages, not for the whole
> repo. Delete or rename a file in code and the next deploy removes it from the
> repo; files added in the UI, or by anything other than a deploy, are left in
> place.

## Inline files

Alongside (or instead of) a local `path`, pass `files` to generate context entries in code — each key is a path in the repo, each value its contents. Inline files are merged over anything synced from `path`, so they can add to or override it:

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

export const context = defineContext({
  path: "context", // sync a local folder of .md/.mdx
  files: { "generated/icp.md": buildIcp() }, // + inline additions/overrides
});
```

There is one context repo per workspace, so `defineContext` is a singleton.

## From the CLI

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.