> ## 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 Pipecat Flows conversation context across node transitions with the append and reset strategies.

A context strategy says what happens to the conversation history when the flow moves to a node.

## Strategy Types

* **APPEND** (default): the new node's messages are added to the existing context. The full history is kept and the context grows as the conversation goes on.
* **RESET**: the context is cleared and replaced with the new node's messages. Use it when the earlier history is no longer relevant, or would confuse the task at hand.

<Note>
  A third strategy, `RESET_WITH_SUMMARY`, is deprecated and will be removed in
  2.0, and is not available in a flow config. Use Pipecat's native [context
  summarization](/pipecat/fundamentals/context-summarization) instead; to
  summarize at a transition, push an `LLMSummarizeContextFrame` in a pre-action.
</Note>

## Global Configuration

The default strategy for every node is set on the `FlowManager` constructor, in both forms of flow:

```python theme={null}
from pipecat.flows import ContextStrategy, ContextStrategyConfig

flow_manager = FlowManager(
    worker=worker,
    llm=llm,
    context_aggregator=context_aggregator,
    context_strategy=ContextStrategyConfig(
        strategy=ContextStrategy.APPEND,
    )
)
```

## Per-Node Configuration

A node can override the global strategy:

<Tabs>
  <Tab title="Declarative">
    ```yaml theme={null}
    nodes:
      new_topic:
        context_strategy: reset
        task_messages:
          - role: developer
            content: Ask the customer what else you can help with.
    ```

    A node's `context_strategy` is either `append` or `reset`. Omit it to use the `FlowManager`'s strategy.
  </Tab>

  <Tab title="Programmatic">
    ```python theme={null}
    node_config = NodeConfig(
        task_messages=[...],
        functions=[...],
        context_strategy=ContextStrategyConfig(
            strategy=ContextStrategy.RESET,
        ),
    )
    ```
  </Tab>
</Tabs>
