---
title: "Version-matched docs for agents"
description: "Resolve the installed Systhema version and retrieve only the documentation needed for the task."
requested_language: sk
language: en
translation_notice: "This page isn't translated yet"
url: https://docs.systhema.app/sk/next/ai-agents/docs-for-agents
version: unreleased (main)
docs_index: https://docs.systhema.app/sk/next/llms.txt
---
> This page isn't translated yet. Showing English.


Read the project's installed Systhema version before asking an API question. Pass it unchanged to the docs service. Use project files for token values and documentation for API behavior.

## Read the installed version

Run in the app that depends on core:

```bash
node -p "require('./node_modules/@systhemaui/core/package.json').version"
```

If dependencies are not installed, read the `@systhemaui/core` range in that app's `package.json` and use the range as a fallback. State that it is a range rather than a confirmed installed version.

## Resolve before searching

With `systhema-docs`, start with:

```json title="resolve_docs_version arguments"
{ "version": "1.7.5" }
```

The service maps a patch to its kept minor. A prerelease of a kept minor also uses that minor; a prerelease of a newer, unreleased minor uses `next`. Ranges resolve from their minimum version. Archived minors and versions outside the served range return fallback docs with warnings; read those warnings before coding. Include `version` on every normal docs call; omission means latest, which may differ from the project.

```json title="search_docs arguments"
{ "query": "custom block client preview", "version": "1.7.5", "limit": 3 }
```

Read the relevant result rather than treating the snippet as a complete API contract:

```json title="read_doc arguments"
{ "path": "payload/custom-blocks", "version": "1.7.5" }
```

Use the response's section outline for large pages. See [MCP reference](mcp-server.md) for argument limits and continuation behavior.

## Retrieve markdown without MCP

Set the shell variable `SYSTHEMA_DOCS_ORIGIN` to the documentation site's HTTPS origin, without a trailing slash. This variable is only for the following curl examples; the CLI installer's origin override is `SYSTHEMA_DOCS_URL`. The examples below use relative routes against that origin; no `/docs` prefix belongs in the public path.

```bash
DOCS_VERSION=$(node -p "require('./node_modules/@systhemaui/core/package.json').version")
curl -fsSL "${SYSTHEMA_DOCS_ORIGIN}/v/${DOCS_VERSION}/llms.txt"
curl -fsSL "${SYSTHEMA_DOCS_ORIGIN}/v/${DOCS_VERSION}/components/button.md"
```

Full versions resolve through the docs proxy with a 308 redirect. A kept latest minor uses the root; an older kept minor uses `/v/<minor>`. A prerelease of a kept minor stays on that minor, while an unreleased newer minor uses `/next`. Follow the resolved links for subsequent reads.

Runtime messages use `docsUrl(route, anchor?)`, which pins the package's own full version in `docs.systhema.app/v/<full version>/<route>`. The proxy resolves that pin; the helper does not construct a minor URL itself.

| Route                        | Result                       |
| ---------------------------- | ---------------------------- |
| `/<slug>`                    | Latest stable HTML           |
| `/<slug>.md`                 | Latest stable markdown       |
| `/v/<major.minor>/<slug>.md` | Older minor markdown         |
| `/next/<slug>.md`            | Unreleased main markdown     |
| `/v/<major.minor>/llms.txt`  | That version's compact index |
| `/changelog/v<version>.md`   | Unversioned release notes    |

The latest version also has `/llms.txt`; unreleased main has `/next/llms.txt`. Avoid loading `llms-full.txt` as a default context source. Search and selected pages consume much less context.

## Request a page or section

The `.md` suffix and `Accept: text/markdown` are equivalent ways to request markdown:

```bash
curl -fsSL -H 'Accept: text/markdown' \
  "${SYSTHEMA_DOCS_ORIGIN}/v/1.7/components/button"
curl -fsSL "${SYSTHEMA_DOCS_ORIGIN}/v/1.7/components/button.md?section=variants"
```

Use a heading slug from the actual page outline. Do not invent an anchor from a heading you remember.

Search returns markdown when you request `format=md`:

```bash
curl -fsSL --get "${SYSTHEMA_DOCS_ORIGIN}/api/search" \
  --data-urlencode 'format=md' \
  --data-urlencode 'v=1.7.5' \
  --data-urlencode 'q=custom block preview'
```

## Keep token facts local

Read `.systhema/references/tokens/_index.toon`, collection references, generated types and `systhema.config.ts` for this project's themes, variants and values. Documentation defaults cannot prove a project has a `dark` mode or a particular button variant.

When the service is unavailable, use installed package types and local project sources. Report the lookup failure and distinguish locally verified behavior from assumptions. Do not substitute latest docs silently.
