> ## Documentation Index
> Fetch the complete documentation index at: https://strattumai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get formatted agent context

> Returns an assembled Markdown context document ready for injection into an agent prompt. Includes profile, source provenance, 1-hop relationships and ranked recent events. Respects the token budget (default 4000 tokens).



## OpenAPI

````yaml /api-reference/memory-api.json get /v1/memory/entity/{entity_id}/context
openapi: 3.1.0
info:
  title: Strattum Memory API
  description: >-
    REST API that serves entity context — profile, timeline, graph, sources and
    formatted context — for agents and UIs. (PRD-003, Workstream 1.3)
  version: 1.0.0
servers: []
security: []
paths:
  /v1/memory/entity/{entity_id}/context:
    get:
      tags:
        - memory
      summary: Get formatted agent context
      description: >-
        Returns an assembled Markdown context document ready for injection into
        an agent prompt. Includes profile, source provenance, 1-hop
        relationships and ranked recent events. Respects the token budget
        (default 4000 tokens).
      operationId: get_context_v1_memory_entity__entity_id__context_get
      parameters:
        - name: entity_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Entity Id
        - name: depth
          in: query
          required: false
          schema:
            type: string
            description: >-
              Graph expansion: 'none' | 'immediate' (1-hop) | 'extended' (2-hop)
              | 'auto' (planner decides from `question`).
            default: immediate
            title: Depth
          description: >-
            Graph expansion: 'none' | 'immediate' (1-hop) | 'extended' (2-hop) |
            'auto' (planner decides from `question`).
        - name: question
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              The user's question. Used by depth='auto' to plan how deep / which
              relationships to traverse.
            title: Question
          description: >-
            The user's question. Used by depth='auto' to plan how deep / which
            relationships to traverse.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContextResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ContextResponse:
      properties:
        entity_id:
          type: string
          title: Entity Id
        content:
          type: string
          title: Content
        token_count:
          type: integer
          title: Token Count
        truncated:
          type: boolean
          title: Truncated
        sources:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Sources
      type: object
      required:
        - entity_id
        - content
        - token_count
        - truncated
      title: ContextResponse
      description: Response for GET /entity/{entity_id}/context.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````