SAYR Engine
A high-performance Rust AI agent runtime inspired by the Agno framework.
Disclaimer
SAYR Engine is an independent, community-driven Rust project inspired by the Agno framework. It is not affiliated with, endorsed by, or maintained by the Agno company or its authors.
Features
Multi-Provider LLM Support (10 Providers)
| Provider | Default Model | Environment Variable |
|---|---|---|
| OpenAI | gpt-4 | OPENAI_API_KEY |
| Anthropic | claude-3-sonnet | ANTHROPIC_API_KEY |
| Google Gemini | gemini-pro | GOOGLE_API_KEY |
| Cohere | command-r-plus | COHERE_API_KEY |
| Groq | llama-3.3-70b-versatile | GROQ_API_KEY |
| Ollama | llama3.1 | OLLAMA_HOST (optional) |
| Mistral | mistral-large-latest | MISTRAL_API_KEY |
| Azure OpenAI | gpt-4 | AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_API_KEY |
| AWS Bedrock | claude-3-sonnet | AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION |
| Together AI | Llama-3.3-70B-Instruct | TOGETHER_API_KEY |
| Fireworks | llama-v3p1-70b-instruct | FIREWORKS_API_KEY |
Built-in Toolkits (13 Toolkits)
| Category | Toolkits | Description |
|---|---|---|
| Search | DuckDuckGo, Wikipedia, Arxiv, PubMed | Web, knowledge, and academic search |
| Communication | Slack, Gmail, Discord | Messaging and email integration |
| Development | GitHub, Shell, HTTP | Code repos, commands, API calls |
| Data | SQL (SQLite), Postgres, DuckDB, JSON, Calculator | Database queries, data processing |
Memory and Knowledge
- Vector Stores: In-memory, PostgreSQL (pgvector), Qdrant
- Embedders: OpenAI, Transformers, Whitespace (testing)
- Memory Strategies: Full, Windowed, Summarized, Token-limited
- Document Chunking: Sliding window chunker with overlap
Enterprise Features
- Guardrails: PII detection (SSN, credit card, email, phone), prompt injection detection
- RBAC and Privacy: Access control, principals, privacy rules
- Reasoning: Chain-of-thought orchestration with confidence scoring
- MCP Support: Model Context Protocol client with stdio/HTTP transports
Observability
- Telemetry: OpenTelemetry tracing with OTLP export
- Metrics: Prometheus exporter for run duration, tool calls, failures
- Structured Events: In-memory collector with batch delivery
Runtime and Deployment
- HTTP Server: REST API with SSE streaming
- Workflows: Sequential, parallel, and conditional execution
- Teams: Multi-agent coordination
- Config: File-based or environment variable configuration
Installation
Add to your Cargo.toml:
[]
= "0.3"
Quick Start
use ;
use ;
async
Toolkit Examples
GitHub Integration
use ;
let mut tools = new;
register_github_tools; // Uses GITHUB_TOKEN env var
// Tools: github_search_repos, github_get_repo, github_list_issues, github_read_file
Slack Integration
use ;
let mut tools = new;
register_slack_tools;
// Tools: slack_send_message, slack_list_channels, slack_search
SQL Database
use register_sql_tools;
let mut tools = new;
register_sql_tools;
// Tools: sql_query (read-only by default), sql_schema
Academic Research
use ;
let mut tools = new;
register_arxiv_tools; // Search arXiv papers
register_pubmed_tools; // Search PubMed
// Tools: arxiv_search, pubmed_search
Memory Strategies
use ;
// Keep last 10 messages
let strategy = new;
// Or use summarization for long conversations
let strategy = new;
Guardrails
use ;
let mut chain = new;
chain.add;
chain.add;
// Check input before sending to LLM
match chain.validate
MCP Integration
use ;
// Connect to MCP server
let transport = spawn?;
let client = new;
client.initialize.await?;
// Register MCP tools with agent
let mcp_tools = new;
mcp_tools.register_all.await?;
Observability
use ;
// Initialize OpenTelemetry tracing
init_tracing;
// Initialize Prometheus metrics
init_prometheus_registry;
Architecture
sayr-engine/
├── src/
│ ├── agent.rs # Core agent loop
│ ├── llm.rs # 10 LLM provider clients
│ ├── tools/ # 13 built-in toolkits
│ ├── guardrails.rs # PII and injection detection
│ ├── memory.rs # Memory strategies
│ ├── mcp.rs # MCP client
│ ├── knowledge/ # RAG and vector stores
│ ├── reasoning.rs # Chain-of-thought
│ └── server.rs # HTTP runtime
├── libs/
│ └── sayr-py/ # PyO3 Python bindings
├── cookbook/ # Example agents
└── scripts/ # Development utilities
Python Bindings
You can use the Rust implementation from Python with familiar Agno syntax:
=
Testing
# Run all tests
# Run with coverage
# Format and lint
License
MIT License - see LICENSE for details.
Acknowledgments
Inspired by agno-agi/agno - the Python agent framework.