> ## 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**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/protocols.md) module.

AI Agent

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

> [card] [analyze\_codebase()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/ContextEngineerProtocol-analyze_codebase.md)
>
> Analyze a codebase and extract patterns, structure, and conventions.

> [card] [generate\_prp()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/ContextEngineerProtocol-generate_prp.md)
>
> Generate a Product Requirements Prompt (PRP) for a feature.

> [card] [create\_implementation\_blueprint()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/ContextEngineerProtocol-create_implementation_blueprint.md)
>
> Create a step-by-step implementation blueprint.

> [card] [aanalyze\_codebase()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/ContextEngineerProtocol-aanalyze_codebase.md)
>
> Async version of analyze\_codebase.

> [card] [agenerate\_prp()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/ContextEngineerProtocol-agenerate_prp.md)
>
> Async version of generate\_prp.

## 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] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/agent/protocols.py#L165)
>
> `praisonaiagents/agent/protocols.py` at line 165

***

## Related Documentation

> [card] [Context Concept](https://praison.ai/docs/docs/concepts/context)

> [card] [Context Management](https://praison.ai/docs/docs/features/context-management)

> [card] [Context Strategies](https://praison.ai/docs/docs/features/context-strategies)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.