> ## 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.

# Context Engineer Protocol • AI Agent SDK

> ContextEngineerProtocol: Protocol for Context Engineering agents.

# ContextEngineerProtocol

> Defined in the [**protocols**](../modules/protocols) module.

<Badge color="blue">AI Agent</Badge>

Protocol for Context Engineering agents.

Defines the interface for agents that perform codebase analysis,
PRP (Product Requirements Prompt) generation, and implementation planning.

This protocol enables:

* Lightweight core with protocol definition only
* Heavy implementations in wrapper/tools
* Easy mocking for tests

## Methods

<CardGroup cols={2}>
  <Card title="analyze_codebase()" icon="function" href="../functions/ContextEngineerProtocol-analyze_codebase">
    Analyze a codebase and extract patterns, structure, and conventions.
  </Card>

  <Card title="generate_prp()" icon="function" href="../functions/ContextEngineerProtocol-generate_prp">
    Generate a Product Requirements Prompt (PRP) for a feature.
  </Card>

  <Card title="create_implementation_blueprint()" icon="function" href="../functions/ContextEngineerProtocol-create_implementation_blueprint">
    Create a step-by-step implementation blueprint.
  </Card>

  <Card title="aanalyze_codebase()" icon="function" href="../functions/ContextEngineerProtocol-aanalyze_codebase">
    Async version of analyze\_codebase.
  </Card>

  <Card title="agenerate_prp()" icon="function" href="../functions/ContextEngineerProtocol-agenerate_prp">
    Async version of generate\_prp.
  </Card>
</CardGroup>

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
class MockContextEngineer:
        def analyze_codebase(self, path: str) -> Dict[str, Any]:
            return {"project": path, "patterns": []}
        
        def generate_prp(self, request: str, analysis: Dict = None) -> str:
            return f"PRP for: {request}"
        
        async def aanalyze_codebase(self, path: str) -> Dict[str, Any]:
            return await self.analyze_codebase(path)
```

## Source

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

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Context Concept" icon="layer-group" href="/docs/docs/concepts/context" />

  <Card title="Context Management" icon="sliders" href="/docs/docs/features/context-management" />

  <Card title="Context Strategies" icon="diagram-project" href="/docs/docs/features/context-strategies" />
</CardGroup>
