Self-hosted memory for AI agents with hybrid search, knowledge graphs, tasks, and document sync.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
A self-hosted productivity and knowledge backend for humans and AI agents.
Website Β· Quick start Β· MCP guide Β· REST API Β· Demo
Postgram keeps the data you and your agents work from in one inspectable place: notes, documents, tasks, people, projects, interactions, decisions, and agent memory. Humans use the browser UI and CLI; agents use the same corpus over MCP, REST, or the CLI.
It is more than an agent-memory layer. Postgram preserves typed source objects, supports GTD-style task management and Markdown folder sync, combines full-text and vector retrieval with a knowledge graph, and separates short-lived agent working context from durable memory.
Watch the demo |
Search across memories, documents, people, projects, and tasks |
Postgram is built for one person or a small trusted team running a local or single-VM deployment. It is not a hosted service or a multi-tenant SaaS platform. Knowledge extraction is optional, and the provided Docker Compose setup binds the raw API and UI ports to loopback by default.
You need Git, Docker, and Docker Compose. Node.js 22+ is needed only for local
development or for installing the pgm CLI; gpg is needed only for encrypted
CLI backups.
Clone Postgram:
Choose an embedding path before the first start. For the local default, install and start Ollama on the Docker host, then pull Postgram's default embedding model:
For hosted OpenAI embeddings instead, create a .env file containing a real
key before starting Compose:
Start the stack:
The first run creates persistent Docker volumes for PostgreSQL and
installation secrets. No .env file is required for the default Compose
path.
Read the one-time bootstrap token:
The plaintext appears only in the original first-start logs. Capture it before recreating the API container or discarding those logs.
Open http://127.0.0.1:3000/admin, paste the token, create the first admin, enroll MFA, and follow the onboarding flow.
Confirm the selected provider in the Admin Config tab. If you add or
change staged settings, save, validate, and apply them, then restart
mcp-server when Admin marks a restart as required:
When Ollama runs on the Docker host, its base URL is
http://host.docker.internal:11434. Optional LLM relationship extraction is
disabled by default and can use OpenAI, Anthropic, Ollama, or an
OpenAI-compatible endpoint. Changing the embedding provider, model, or
dimensions after the first start is migration work and is blocked from a
simple config apply.
Check health, then create an API key in the Admin Overview tab. For the
smoke test below, allow read and write, the memory entity type, and
personal visibility:
The response should include "status":"ok" and
"postgres":"connected".
Install the CLI and verify an authenticated write and search. Enrichment is
asynchronous, so wait for pgm queue to report no pending work before the
search:
If embeddings are unreachable, Postgram still starts and accepts writes, but enrichment and search will fail until the provider is available. See the full quick start and troubleshooting guide for the longer path.
For access from ChatGPT, Claude, or another remote MCP client, put Postgram behind HTTPS, enable OAuth, and follow the MCP integration guide. Do not publish the loopback development ports directly to the internet.
Postgram provides:
memory, person, project, task,
interaction, documentpgm) for humans and agentspgm-admin)Postgram is a TypeScript Node.js application built around a service layer.
Main components:
pgvector for persistence and vector searchHigh-level flow:
Store structured knowledge objects with:
type (memory, person, project, task, interaction, document)contenttagsvisibility (personal, work, shared)statusPostgram supports two roles for memory entities:
durable_memory: long-term memory future agents should trust, such as decisions, preferences, constraints, root causes, and completed-work summaries.session_context: working context for resuming recent conversations. Session context is scoped to the calling client, embedded for semantic recall, and skipped by graph extraction.Use session context for "where were we in this thread?" Use durable memory for "what should future agents remember as true?"
CLI users can write session context with pgm memory session-context and search
it with pgm search --memory-role session_context.
Operators can groom stale session context with pgm-admin memory groom.
Use --client-id <client-id> for one client or --all-clients to batch over
every session-context scope. --all-clients keeps each client scope separate;
it is operational batching, not cross-client consolidation.
--older-than <duration> defaults to 7d and accepts values like 30m,
4h, 7d, or 0d. --dry-run previews eligible memories without calling
the LLM. Grooming has no default candidate cap; pass --limit <n> when you
want to process a bounded batch.
--mode archive --yes archives eligible working context directly.
--mode promote --yes uses the configured extraction LLM to decide whether
each session-context memory should be promoted; promoted memories are distilled
into new durable_memory entities, the source context is archived, and
provenance is recorded with metadata.promoted_to plus a promoted_to edge.
Authenticated users and agents can self-groom only their own client-scoped session context:
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/postgram)<a href="https://allmcps.com/mcp/postgram"><img src="https://allmcps.com/api/badge/postgram?style=directory" alt="Postgram on AllMCPs" /></a>