---
title: "Assemble the agent boot context pack"
method: POST
path: "/api/agent/boot"
tags: ["Agent"]
---

# Assemble the agent boot context pack

`POST /api/agent/boot`

## Request

- Base URL: `http://localhost:38200`
- URL: `http://localhost:38200/api/agent/boot`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `token`

Assembles the identity + resume + facts + lessons + (optional) goal-graph brief + procedural skill suggestions + (optional) repo map into one bounded, token-budgeted response. The primary entry point of the agent memory layer — see `agent_boot` in CLAUDE.md.

## Request body

- object
  - `agent` string, required
  - `agent_name` string
  - `goal` string
  - `workspace` string
  - `token_budget` integer
  - `session_id` integer
  - `project_id` integer: When present
  - `include_global` boolean: Also read the GLOBAL workspace (slug=global) and union the results. Still tenant-filtered.
  - `include_repo_map` boolean: Assemble a token-budgeted repo map from code-indexed contexts and include it as repo_map.
  - `repo_map_token_budget` integer: Token cap for the repo_map slot (default ~2000). Ignored unless include_repo_map=true.
  - `epistemic_min` 'observed' | 'told' | 'inferred' | 'assumed': Epistemic floor for the facts slot; omitted = no floor.
  - `full` boolean: Bypass the skills diff-since-last-boot behavior and return the full current suggestion set.

## Response `200`

Boot context pack.

- AgentBootPack: The `agent_boot` context pack (`BootPack` in agent-boot.service.ts). Documented loosely — several slots are feature-gated and present only when the corresponding request flag/env var is set (`brief` only with `project_id`, `repo_map` only with `include_repo_map`, `push` only when `MEMORY_PUSH_ENABLED=true`). See the request schema's field comments for the exact gating per slot.
  - `agent` object
    - `id` integer
    - `slug` string
  - `session` object, nullable
    - `id` integer
    - `goal` string, nullable
    - `status` string
    - `role` string, nullable
  - `resume` object, nullable
  - `handoff` object, nullable
  - `lessons` object[]
    - `id` integer
    - `what_failed` string
    - `why` string, nullable
    - `try_instead` string, nullable
    - `similarity` number, nullable
  - `facts` object[]
  - `brief` object, nullable: Goal-graph situation brief; present only when project_id was supplied.
  - `skills` object[]
  - `skills_full` boolean
  - `push` object, nullable
  - `repo_map` object, nullable

## Other responses

- `400`: Request body/query failed Zod validation.
- `401`: Missing or invalid credentials.

---

[API](https://skmtc.dev/contextq/apis/contextq-api.md) · [All operations](https://skmtc.dev/contextq/apis/contextq-api/llms.txt) · [OpenAPI document](https://skmtc.dev/contextq/apis/contextq-api/revisions/7afc44056a22?raw)
