Generated banner for Memorizer
Generated logo for Memorizer

Memorizer

Memory serverOfficial Petabridge project

Created by Dario Griffo

Published in petabridge/memorizer. Publisher page

221 GitHub stars

What it is

Vector-search powered agent memory MCP server
— the description by Dario Griffo

AutoGineer overview, from the brain’s own files

Memorizer is a dedicated memory service designed to give AI agents persistent, long-term storage capabilities. It functions as an MCP server, allowing agents to store, retrieve, and semantically search through structured memories. Built on .NET and PostgreSQL with the pgvector extension, it supports advanced features like versioning, audit trails, relationship mapping for knowledge graphs, and workspace-based organization. It includes a web-based UI for manual management and provides a robust framework for agents to proactively manage their own knowledge base, ensuring that insights and context are preserved across sessions.

How it works

Memory model: Hybrid

AutoGineer overview, from the brain’s own files

Memorizer runs as a service that connects to an AI agent via the Model Context Protocol. It stores data in a PostgreSQL database, utilizing vector embeddings for semantic similarity searches. The system organizes information into workspaces and projects, supports metadata tagging, and tracks version history for all memory entries. Agents interact with the service through a set of defined tools for CRUD operations, metadata updates, and relationship creation, enabling the construction of an interconnected knowledge graph.

Folders
FolderRoleFiles
.githubagent-config4
docsdocs37
scriptsscripts3
srcsource-code195
.configfolder1

The agent writes

Requirements

Databases: PostgreSQL

Works with: Claude Code, OpenCode, Devin (ex-Windsurf)

Set it up

  1. Not scanned by AutoGineerThe author’s README also describes installing it with Docker Compose. Read its install section: AutoGineer did not scan that path. https://github.com/petabridge/memorizer/blob/d3e90fa8d6b50254d65a3ffa3acc35e0204c5c90/README.md#-quick-start-public-image
  2. Created by Dario Griffo. Published in petabridge/memorizer. Licence: MIT License.

Usage

AutoGineer overview, from the brain’s own files

  • Connects to AI agents via the Model Context Protocol (MCP) to provide persistent memory.
  • Enables semantic search to retrieve relevant context based on task descriptions.
  • Supports proactive memory management where agents store, update, and relate information autonomously.
  • Provides a web interface for human users to manage, audit, and organize memory entries.
  • Facilitates knowledge graph construction by creating explicit relationships between memory nodes.
“Search for previous instructions on how to configure the build pipeline.”
The agent queries the memory server using semantic similarity to find relevant 'how-to' notes and returns the specific configuration steps.
“Store this new insight about the project architecture as a reference.”
The agent saves the markdown content to the memory server with appropriate tags and metadata for future retrieval.
“Link this new task to the related project requirements memory.”
The agent creates a relationship edge between the new memory ID and the existing requirements memory ID.

Documentation by Dario Griffo

Memorizer

Image: Docker Pulls Image: GitHub License Image: GitHub Actions Workflow Status Image: GitHub Release

Memorizer is a .NET-based service that allows AI agents to store, retrieve, and search through memories using vector embeddings. It leverages PostgreSQL with the pgvector extension to provide efficient similarity search capabilities.

Image: Memorizer - Memory List

Key features:

  • Workspaces & Projects - Organize memories into hierarchical workspaces and projects with status tracking

  • Store structured memories with vector embeddings

  • Retrieve memories by ID

  • Semantic search through memories using vector similarity

  • Filter search results using tags

  • Edit memory content with automatic versioning and change tracking

  • Update memory metadata (title, type, tags, confidence) independently

  • Revert memories to previous versions with full audit trail

  • Create relationships between memories to form knowledge graphs

  • Web UI for manually adding, editing, deleting, viewing memories, and managing versions

  • Provider Settings - Configure embedding and LLM providers through the UI (Ollama, OpenAI, and compatible APIs)

  • MCP (Model Context Protocol) integration for easy use with AI agents

  • Light & Dark theme support

Image: Memorizer - Workspace Detail

Technologies

  • .NET 10.0

  • PostgreSQL with pgvector extension

  • Model Context Protocol (MCP)

  • ASP.NET Core

  • Akka.NET for background jobs, such as re-embedding memories if you change algorithms

  • Npgsql for PostgreSQL connectivity


📖 Documentation


Installation with Docker

🐳 Quick Start (Public Image)

The easiest way to get started is using the pre-built Docker image and our docker-compose.yml file:

docker-compose up -d

This will:

View the Memorizer Web UI on http://localhost:5000.

🚀 Local Development Builds

If you want to build and run from source:

Prerequisites
  • Docker and Docker Compose

  • .NET 10.0 SDK

1. Build and Publish Local Container
# From solution root directory
# Build and publish the .NET container
dotnet publish -c Release /t:PublishContainer

This creates a container image named memorizer:latest.

2. Start Infrastructure and Application
docker-compose -f docker-compose.local.yml up -d

This starts the same services but uses your locally built image.


Upgrading to Memorizer 2.0

NOTE
The upgrade from Memorizer 1.x to 2.0 is designed to work automatically. All schema migrations run on startup and have been thoroughly tested. Your existing memories will be preserved and continue to work as expected.

CAUTION
We recommend backing up your database before upgrading, as a standard best practice. Memorizer 2.0 runs automatic schema migrations on startup that alter tables and add new columns. While we've tested these migrations extensively, having a backup ensures you can recover in the unlikely event that something goes wrong.

Backup Instructions

NOTE
The container names below (e.g., memorizer-postgres) are based on the default docker-compose.yml. If you've customized your Docker Compose file, adjust the container name accordingly.

Before pulling the new Memorizer 2.0 image, create a PostgreSQL dump of your existing database:

# Create a full database backup
docker exec postgmem-postgres pg_dump -U postgres postgmem > memorizer-backup-$(date +%Y%m%d).sql

# Or use pg_dump with compression
docker exec postgmem-postgres pg_dump -U postgres -Fc postgmem > memorizer-backup-$(date +%Y%m%d).dump

To restore from a backup if needed:

# Restore from SQL dump
docker exec -i postgmem-postgres psql -U postgres postgmem < memorizer-backup-20250207.sql

# Or restore from compressed dump
docker exec -i postgmem-postgres pg_restore -U postgres -d postgmem memorizer-backup-20250207.dump
Updating
# make sure you have created a backup before starting here
git pull
docker-compose down
docker-compose pull memorizer
docker-compose up -d
Breaking Changes in 2.0
  • MCP endpoint moved from / to /mcp. Update your MCP client configurations from http://localhost:5000 to http://localhost:5000/mcp.

  • Web UI moved from /ui to /. The Web UI is now at the root path.

  • New database tables: Workspaces, projects, provider settings, data migrations, and archetype tracking are added automatically on first startup.

  • Existing memories are preserved: All your V1 memories will continue to work. They will appear as "Unfiled" until you organize them into workspaces and projects.

After Upgrading

TIP
Once the upgrade is complete, ask your AI agent to suggest workspaces and projects to organize your existing memories into. Memorizer 2.0's workspace and project system helps you keep memories structured and easy to find - and your agent can analyze your existing memories to recommend a good organizational scheme.


🔌 MCP Configuration Example

To use Memorizer with any MCP-compatible client, add the following to your configuration (e.g., mcp.json):

{
  "memorizer": {
    "url": "http://localhost:5000/mcp"
  }
}

This uses the modern Streamable HTTP transport (MCP spec 2025-03-26+). Note that the MCP endpoint is at /mcp (changed from / in 2.0).


🖥️ Web UI

Memorizer includes a web-based user interface for managing memories through your browser.

Access the Web UI

Once the application is running (via docker-compose up -d), you can access the Web UI at:

http://localhost:5000/

Features
  • Memory Management: Create, view, edit, and delete memories with full CRUD operations

  • Version Control: View version history, compare versions with visual diffs, and revert to previous versions

  • Search & Filter: Search memories using semantic similarity and filter by tags

  • Statistics Dashboard: View memory counts, tag distributions, and system statistics

  • MCP Configuration: Get the MCP configuration JSON for connecting clients at /mcp-config

The Web UI provides a user-friendly interface for all Memorizer functionality, making it easy to manage your AI agent's memory without needing to use the MCP tools directly.


🧠 Example System Prompt for LLMs

IMPORTANT
⚡ Pro Tip: Add this system prompt to your AGENT.md, Cursor Rules files, or any AI agent configuration! This will dramatically improve how often and effectively your LLM uses the Memorizer service for persistent memory management.

You have access to a long-term memory system via the Model Context Protocol (MCP) at the endpoint memorizer. Use the following tools:

Storage & Retrieval:

  • store: Store a new memory. Parameters: type, text (markdown), source, title, tags, confidence, relatedTo (optional, memory ID), relationshipType (optional).

  • searchMemories: Search for similar memories using semantic similarity. Parameters: query, limit, minSimilarity, filterTags.

  • get: Retrieve a memory by ID. Parameters: id, includeVersionHistory, versionNumber.

  • getMany: Retrieve multiple memories by their IDs. Parameter: ids (list of IDs).

  • delete: Delete a memory by ID. Parameter: id.

Editing & Updates:

  • edit: Edit memory content using find-and-replace (ideal for checking off to-do items, updating sections). Parameters: id, old_text, new_text, replace_all.

  • updateMetadata: Update memory metadata (title, type, tags, confidence) without changing content. Parameters: id, title, type, tags, confidence.

Relationships & Versioning:

  • createRelationship: Create a relationship between two memories. Parameters: fromId, toId, type (e.g., 'example-of', 'explains', 'related-to').

  • revertToVersion: Revert a memory to a previous version. Parameters: id, versionNumber, changedBy.

All edits and updates are automatically versioned, allowing you to track changes and revert if needed. Use these tools to remember, recall, edit, relate, and manage information as needed to assist the user.


License

MIT


💖 Attribution

Made with ❤️ by Petabridge

Originally forked from Dario Griffo's postg-mem server

docs/agent-resilient-tool-surface-plan.md

Fix-up plan: agent-resilient MCP tool surface

Status: proposed Owner: TBD Related: #166, #184, #211, #215

Why this exists

After the 2.3.0 deploy, agents began getting opaque An error occurred invoking '<tool>' failures from store and get. We traced it end to end (netclaw session logs → memorizer OTel logs in Seq).

Two separate problem classes surfaced. Only the first is what agents hit in the incident; the second is a real, distinct risk that this plan must not pretend to cover with the same fix.

Class A — argument-binding failures (the incident)

Server-side exceptions in Seq (service = memorizer, 2026-08-20 ~18:31 UTC):

"store" threw an unhandled exception.
System.ArgumentException: The arguments dictionary is missing a value for the
required parameter 'type'.
  at Microsoft.Extensions.AI.AIFunctionFactory.ReflectionAIFunctionDescriptor…GetParameterMarshaller

Root cause: #211 upgraded the MCP SDK (ModelContextProtocol 0.4.0-preview.3 → 2.2.0). The stable SDK marshals tool arguments through AIFunctionFactory and validates before the tool method runs — a missing required parameter (type) or a malformed typed parameter (an unhyphenated 32-hex string for a Guid id) throws at the binder and surfaces as the generic error. The tool code did not change between 2.2.0 and 2.3.0 (byte-identical MemoryTools.cs); only the SDK moved.

This defeated our own resilience work:

  • #166 changed optional Guid? params to string? + Guid.TryParse because "some MCP clients send empty strings or the literal 'null'… causing System.Text.Json to throw before the tool method is ever reached." The required id was left as Guid — the gap now biting.

  • #184 added in-body if (string.IsNullOrWhiteSpace(type)) return "…" checks. These only run if the method is called. The preview SDK delivered loose/missing args to the method; 2.2.0 rejects them at the binder first, so the checks are now dead code.

Timeline (Seq): first binder exception 2026-08-18, none before — i.e. it started with the deploy.

Confirmed failing inputs from the incident:

  • store × 2: missing type (model dropped it on retry).

  • get × 1: dec906c7e5d14abebaf827af5a842ae5 — a netclaw recall id (doc-… prefix stripped), N-format, which Guid binding rejects.

Class B — embedding-layer store failures (separate)

#215 removed the silent random-embedding fallback. Embedding-backend failures now throw EmbeddingGenerationException from StoreMemory, after argument validation, aborting the write. This is correct (it stopped persisting garbage vectors) but it means a healthy, well-formed store call can still fail at the embedding step. The Class A boundary does nothing for this. It needs its own handling (Piece 4).

Design principles

  1. Own the error surface. Never let the SDK author the message. Every rejection returns a memorizer-written, correctable message: what was wrong, why, the expected shape, and a minimal valid example.

  2. Pit of success. The natural, low-effort call an agent makes should be the one that works. Fail correctable, never opaque. Minimize required fields. Be liberal in what you accept (Postel's law).

  3. Require load-bearing fields; default organizational ones. Don't default a field the core function depends on — that silently degrades quality (the same mistake the random-embedding fallback made). Do default metadata that has a safe fallback.

Field policy (the require-vs-default decision)

store should succeed with text alone. The rest default, except title.

FieldRoleVectorized?Decision
textthe memory bodyyes (content embedding)required
titlethe search index — dominates the metadata embedding (embedding_metadata = title + tags) and is prepended to the content embeddingyesrequired, with a teaching error that explains it is what search indexes
typefree-form category / GetByFilter facet; written to type_legacy; not validated against the enumnodefault reference (the MemoryTypeEnum fallback already is reference)
sourceprovenance labelnodefault LLM
confidencescorenodefault 1.0 (already)
archetypedocument (mutable) vs record (immutable)nodefault document (already)

Rationale for keeping title required: metadataText = title (+ tags) is the vector that metadata search and similarity rank on (embedding_metadata <=> @embedding). Deriving a title from the first line of text (e.g. a bash script or JSON blob) would produce a weak/garbage search vector and make the memory unfindable — the same silent-quality-loss failure mode we just removed in #215. Requiring it with a good error guides the agent to write a real, searchable title, which is the correct path and the easy one.

Note: type — the exact field the agent dropped in the incident — is one we can safely default. With a default, that specific store failure does not occur.

The plan

Piece 1 — CallTool validation boundary (own the error)

Register one filter via the 2.2.0 SDK's real seam: IMcpServerBuilder.WithRequestFilters(f => f.AddCallToolFilter(next => …)).

Filter logic (runs for every tool, no per-tool wiring):

  1. Read ctx.Params.Arguments (IDictionary<string, JsonElement>) and the tool's own schema from ctx.MatchedPrimitive (McpServerTool.ProtocolTool.InputSchema).

  2. Validate against the schema: required present, each present value's JSON kind matches the declared type, formats (uuid/enum) parse. This reuses the schema the SDK already emits for ListTools, so validation and contract can't drift.

  3. On failure: return CallToolResult { IsError = true, Content = [TextContentBlock { Text = correctable message }] } without calling next — the SDK marshaller never runs, so it never authors the error.

  4. On success: await next(ctx, ct), wrapped in a backstop try/catch that converts any later exception into an owned, logged message. Nothing opaque escapes, ever.

Message contract lives in one helper so every tool speaks the same format: store: required field 'type' is missing. Provide a string like "document" or "how-to". Minimal call: {"text":"…","type":"document"}.

Piece 2 — Fall-into-success tool ergonomics
  • Defaults per the field-policy table. Make defaulted params nullable-with-default so binding always succeeds and the body fills gaps.

  • title stays required — enforced by the boundary with the teaching error.

  • ID normalization. Add MemoryId.TryParseLoose(string): trim, strip known prefixes (doc-, memory-, a pasted /view/{id} URL), accept N- and D-format via Guid.TryParse. Change get, get_many, delete, edit, revert_to_version, archive, restore from Guid id to string id using it. This extends the #166 pattern (already applied to optional ids) to the required id.

  • Postel. Accept a bare string where string[] is declared (tags, ids), comma/space-delimited lists, case-insensitive type/archetype.

Piece 3 — Agent-shaped regression tests (the guard)

Extend McpServerTests (boots the real app via WebApplicationFactory<Program> against the Testcontainers Postgres + Ollama, drives the real MCP client over Streamable HTTP). Assert graceful, correctable results — not exceptions:

  • store with type omitted → IsError, message names type + example (the literal 18:31 repro).

  • store with only text → succeeds (defaults fill type, source, etc.).

  • store with title omitted → IsError, message explains title is the search index (verifies we did NOT default it).

  • get with N-format id, and with a doc--prefixed id → normalized, returns found/not-found, never a binder error.

  • get with genuine garbage id → correctable "invalid id" message.

  • Parameterized sweep: every tool, omit each required param → never an exception.

  • Tripwire: assert no response text ever equals the SDK's generic "An error occurred invoking …". This is the standing guard that fails the next SDK bump the moment it changes binding behavior — the thing #211 lacked.

  • Verify snapshot of the tool input schemas so drift is a reviewed diff.

Piece 4 — Embedding-failure handling in the store path (Class B)

Decision (implemented): reply to the caller with an honest error in both cases (text-too-long and backend-down). No truncation, no background queue, no changed write semantics — consistent with #215's "never persist a memory that is invisible to search."

  • EmbeddingApiClient now reads the backend's error body on a non-success response (instead of discarding it via EnsureSuccessStatusCode), so the real reason (e.g. Ollama's "the input length exceeds the context length") survives.

  • EmbeddingGenerationException carries Model and InputLength.

  • The CallTool boundary detects an EmbeddingGenerationException (walking the exception chain) and returns ToolErrorMessages.EmbeddingUnavailable: states plainly that nothing was saved and why, reports the input length, classifies too-long vs. backend-unavailable from the backend's text, and passes the backend's own reason through. It no longer gives the misleading "check the arguments" advice for this case.

On "how far over the limit": we cannot tokenize in-process, so we surface the input's character count (always available) and the backend's own error text (which reports the limit when it chooses to). A tokenizer-based estimate was considered and rejected as not consistently reliable across backends.

Deferred follow-up — one-time re-embed audit. Memories written before 2.3.0 may carry random-fallback embeddings (from the fallback #215 removed) and be unfindable by semantic search. The fallback was silent, so we cannot tell which rows are affected from a flag; detection options are (a) re-embed each row and compare to the stored vector (low cosine ⇒ was garbage), which costs the same as just re-embedding, or (b) bulk re-embed everything predating the 2.3.0 deploy via the existing regeneration path. Decision deferred until this write-failure surface has shipped.

Sequencing

  1. Piece 1 + Piece 3 together — converts every opaque arg-binding failure into a correctable one and locks it with the tripwire. Biggest immediate win, no signature changes required beyond the filter.

  2. Piece 2 — defaults + id normalization ergonomics.

  3. Piece 4 — embedding-failure handling (independent; can proceed in parallel).

All server-side in petabridge/memorizer; deploys via the memory-mcp repo, no client change.

260 files · 244 not served here

Advantages

  • Provides persistent, long-term memory that survives agent session resets. evidence: README.md
  • Supports semantic search through vector embeddings, allowing for context-aware retrieval. evidence: README.md
  • Includes full versioning and audit trails for all memory modifications. evidence: README.md
  • Allows for the creation of knowledge graphs by linking related memories. evidence: README.md

Limitations

  • Requires external infrastructure including PostgreSQL with pgvector and an embedding provider. evidence: README.md
  • Requires manual configuration of MCP clients to point to the correct endpoint. evidence: README.md
  • Upgrades may require database backups and potential schema migrations. evidence: README.md

Security

Risk level: No risk found

This brain runs

This brain runs nothing: AutoGineer found no hooks, scripts, plugin code or MCP servers in its files.

Attribution and licence

Created by
Dario Griffo
Publisher
Petabridge (Official Petabridge project)
Source
petabridge/memorizer · commit d3e90fa
Licence
MIT License (files served here)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Dario Griffo or Petabridge.

Install from source

244 of its files are not served here, so there is no ZIP. petabridge/memorizer at d3e90fa