zoey-storage-supabase

Crates.iozoey-storage-supabase
lib.rszoey-storage-supabase
version0.1.1
created_at2026-01-09 23:40:12.151405+00
updated_at2026-01-09 23:56:38.085502+00
descriptionSupabase database adapter for ZoeyAI
homepage
repositoryhttps://github.com/Agent-Zoey/Zoey.git
max_upload_size
id2033164
size210,203
Christopher Freytes (Freytes)

documentation

README

Zoey

Always watching over your data

🗄️ zoey-storage-supabase

Crates.io Documentation License: MIT

Supabase storage adapter for ZoeyAI

A Supabase implementation of the IDatabaseAdapter trait from zoey-core. Leverages Supabase's PostgreSQL backend with REST API integration.

Installation

Add to your Cargo.toml:

[dependencies]
zoey-core = "0.1"
zoey-storage-supabase = "0.1"

Features

  • Supabase Native - REST API and direct PostgreSQL access
  • 🔍 Vector Search - pgvector integration for similarity search
  • 🔐 Row Level Security - Supabase RLS support
  • 📊 Real-time - Ready for Supabase real-time subscriptions

Quick Start

use zoey_core::{AgentRuntime, RuntimeOpts, IDatabaseAdapter};
use zoey_storage_supabase::{SupabaseAdapter, SupabaseConfig};
use std::sync::Arc;

#[tokio::main]
async fn main() -> zoey_core::Result<()> {
    // Create Supabase adapter
    let config = SupabaseConfig {
        url: "https://your-project.supabase.co".to_string(),
        api_key: std::env::var("SUPABASE_KEY").unwrap(),
        ..Default::default()
    };
    
    let mut adapter = SupabaseAdapter::new(config);
    
    // Initialize
    adapter.init().await?;
    
    // Use with runtime
    let opts = RuntimeOpts::default()
        .with_adapter(Arc::new(adapter));
    
    let runtime = AgentRuntime::new(opts).await?;
    
    Ok(())
}

Configuration

Environment Variables

SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your-anon-or-service-key

Direct PostgreSQL Connection

For direct database access (bypassing REST API):

let config = SupabaseConfig {
    url: "postgresql://postgres:password@db.your-project.supabase.co:5432/postgres".to_string(),
    api_key: "".to_string(),
    use_direct_connection: true,
    ..Default::default()
};

Vector Search with pgvector

Supabase supports pgvector for vector similarity search:

-- Enable pgvector (run once in Supabase SQL editor)
CREATE EXTENSION IF NOT EXISTS vector;

The adapter automatically handles vector operations when pgvector is enabled.


Related Crates

Crate Description
zoey-core Core runtime and IDatabaseAdapter trait
zoey-storage-sql SQLite & PostgreSQL adapters
zoey-storage-mongo MongoDB adapter
zoey-storage-vector Local vector storage

License

MIT License - See LICENSE for details.


🔐 Your secrets are safe with Zoey

Commit count: 12

cargo fmt