π zoey-core
Your secrets are safe with Zoey
The foundational crate powering ZoeyOSβproviding the runtime, plugin system, type definitions, and agent API. Built for privacy-first AI agents optimized for local model deployment.
Installation
Add to your Cargo.toml:
[]
= "0.1"
Features
π Agent Runtime
- Async-first runtime built on Tokio
- Plugin lifecycle management
- Service orchestration
- Configuration management
π Plugin System
- Dynamic plugin loading
- Action, provider, and evaluator registration
- Plugin dependency resolution
- Hot-reloading support (planned)
π Agent API
- HTTP REST endpoints for agent interaction
- WebSocket support for real-time communication
- Authentication and authorization
- Rate limiting and request validation
π¦ Core Types
- Memory and knowledge structures
- Message and conversation models
- Agent configuration and state
- Provider and action interfaces
Quick Start
use ;
async
With Plugins
use ;
use Arc;
let mut opts = default;
// Add plugins
opts.add_plugin;
opts.add_plugin;
opts.add_plugin;
let runtime = new.await?;
Architecture
zoey-core
βββ runtime/ # Agent runtime and lifecycle
β βββ mod.rs # AgentRuntime implementation
β βββ opts.rs # RuntimeOpts configuration
β βββ services.rs # Service orchestration
βββ plugin/ # Plugin system
β βββ mod.rs # Plugin trait and registry
β βββ loader.rs # Dynamic plugin loading
β βββ context.rs # Plugin execution context
βββ agent_api/ # HTTP/WebSocket API
β βββ handlers.rs # Request handlers
β βββ routes.rs # Route definitions
β βββ auth.rs # Authentication
βββ types/ # Core type definitions
β βββ memory.rs # Memory structures
β βββ message.rs # Message models
β βββ agent.rs # Agent configuration
βββ lib.rs # Public API exports
Core Traits
Plugin Trait
Action Trait
Provider Trait
Configuration
Environment Variables
# Runtime configuration
ZOEY_LOG_LEVEL=info
ZOEY_MAX_WORKERS=4
ZOEY_PLUGIN_DIR=./plugins
# API configuration
ZOEY_API_HOST=127.0.0.1
ZOEY_API_PORT=3000
ZOEY_API_CORS_ORIGINS=http://localhost:3000
# Storage configuration
ZOEY_DATA_DIR=./.zoey/db
ZOEY_DB_PATH=./.zoey/db/zoey.db
Programmatic Configuration
let opts = RuntimeOpts ;
Storage Adapters
zoey-core defines the IDatabaseAdapter trait. Choose your storage backend:
| Crate | Backend | Best For |
|---|---|---|
zoey-storage-sql |
SQLite, PostgreSQL | Most deployments |
zoey-storage-mongo |
MongoDB | Document-based storage |
zoey-storage-supabase |
Supabase | Serverless PostgreSQL |
zoey-storage-vector |
Local | Dedicated vector search |
[]
= "0.1"
= "0.1" # Pick your backend
use ;
use SqliteAdapter;
use Arc;
let mut adapter = new;
adapter.init.await?;
let opts = default
.with_adapter;
Ecosystem
Providers
| Crate | Description |
|---|---|
zoey-provider-openai |
OpenAI GPT models |
zoey-provider-anthropic |
Claude models |
zoey-provider-local |
Ollama, llama.cpp (no API key!) |
zoey-provider-voice |
TTS/STT capabilities |
Plugins
| Crate | Description |
|---|---|
zoey-plugin-bootstrap |
Essential actions and providers |
zoey-plugin-memory |
Conversation memory |
zoey-plugin-knowledge |
Document ingestion and RAG |
zoey-plugin-search |
Web search integration |
Adaptors
| Crate | Description |
|---|---|
zoey-adaptor-discord |
Discord bot |
zoey-adaptor-telegram |
Telegram bot |
zoey-adaptor-web |
Web UI |
zoey-adaptor-terminal |
CLI interface |
Dependencies
This crate has minimal external dependencies:
tokio- Async runtimeaxum- HTTP frameworksqlx- Database accessserde- Serializationtracing- Logging and diagnostics
Testing
# Run unit tests
# Run with logging
RUST_LOG=debug
# Run specific test
License
MIT License - See LICENSE for details.