Context Engineer Protocol • AI Agent SDK

ContextEngineerProtocol: Protocol for Context Engineering agents.

ContextEngineerProtocol

Defined in the protocols 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

Usage

python
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

View on GitHub

praisonaiagents/agent/protocols.py at line 165


Related Documentation