> ## Documentation Index
> Fetch the complete documentation index at: https://docs.formation.texturehq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Context resolution

> Assemble one agent’s authorized persona, history, memory, and tools.

Each model request draws from **one agent's perspective**. The runtime may host
several agents, but one agent's private conversations, identities, settings, and
memories do not become another agent's background knowledge.

## What enters a turn

| Context | Source and boundary |
| - | - |
| Identity and persona | The current agent's configuration and active persona revision. |
| Current message | Persisted, connector-authenticated input with author and attachment attribution. |
| Recent history | Authorized events in the current conversation; default window 30, capped at 500. |
| Memory | Eligible current revisions selected for relevance and permitted actor preferences. |
| Tools | The current agent's enabled capabilities, configuration, and grants. |
| Continuing work | Authorized saved task context and recorded outcomes, restored under current policy. |

The [history-search tool](https://docs.formation.texturehq.com/runtime/conversation-search.md) can retrieve older or
other-conversation messages the current audience may receive. It does not bypass
the same permission rules used for recent history.

## Two independent boundaries

**Perspective** answers whose observations may be considered. All graph and
memory reads are keyed by the current agent. A deployment-wide identity match or
another agent's access to a room grants nothing here.

**Audience** answers where an observation may be reused. A private memory does
not become channel-visible because it is relevant or because its subject joins
the channel. [Memory privacy](https://docs.formation.texturehq.com/runtime/memory-privacy.md) describes authenticated
source evidence, derived lineage, sharing grants, and the checks before delivery.

[Verified identity links](https://docs.formation.texturehq.com/runtime/identity-linking.md) allow one person's eligible
private history to follow them between direct conversations within this agent's
perspective. They do not merge agents or broaden group permissions.

## Prompt assembly

The initial request separates runtime-authored system instructions from attributed
external context and the current message. External text does not become system
instructions simply because it arrived in a memory or transcript.

[Prompt admission](https://docs.formation.texturehq.com/runtime/prompt-budget.md) reserves required content and tool
schemas, then fits whole memory and history records into the remaining capacity.
Optional records may be omitted; required content that cannot fit causes a budget
error before provider execution. Context already exposed to a model remains in
the turn's provenance even if later calls omit it.

Changed assembled prompts are saved before the model call when snapshot storage
is configured. Model-call records refer to those snapshots. Checkpoint recovery
rebuilds live system policy and current permissions; saved system instructions
are not replayed as authority.

## Implementation

Recent history lives in [`internal/graph/history.go` (repository)](https://github.com/TextureHQ/formation/blob/main/internal/graph/history.go),
memory selection in [`internal/memory` (repository)](https://github.com/TextureHQ/formation/tree/main/internal/memory),
and prompt admission in [`internal/prompt` (repository)](https://github.com/TextureHQ/formation/tree/main/internal/prompt).
The turn engine combines them. There is no separate shipped WorkGraph worker
context resolver or cross-agent shared-memory pool.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.