Core Concepts
Smolagents is designed around several key concepts:- Agents: AI assistants that can use tools and reason through problems
- Tools: Functions that agents can call to interact with external systems
- Models: LLM backends that power agent reasoning (supports various providers via LiteLLM)
- Code Execution: Agents can write and execute Python code in sandboxed environments
- Multi-Agent Systems: Orchestrate multiple specialized agents working together
Installation
Install AgentOps and Smolagents, along with any additional dependencies:Setting Up API Keys
Before using Smolagents with AgentOps, you need to set up your API keys:- AGENTOPS_API_KEY: From your AgentOps Dashboard
- LLM API Keys: Depending on your chosen model provider (e.g., OPENAI_API_KEY, ANTHROPIC_API_KEY)
.env
file.
Usage
Initialize AgentOps before creating your Smolagents to automatically track all agent interactions:Examples
More Examples
Multi-Agent System
Complex multi-agent web browsing system
Text to SQL Agent
Convert natural language queries to SQL