Skip to main content

Overview

A context defines the execution environment for a flow—memory scope, reasoning depth, model parameters, and language preferences. While personas define “who” executes a flow, contexts define “how” it’s executed.

Syntax

Fields

memory (optional)

Type: One of session, persistent, none, ephemeral Defines the memory scope for the execution.
Memory Scopes:

language (optional)

Type: String (ISO language code) Preferred language for the execution context.

depth (optional)

Type: One of shallow, standard, deep, exhaustive Defines the reasoning depth and thoroughness of analysis.
Depth Levels:

max_tokens (optional)

Type: Integer (must be positive) Maximum number of tokens for the model’s response.
Guidelines:
  • 500-1000: Brief summaries, quick responses
  • 2000-4096: Standard tasks, moderate complexity
  • 8000-16000: Long-form reports, comprehensive analysis
  • 16000+: Extended documents, multi-part responses

temperature (optional)

Type: Float (range: 0.0 to 2.0) Controls randomness/creativity in model outputs. Lower = more deterministic, higher = more creative.
Temperature Guidelines:

cite_sources (optional)

Type: Boolean (default: false) Whether to require source citations in this context.

Complete Examples

Use Case: Comprehensive legal document analysis requiring accuracy, source tracking, and thorough investigation.

Quick Summary Context

Use Case: Fast, stateless summarization of documents.

Research Context

Use Case: Long-term research projects with citation requirements and detailed analysis.

Creative Writing Context

Use Case: Creative content generation with higher variability.

Production Context

Use Case: Balanced production environment for general tasks.

Usage with Run Statements

Contexts are activated using the within modifier:

Best Practices

1. Match Context to Task Criticality

High-stakes tasks need stricter contexts:

2. Memory Scope Tradeoffs

3. Temperature for Determinism

Lower temperature for consistency:

4. Token Budgets

Set appropriate token limits:

5. Combine with Personas

Contexts and personas work together:

Common Patterns

Development vs. Production

Multi-Language Support

Tiered Analysis Depths

Type Checking

The AXON type checker validates: Memory scope: Must be one of the valid scopes
Depth level: Must be one of the valid depth levels
Temperature range: Must be between 0.0 and 2.0
Max tokens: Must be positive
Context references: Referenced contexts must exist

Performance Considerations

Depth vs. Speed

Memory vs. Privacy

  • Persona — Define agent identities
  • Memory — Configure semantic memory stores
  • Flow — Build cognitive pipelines
  • Anchor — Set hard constraints