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

# Create Context Agent • AI Agent SDK

> create_context_agent: Factory function to create a ContextAgent following Context Engineering and PRD methodology.

# create\_context\_agent

<div className="flex items-center gap-2">
  <Badge color="teal">Function</Badge>
</div>

> This function is defined in the [**context\_agent**](../modules/context_agent) module.

Factory function to create a ContextAgent following Context Engineering and PRD methodology.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%

graph LR
    input["Input Data"] --> agent["Agent: create_context_agent"]
    agent --> output["Output Result"]
    style agent fill:#8B0000,color:#fff
    style input fill:#8B0000,color:#fff
    style output fill:#8B0000,color:#fff
```

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def create_context_agent(llm: Optional[Union[str, Any]]) -> ContextAgent
```

## Parameters

<ParamField query="llm" type="Optional" required={false}>
  Language model to use (e.g., "gpt-4o-mini", "claude-3-haiku") \*\*kwargs: Additional arguments to pass to ContextAgent constructor
</ParamField>

### Returns

<ResponseField name="Returns" type="ContextAgent">
  Configured ContextAgent for comprehensive context generation following PRD principles
</ResponseField>

## Uses

* `ContextAgent`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/agent/context_agent.py#L2485">
  `praisonaiagents/agent/context_agent.py` at line 2485
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Agents Concept" icon="robot" href="/docs/concepts/agents" />

  <Card title="Single Agent Guide" icon="book-open" href="/docs/guides/single-agent" />

  <Card title="Multi-Agent Guide" icon="users" href="/docs/guides/multi-agent" />

  <Card title="Agent Configuration" icon="gear" href="/docs/configuration/agent-config" />

  <Card title="Auto Agents" icon="wand-magic-sparkles" href="/docs/features/autoagents" />
</CardGroup>
