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

# Context Strategies

> Manage conversation context across node transitions.

Flows provides three built-in ways to manage conversation context as you move between nodes.

## Strategy Types

1. **APPEND** (Default): New node messages are added to the existing context, preserving the full conversation history. The context grows as the conversation progresses.

2. **RESET**: The context is cleared and replaced with only the new node's messages. Useful when previous conversation history is no longer relevant or to reduce context window size.

3. **RESET\_WITH\_SUMMARY**: The context is cleared but includes an AI-generated summary of the previous conversation along with the new node's messages. Helps reduce context size while preserving key information.

<Warning>
  `RESET_WITH_SUMMARY` is deprecated and will be removed in 2.0. Use Pipecat's native
  [`LLMSummarizeContextFrame`](/pipecat/fundamentals/context-summarization) instead. To trigger
  on-demand summarization during a node transition, push an `LLMSummarizeContextFrame` in a
  pre-action.
</Warning>

## When to Use Each Strategy

* Use **APPEND** when full conversation history is important for context
* Use **RESET** when starting a new topic or when previous context might confuse the current task
* Use **RESET\_WITH\_SUMMARY** *(deprecated)* for long conversations where you need to preserve key points but reduce context size. Prefer Pipecat's native [context summarization](/pipecat/fundamentals/context-summarization) for new code.

## Configuration

Context strategies can be defined globally in the FlowManager constructor:

```python theme={null}
from pipecat_flows import ContextStrategy, ContextStrategyConfig

# Global strategy configuration
flow_manager = FlowManager(
    task=task,
    llm=llm,
    context_aggregator=context_aggregator,
    context_strategy=ContextStrategyConfig(
        strategy=ContextStrategy.APPEND,
    )
)
```

Or on a per-node basis:

```python theme={null}
# Per-node strategy configuration
node_config = {
    "task_messages": [...],
    "functions": [...],
    "context_strategy": ContextStrategyConfig(
        strategy=ContextStrategy.RESET_WITH_SUMMARY,
        summary_prompt="Provide a concise summary of the customer's order details and preferences."
    )
}
```
