explaingit

reescalder/agent-memory-supabase

Analysis updated 2026-07-26

2PLpgSQLAudience · developerComplexity · 3/5Setup · moderate

TLDR

A long-term memory system for AI agents built on Supabase Postgres. Agents store, deduplicate, and recall memories using vector search, keyword search, and entity matching, all with full data ownership.

Mindmap

mindmap
  root((repo))
    What it does
      Agent long-term memory
      Deduplicates on store
      Three-lane recall
    How it works
      Vector embeddings
      Keyword full-text search
      Entity matching
      Rank fusion merging
    Memory types
      Facts with timelines
      Preferences and corrections
      Decisions and events
    Tech stack
      Supabase Postgres
      PLpgSQL functions
      JavaScript client
    Audience
      AI agent builders
      Developers wanting ownership
      Non-hosted memory users

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Give a chatbot persistent memory across conversations without a third-party service.

USE CASE 2

Store and recall agent decisions, preferences, and facts with automatic deduplication.

USE CASE 3

Search an agent's memory by meaning, keywords, or named entities like people and projects.

USE CASE 4

Keep a full history of how facts change over time without deleting old information.

What is it built with?

PLpgSQLPostgreSQLSupabaseJavaScript

How does it compare?

reescalder/agent-memory-supabaseomarish/llm-sqlsaiprajoth/timescaledb-lab
Stars211
LanguagePLpgSQLPLpgSQLPLpgSQL
Setup difficultymoderatemoderatemoderate
Complexity3/54/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires a Supabase project with the pgvector extension enabled, installation is by cloning the repo directly since it is not on npm yet.

No license information is provided in the repository, so usage rights are unclear.

In plain English

{"i":0,"repo":"reescalder/agent-memory-supabase","stars":2,"lang":"PLpgSQL","ok":true,"char_count":1725,"text":"This project gives AI agents a long-term memory system built entirely on top of a standard Postgres database hosted through Supabase. Instead of relying on a separate service that sits between your agent and its stored knowledge, you get a single database table, a handful of SQL functions, and a small JavaScript client. The core idea is that you fully own and can inspect the underlying data and logic at all times.\n\nWhen an agent stores a new memory, the system first checks whether a near-identical memory already exists. It does this in two ways: by comparing meaning using vector embeddings, and by comparing text patterns using a Postgres feature called trigram matching. If a match is found, the existing memory is updated in place rather than creating a duplicate row. This keeps the memory store clean without needing a separate cleanup process.\n\nRecalling memories works through three independent search lanes that are then combined into one ranked list. The first lane compares meaning using vector similarity. The second uses traditional full-text keyword search. The third is an entity lane that pulls up memories related to specific people, projects, or tools named in the query. A ranking formula called Reciprocal Rank Fusion merges the results from all three lanes. Small adjustments for recency, importance, and how often a memory is used affect the final ordering.\n\nMemories are organized into nine types, including fact, decision, preference, correction, and event. The type matters because it changes how the memory is treated. Preferences and corrections never lose ranking priority over time. Transcripts are kept out of keyword search. Facts also carry a timeline, so when information changes, the old fact is marked as superseded rather than deleted, preserving full history.\n\nThe author built this after running a similar system in production with over 22,000 stored memories. The code includes practical notes about real bugs encountered, such as why a specific function overload quietly broke the deduplication logic for months. The project is not yet published to npm, so installation is done by cloning the repository directly. The full README is longer than what was shown.","error":null}

Copy-paste prompts

Prompt 1
Set up agent-memory-supabase in my Supabase project: create the memory table, run the SQL functions, and connect the JavaScript client so my chatbot can store and recall memories.
Prompt 2
Using agent-memory-supabase, write code that stores a new memory, checks for near-duplicates using vector similarity and trigram matching, and updates an existing memory if a match is found.
Prompt 3
Using agent-memory-supabase, write a recall function that searches memories across all three lanes, vector, keyword, and entity, then merges and ranks the results.
Prompt 4
Using agent-memory-supabase, store a fact memory and then update it with new information so the old fact is marked as superseded instead of deleted.
Prompt 5
Adapt agent-memory-supabase for my existing AI agent by replacing its current memory layer with this Postgres-based system.

Frequently asked questions

What is agent-memory-supabase?

A long-term memory system for AI agents built on Supabase Postgres. Agents store, deduplicate, and recall memories using vector search, keyword search, and entity matching, all with full data ownership.

What language is agent-memory-supabase written in?

Mainly PLpgSQL. The stack also includes PLpgSQL, PostgreSQL, Supabase.

What license does agent-memory-supabase use?

No license information is provided in the repository, so usage rights are unclear.

How hard is agent-memory-supabase to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is agent-memory-supabase for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.