> For the complete documentation index, see [llms.txt](https://seekspeed.gitbook.io/seekspeed-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://seekspeed.gitbook.io/seekspeed-docs/agents/prompts-and-tools.md).

# Prompt & Tooling

Two of the highest-leverage knobs in agent latency. They get their own page because most teams underestimate both.

## System prompt

Every token of system prompt is paid on every turn. A 2,000-token system prompt with a 200-token user message means **91% of your prefill is fixed cost**, dominating TTFT. The optimization engine flags this aggressively:

```ts
// src/lib/recommendations.ts (excerpt)
const systemTokens = estimateTokens(agent.systemPrompt);
if (systemTokens > 1200) {
  push({
    title: "System prompt is over 1.2k tokens",
    rationale: "Long system prompts inflate prefill on every call. Move stable rules to a fine-tune or a tool description.",
    expectedImpact: "15-30% TTFT on short user messages",
    difficulty: "medium",
    confidence: 0.78,
  });
}
```

## Tools

Tool schemas are sent as part of the prompt. Ten tools with verbose JSON schemas can add 1-2k tokens per turn. SeekSpeed reads the tool count and average descriptor length from the agent profile and warns when the ratio is unfavourable.

A useful heuristic: **if a tool isn't used in 1 of every 5 turns, it shouldn't be in the system prompt**. Route it through a planner step that adds it conditionally.

## Memory mode

| Mode        | Cost                            | When to use                                            |
| ----------- | ------------------------------- | ------------------------------------------------------ |
| `ephemeral` | None                            | Stateless single-turn tasks. Default.                  |
| `rolling`   | O(window) per turn              | Conversational agents where the last *N* turns matter. |
| `vector`    | O(k) embedded snippets per turn | Long-running assistants with a knowledge base.         |

The benchmark runner records which mode was active so reports can compare apples to apples.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://seekspeed.gitbook.io/seekspeed-docs/agents/prompts-and-tools.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
