Installation
Install the MindReef Python SDK and configure it for your environment.
Requirements
- Python 3.8 or higher
- A MindReef account and API key
Install with pip
The recommended way to install the MindReef SDK is via pip:
pip install mindreef
With Optional Dependencies
Install with support for specific LLM providers:
# OpenAI integration
pip install mindreef[openai]
# Anthropic integration
pip install mindreef[anthropic]
# All integrations
pip install mindreef[all]
Configuration
Configure the SDK with your API key. You can do this via environment variable or in code.
Environment Variable (Recommended)
export MINDREEF_API_KEY=mr_live_your_api_key_here
In Code
from mindreef import MindReef
# Initialize with explicit API key
mr = MindReef(api_key="mr_live_your_api_key_here")
Security Note: Never commit your API key to version control. Use environment variables or a secrets manager in production.
Configuration Options
The SDK accepts these configuration options:
from mindreef import MindReef
mr = MindReef(
api_key="mr_live_...", # Your API key
environment="production", # Environment tag
service_name="my-agent", # Service identifier
batch_size=100, # Traces per batch (default: 100)
flush_interval=5.0, # Seconds between flushes (default: 5)
enabled=True, # Enable/disable tracing
)
Verify Installation
Test that the SDK is installed and configured correctly:
from mindreef import trace
@trace
def test_function():
return "Hello, MindReef!"
result = test_function()
print(result) # Should print: Hello, MindReef!
Check the MindReef dashboard. You should see a trace for test_function within a few seconds.
Next Steps
- Learn about tracing decorators and spans
- Set up LLM integrations