2026-05-11 00:45:43 -07:00
|
|
|
---
|
|
|
|
|
title: Serving Agents
|
|
|
|
|
description: Expose your context to Claude Code, Cursor, Codex, and other coding agents.
|
|
|
|
|
---
|
|
|
|
|
|
2026-05-13 13:01:56 +02:00
|
|
|
Once you've built and refined your context, expose it to coding agents through
|
|
|
|
|
the public KTX CLI. Claude Code, Cursor, Codex, OpenCode, and custom agent
|
|
|
|
|
workflows can call the same commands you use at a terminal.
|
2026-05-11 00:45:43 -07:00
|
|
|
|
|
|
|
|
## CLI Commands
|
|
|
|
|
|
2026-05-13 13:01:56 +02:00
|
|
|
KTX public commands support JSON output for the context reads that agents use
|
|
|
|
|
most often. Use `--project-dir` when the agent is not already running inside the
|
|
|
|
|
KTX project directory.
|
2026-05-11 00:45:43 -07:00
|
|
|
|
|
|
|
|
### Available commands
|
|
|
|
|
|
|
|
|
|
```bash
|
2026-05-13 13:01:56 +02:00
|
|
|
# Check setup and context readiness
|
|
|
|
|
ktx status --json
|
2026-05-11 00:45:43 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**Semantic layer:**
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# List sources
|
2026-05-13 13:01:56 +02:00
|
|
|
ktx sl list --json
|
|
|
|
|
ktx sl list --json --connection-id my-postgres
|
2026-05-13 15:41:10 +02:00
|
|
|
ktx sl search "revenue" --json
|
2026-05-11 00:45:43 -07:00
|
|
|
|
|
|
|
|
# Run a query from a JSON file
|
2026-05-13 13:01:56 +02:00
|
|
|
ktx sl query --json \
|
2026-05-11 00:45:43 -07:00
|
|
|
--connection-id my-postgres \
|
|
|
|
|
--query-file query.json \
|
|
|
|
|
--execute \
|
|
|
|
|
--max-rows 100
|
|
|
|
|
```
|
|
|
|
|
|
2026-05-13 16:05:58 +02:00
|
|
|
**Wiki:**
|
2026-05-11 00:45:43 -07:00
|
|
|
|
|
|
|
|
```bash
|
2026-05-13 16:05:58 +02:00
|
|
|
# Search wiki pages
|
2026-05-13 13:01:56 +02:00
|
|
|
ktx wiki search "revenue recognition" --json --limit 10
|
2026-05-11 00:45:43 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Setting Up Your Agent
|
|
|
|
|
|
|
|
|
|
The fastest way to connect an agent is through the setup wizard:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
ktx setup
|
|
|
|
|
```
|
|
|
|
|
|
2026-05-12 23:51:46 +02:00
|
|
|
The agents step auto-detects installed tools and generates the right
|
|
|
|
|
configuration. For manual setup or per-tool details, see the
|
|
|
|
|
[Agent Clients](/docs/integrations/agent-clients) integration page.
|
2026-05-11 00:45:43 -07:00
|
|
|
|
2026-05-12 23:51:46 +02:00
|
|
|
After configuration, the agent can immediately call KTX commands to list
|
2026-05-13 16:05:58 +02:00
|
|
|
sources, search wiki pages, and query your semantic layer.
|