Learning resourcesReviewed · Mem0

Build a Company Brain with Mem0 Platform and Supabase

This Mem0 cookbook teaches developers to build shared company memory for AI assistants, but access controls and reliable data syncing need additional implementation. Supabase holds source records and identities, while Mem0 Platform manages memory extraction and storage. Python examples cover personal, team and company memory, with hosted MCP access for editors and agents.

Researched 25 Nov 2026

In short.

This Mem0 cookbook helps developers build shared company memory for AI assistants, but its examples leave access controls and reliable data syncing unfinished. It combines Supabase records and identities with managed Mem0 memory, scoped retrieval and an OAuth-connected MCP server. Its useful technical lessons include separating personal and shared memories and combining their scopes with OR filters. The ingestion code ignores extraction failure status before recording completion, and authenticated access is left for further implementation. Nothing was executed; retrieval quality, operating costs and licensing remain unestablished.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete captured documentation page at [https://docs.mem0.ai/cookbooks/integrations/supabase], including embedded examples, every MCP tab, production cautions and metadata. The supplied artifact is the original selected-page.html capture. Linked documentation, repository contents, package files, pricing pages and legal terms are excluded. No license or redistribution notice is established by the page. No code, integration or hosted service was executed; displayed outputs remain publisher examples.

The overview

identity

Build a Company Brain with Mem0 Platform and Supabase is an official Mem0 cookbook at [https://docs.mem0.ai/cookbooks/integrations/supabase]. It supplies SQL, Python scripts and MCP configuration for retaining company decisions, ownership information, policies and personal preferences. The resource is an implementation guide, with a new-hire onboarding example as its final demonstration.

assessment

The guide is useful for understanding how an existing Supabase application could gain shared AI memory without operating its own vector database. It explains several consequential API details, including asynchronous writes and different scope arguments for reading and writing. Its examples need further engineering before production use: authorization is incomplete, and the synchronization loop can record unsuccessful extraction as completed.

users

The strongest fit is developers building internal assistants, engineering knowledge tools or onboarding support, particularly where Supabase already holds employee and source records. Beginners receive a concrete scenario and small scripts, but need familiarity with Python, SQL, environment variables and API credentials. Experienced developers can use the entity-routing and retrieval examples as design references.

capabilities

The cookbook documents extracting durable facts into personal, team and company memories. Separate extraction instructions govern individual and shared facts, while custom categories organize decisions, ownership, policies and tooling. Each ingested source row carries source and knowledge_id metadata for tracing memories back to Supabase.

Retrieval examples combine semantic matching, which searches by meaning, with keyword search, reranking and filters for entity, category, date or metadata. The hosted MCP examples expose memory tools such as add_memory and search_memories to Claude Code and Cursor. A Slack snippet illustrates a tool call; a complete Slack bot is not supplied.

Using it

requirements

The page specifies Python 3.9+, a Mem0 Platform API key and a Supabase project. Its installation command requires mem0ai>=2.0.17 for agent_custom_instructions, plus supabase and requests. Server-side scripts use MEM0_API_KEY, SUPABASE_URL and SUPABASE_SERVICE_KEY; the Supabase credential is a service-role key intended to read all ingestion scopes. Mem0 handles extraction and embeddings without a separate OpenAI key in this example.

The Python prerequisite is internally inconsistent: ask.py uses str | None annotations without postponing their evaluation. That file requires Python 3.10+ as written, or annotation changes for Python 3.9. The documented editor connection also uses npx and a browser-based Mem0 OAuth login; compatible client and Node.js versions are unspecified.

mechanism

Supabase remains the source of truth for employee records and company knowledge. Content is sent into Mem0 Platform, which manages its own memory storage. Supabase Auth identifiers become user_id values for personal memory. Shared memory uses application-chosen agent_id labels such as org:acme and team:payments; these labels identify memory scopes.

The ingestion script reads knowledge rows with a null mem0_synced_at value, submits their content and polls the returned event_id. Retrieval combines personal, company and team scopes using OR because the page describes each memory as belonging to one entity. ask.py requests up to five matches with reranking and formats their memory text. The API conventions also differ: search() and get_all() receive scopes inside filters, while add() and delete_all() receive top-level entity arguments.

setup

The documented setup creates employees and knowledge tables in Supabase, reusing auth.users for identity and storing team membership on employees. It seeds five knowledge rows, installs the Python dependencies and configures the three environment variables. brain.py configures project-wide extraction instructions and categories; ingest.py imports source knowledge; ask.py retrieves it; onboarding.py adds a personal-memory example.

For editor access, the guide uses the npx mcp-add helper with the hosted endpoint [https://mcp.mem0.ai/mcp] and clients set to claude code,cursor. Authentication proceeds through browser OAuth. A manual configuration tab supplies the endpoint without a static token. The author estimates about 20 minutes for the tutorial, but completion time is unassessed.

example

The seeded company knowledge includes choosing Postgres for transactions and relational joins, deploying on Tuesdays and Thursdays, and assigning billing to the Payments team. A question about Postgres and Friday deployment is illustrated with recalled facts about both the database decision and deployment policy.

The onboarding example gives Dana a Payments team identity and records her preference for early returns in code. Queries then span her personal memory and shared company and team memory. Dana's identity is a placeholder, and the displayed answers are publisher examples rather than established execution results.

Assessment & evidence

limitations

The supplied schema includes no Row Level Security policies, and ask() accepts identity and team values as arguments. JWT verification and team lookup appear as future integration steps; onboarding uses placeholders. The page also supplies no implemented mapping from Supabase identities to authorized scopes in hosted MCP sessions. Scope labels and retrieval filters alone do not demonstrate access isolation.

The ingestion caller ignores the status returned by wait_for() and proceeds to mark a row synced even after FAILED or TIMEOUT. A crash after memory submission but before saving the sync marker can also leave the row eligible for resubmission. The timestamp gate therefore does not guarantee successful, once-only ingestion. Updates and deletions of previously synced source rows have no reconciliation path in the example.

The onboarding script queries immediately after an asynchronous personal-memory write without waiting for completion. brain.py also applies project-wide settings during import, so other scripts importing it repeat that update in a new process. Retrieval accuracy, processing latency, scale and production reliability are unassessed; the small published examples establish no benchmark.

reasoning

The architecture suits teams willing to send selected company text to a managed memory service while retaining authoritative source records in Supabase. Its clearest contribution is explaining entity separation and why OR retrieval can combine personal and shared context. Source metadata provides a useful provenance reference, but reliable synchronization and access control require additional application logic. These gaps limit production readiness without removing the guide's value as a concrete architectural example.

alternatives

The page directs readers who want to self-host the vector store toward Mem0's open-source Supabase integration at [https://docs.mem0.ai/components/vectordbs/dbs/supabase]. That linked resource is outside the selected page, so its implementation, requirements and licensing are unassessed. Within this cookbook, direct Python SDK calls and hosted MCP provide two documented ways to access the managed memory service.

evidence

The evidence consists of the complete Mem0 documentation page, including SQL and Python examples, all MCP tabs, production notes and page metadata. It supports the documented architecture and observations about the supplied code. Displayed outputs are publisher illustrations. Nothing was executed, and no independent retrieval, performance or access-isolation results are supplied.

Access & freshness

costs

The page gives no Mem0 or Supabase prices, included usage, billing units, quotas or required subscription tiers. Total operating cost is unknown. It also supplies no cost estimate for hosting the ingestion job or building the surrounding application. Handling extraction without a separate model API key establishes no particular price.

rights

The captured page states no license for the tutorial text or code snippets. It links to [https://github.com/mem0ai/mem0], but repository contents and license terms are outside the supplied evidence. Permission to redistribute or commercially reuse these materials is therefore unknown.

Service terms, data-processing terms, retention guarantees and data-residency commitments are also unspecified. The seeded statement that customer data must remain in the EU is an example company rule; it establishes no hosting location or GDPR assurance for this architecture.

freshness

Page metadata reports modification on 22 September 2026; the supplied capture is dated 25 November 2026. The installation example specifies mem0ai>=2.0.17 and leaves supabase and requests unpinned. These identify the documented dependency requirements, but do not establish the latest releases or compatibility with subsequent SDK, client or hosted-service changes.

actions

For an initial implementation, use synthetic company facts and resolve the Python version mismatch. Verify company, team and personal retrieval boundaries using identities obtained from authenticated Supabase sessions. Production integration needs server-side team validation, Supabase RLS policies and equivalent authorization for MCP access.

Change ingestion to record completion only after confirmed extraction success, retain enough state to recover interrupted jobs, and define how source edits and deletions propagate. Wait for asynchronous personal writes before querying them, and separate project configuration updates from ordinary module imports. Confirm current API behavior, provider pricing, reuse rights and data-handling terms before adopting the design for company information.

Evidence for this report

selected-page.htmlselected · checked 2026-11-25