Skip to main content

Why Protocols?

Protocols enable testing without real LLM calls and custom implementations of agents, memory, and tools.

Quick Start

1. Mock an Agent for Testing

2. Custom Memory Backend

3. Mock Tools for Testing


All Protocols

AgentProtocol

MemoryProtocol

ToolProtocol


Real-World Scenarios

Scenario 1: Unit Testing Agent Workflows

Scenario 2: Custom Database Memory

Scenario 3: Mock External API Tools


Import Paths


Architecture: Where to Put Custom Implementations

Custom implementations (Redis, PostgreSQL, etc.) should NOT go in the core SDK. Use protocols to keep the core lightweight.

Example: Adding Redis Memory

Usage

Benefits


When to Update Protocols

Protocols define a minimal contract. Adding features to Agent doesn’t require protocol updates.