docs / agent-sdk

Kortex Agent SDK

Give any AI agent instant access to your codebase memory before it writes a single line.

Overview

The Kortex Agent SDK is built into the CLI. Three commands give any AI agent — Claude Code, Cursor, or any shell-based tool — instant access to your team's codebase memory before it writes a single line of code.

All commands output JSON by default. Add --prompt for formatted, prompt-ready text you can inject directly into an agent context.

Make sure kodingo init has been run in the project directory first. The SDK reads credentials from ~/.kodingo/config.json automatically.

Commands

`kodingo context`

Returns all affirmed memories relevant to a specific file. Call this before an agent touches a file.

bashcopy
kodingo context --file auth/middleware.ts --prompt

Options:

FlagDescriptionDefault
--fileFile path to get context for (required)—
--promptOutput as prompt-ready string instead of JSONfalse
--limitMax memories to return20

`kodingo session-brief`

Returns a compact summary of the most important decisions across the entire project, sorted by confidence. Call this once at the start of a new agent coding session.

bashcopy
kodingo session-brief --prompt

Options:

FlagDescriptionDefault
--promptOutput as prompt-ready string instead of JSONfalse
--limitMax memories to include30

`kodingo guardrails`

Returns the project's hard rules — denied memories and high-confidence decisions. Call this at session start so your agent understands what patterns to avoid and which constraints to respect.

bashcopy
kodingo guardrails --prompt

Options:

FlagDescriptionDefault
--promptOutput as prompt-ready string instead of JSONfalse

Usage with Claude Code

Add to your Claude Code session startup:

bashcopy
kodingo session-brief --prompt
kodingo guardrails --prompt

Before editing a specific file:

bashcopy
kodingo context --file path/to/file.ts --prompt

Usage with Cursor

In your Cursor rules or agent instructions, call the commands via terminal before starting work:

bashcopy
kodingo context --file src/api/routes.ts --prompt > /tmp/kortex-context.txt

Then reference the output in your prompt.

Example output

jsoncopy
{
  "file": "auth/middleware.ts",
  "repo": "my-project",
  "count": 3,
  "memories": [
    {
      "title": "JWT validation approach",
      "content": "We use RS256 not HS256 — the private key is never exposed to the API layer.",
      "status": "affirmed",
      "confidence": 0.92
    }
  ]
}