This guide walks you through creating your first agent project with Better Agents.
- Node.js 18 or higher
- An OpenAI API key
- A LangWatch API key (get one at https://app.langwatch.ai/authorize)
- Claude Code installed (optional, for coding assistant integration)
npm install -g @langwatch/better-agentsOr use with npx (no installation needed):
npx @langwatch/better-agents init my-stock-agentLet's create a stock analysis agent:
better-agents init my-stock-agentYou'll be prompted with:
? What programming language do you want to use?
❯ Python
TypeScript
Choose: Python
? What agent framework do you want to use?
❯ Agno
Note: Agno is the only option for Python (Mastra is for TypeScript)
? What coding assistant do you want to use?
❯ Claude Code
? What LLM provider do you want to use?
❯ OpenAI
? Enter your OpenAI API key: ********************************
Enter your key (it starts with sk-)
To get your LangWatch API key, visit:
https://app.langwatch.ai/authorize
? Enter your LangWatch API key: ********************************
Enter your key (it starts with sk-lw-)
? What do you want to build?
Example answer: "Build an agent that can analyze stock prices and provide trading recommendations"
You'll see:
✔ Setting up your agent project...
✨ Your agent project is ready!
Project location: /path/to/my-stock-agent
🤖 Starting your coding assistant...
Initial prompt:
"You are an expert AI agent developer. This project has been set up with Better Agents best practices.
First steps:
1. Read and understand the AGENTS.md file - it contains all the guidelines for this project
2. Update the AGENTS.md with specific details about what this project does
3. Create a comprehensive README.md explaining the project, setup, and usage
4. Set up the Python environment (requirements.txt)
5. Use the Agno MCP to learn about Agno best practices
6. Use the LangWatch MCP to learn about prompt management and testing
7. Start implementing the core agent functionality
Remember:
- ALWAYS use LangWatch Prompt CLI for prompts (ask the MCP how)
- ALWAYS write Scenario tests for new features (ask the MCP how)
- Follow the Agent Testing Pyramid methodology
- Test everything before considering it done
Project Goal: Build an agent that can analyze stock prices and provide trading recommendations"
To start Claude Code with this prompt, run:
cd /path/to/my-stock-agent
claude "You are an expert AI agent developer..."
Happy coding! 🚀
Navigate to your project:
cd my-stock-agent
ls -laYou'll see:
my-stock-agent/
├── app/ # Main application code
│ └── main.py
├── prompts/ # Versioned prompt files
│ └── sample_prompt.yaml
├── tests/
│ ├── evaluations/ # Jupyter notebooks for evaluations
│ │ └── example_eval.ipynb
│ └── scenarios/ # Scenario tests
│ └── example_scenario.test.py
├── .mcp.json # MCP server configuration (universal)
├── .cursor/
│ └── mcp.json # Symlink to ../.mcp.json for Cursor
├── AGENTS.md # Development guidelines
├── CLAUDE.md # References AGENTS.md for Claude Code
├── .env # Your API keys (DO NOT COMMIT!)
├── .env.example # Template for API keys
├── .gitignore
└── prompts.json # Prompt registry
Open AGENTS.md to understand the guidelines:
cat AGENTS.mdThis file contains:
- Project overview
- Core principles (Agent Testing Pyramid)
- Testing requirements
- Prompt management guidelines
- Framework-specific best practices
- Development workflow
claude "Build an agent that can analyze stock prices and provide trading recommendations"Claude Code will:
- Read AGENTS.md
- Set up the Python environment
- Learn from Agno MCP (ask it about Agno best practices)
- Use LangWatch MCP for prompt management
- Start building your agent with best practices
Claude Code will create:
# requirements.txt
agno>=0.1.0
langwatch>=0.1.0
python-dotenv>=1.0.0Using LangWatch Prompt CLI:
# prompts/stock_analysis.yaml
model: gpt-4o
temperature: 0.7
messages:
- role: system
content: |
You are a stock analysis expert...# app/main.py
from agno import Agent
import langwatch
# Agent code following Agno patterns...# tests/scenarios/stock_analysis.test.py
"""Test stock analysis agent scenarios"""
def test_analyze_stock():
# Scenario test using LangWatch Scenario
pass# tests/evaluations/stock_eval.ipynb
# Jupyter notebook evaluating:
# - Accuracy of stock recommendations
# - Response quality
# - Tool usage effectivenesspython app/main.pypytest tests/scenarios/langwatch prompts list
langwatch prompts push prompts/stock_analysis.yamlVisit: https://app.langwatch.ai/
✅ Prompt Versioning: All prompts in prompts/ directory
✅ Testing: Scenario tests for every feature
✅ Evaluations: Measure component performance
✅ Agent Testing Pyramid: Unit tests + Evals + Simulations
✅ MCP Integration: Expert guidance built-in
✅ Framework Best Practices: Agno patterns enforced
- Implement Core Features: Build your agent following AGENTS.md
- Write Tests: Create scenario tests for each capability
- Create Evaluations: Measure and optimize performance
- Iterate: Use evaluations to improve your agent
- Deploy: Your agent is production-ready!
- Ask LangWatch MCP: "How do I [do something]?"
- Consult Agno MCP: Ask "How do I [do X] in Agno?"
- Visit LangWatch Dashboard: https://app.langwatch.ai/
- Read Scenario docs: https://scenario.langwatch.ai/
Congratulations! You now have a production-ready agent project with best practices baked in. 🚀