Skip to main content

How to test local agents?

Evaluate custom AI agents that have been implemented locally. This guide shows you how to evaluate agents built locally and evaluate them with Maxim’s testing framework using the Yields Output function.

Overview

While agents provide a no-code solution for simple workflows, complex agents often require custom logic, external API calls, or sophisticated orchestration. The Yields Output function allows you to implement custom agent logic while still leveraging Maxim’s evaluation infrastructure.

Using CrewAI / LangChain for Agent Orchestration

CrewAI and LangChain are popular frameworks for building multi-agent systems. Here’s how their implementation can be integrated and evaluated with Maxim (using CrewAI as an example for Python and LangChain for TypeScript):
Set OPENAI_API_KEY in your environment variables before running the following code as the code uses the OS environment variable to access the OpenAI API key.

Best Practices

  1. Modular Design: Break your agent into smaller, testable functions
  2. Metadata: Include useful metadata like timing, token usage, and costs
  3. Testing: Create comprehensive test cases covering edge cases

Next Steps

For complex multi-agent workflows, consider using the Maxim observability features to trace individual steps and debug no-code agent execution.