> ## Documentation Index
> Fetch the complete documentation index at: https://daily-ms-ws-body-url-encode.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# LLMContextWorker

> LLMContextWorker extends LLMWorker with a built-in conversation context and aggregators for stateful agents.

`LLMContextWorker` extends [`LLMWorker`](/api-reference/server/workers/llm-worker) with a built-in `LLMContext` and a context aggregator pair, so it can track its own conversation history without manually wiring an `LLMContextAggregatorPair`. The pipeline is built as `[user_aggregator, llm, assistant_aggregator]` automatically.

Each `LLMContextWorker` gets its own context by default; pass the same `context=` to several workers to give them a shared conversation.

```python theme={null}
from pipecat.workers.llm import LLMContextWorker

agent = LLMContextWorker("my_agent", llm=OpenAILLMService(api_key="..."))
```

## Configuration

Inherits `name`, `llm`, `active`, `bridged`, and `defer_tool_frames` from [`LLMWorker`](/api-reference/server/workers/llm-worker#configuration), plus:

<ParamField path="context" type="LLMContext | None" default="None">
  Optional pre-built `LLMContext`. When omitted, a fresh empty context is
  created.
</ParamField>

<ParamField path="user_params" type="LLMUserAggregatorParams | None" default="None">
  Optional parameters for the user aggregator.
</ParamField>

<ParamField path="assistant_params" type="LLMAssistantAggregatorParams | None" default="None">
  Optional parameters for the assistant aggregator.
</ParamField>

## Properties

| Property | Type | Description |
| - | - | - |
| `context` | `LLMContext` | The `LLMContext` owned by this agent |
| `user_aggregator` | `LLMUserAggregator` | The user-side context aggregator |
| `assistant_aggregator` | `LLMAssistantAggregator` | The assistant-side context aggregator |
