Supabase
This guide will walk you through creating an AI agent that utilizes supabase as the memory store.
Using Supabase with Daydreams
Setup Info:
- Vector Model Provider:
gpt-4-turbo
via@ai-sdk/openai
- Model Provider:
google/gemini-2.0-flash-001
via@openrouter/ai-sdk-provider
- Memory Store: Supabase via
@daydreamsai/supabase
- Communication method: Command Line via
@daydreamsai/cli
Initialize a project and add our setup packages
After installing the packages, go to https://supabase.com/ and create a new project. Once your project is created, you'll need to add the two environment variables necessary for this package to your environment.
These variables are provided by Supabase when you create the project and can be found in your project settings:Data API.
Next, you need to set up the necessary database structure for the agent's memory. Copy the following SQL code block and paste in the Supabase SQL Editor (found in the sidebar):
Afterards you should see a success message like "Success. No rows returned".
With the Supabase setup complete, let's create the agent in our index.ts
:
Run the agent and chat via the command line interface!