Generated banner for Pensyve
Generated logo for Pensyve

Pensyve

Memory serverOfficial Major 7 Apps LLC project

Created by Major 7 Apps LLC

Published in major7apps/pensyve. Publisher page

100 GitHub stars

What it is

Universal memory runtime for AI agents
— the description by Major 7 Apps LLC

AutoGineer overview, from the brain’s own files

Pensyve is an open-source memory runtime designed to provide AI agents with persistent, cross-session recall. It functions as a memory layer that stores facts, conversations, observations, and action outcomes outside of the language model itself. The system is built in Rust and utilizes SQLite for local storage, with optional PostgreSQL support. It supports semantic search via locally run embedding models and provides multiple interfaces, including a Python SDK, an MCP server for integration with tools like Claude Code and Cursor, and an HTTP gateway for REST-based access. Pensyve is designed to be self-hosted, requiring no external accounts or API keys for local operation.

How it works

Memory model: Hybrid

AutoGineer overview, from the brain’s own files

Pensyve operates as a memory server that stores data in a local SQLite database or a PostgreSQL instance. It organizes information into four categories: facts (semantic memory), conversations (episodic memory), action outcomes (procedural memory), and observations. The system uses embedding models to enable semantic search across these records. Agents interact with Pensyve through various SDKs or the MCP protocol to save and retrieve information, which is then injected into the agent's prompt to provide context across different sessions and processes.

Folders
FolderRoleFiles
.githubagent-config10
docsdocs15
scriptsscripts3
teststests11
.agentsfolder1
.claude-pluginfolder1
benchmarksfolder8
integrationsfolder324
loadtestfolder3
pensyve-benchmarksfolder17
pensyve-clifolder3
pensyve-corefolder90
pensyve-gofolder10
pensyve-mcpfolder6
pensyve-mcp-gatewayfolder36
pensyve-mcp-toolsfolder5
pensyve-pythonfolder19
pensyve-tsfolder11
pensyve-wasmfolder4
pensyve_serverfolder3
resultsfolder6

Requirements

Runtimes: Python >=3.10, Rust

Databases: PostgreSQL, SQLite

Works with: Claude Code, OpenAI Codex, GitHub Copilot, Cursor, Kiro, OpenCode, Amp, Cline, JetBrains Junie, Devin (ex-Windsurf)

Set it up

  1. This brain runs code automatically: 8 hooks (claude-code, codex). Review integrations/claude-code/hooks/hooks.json, integrations/codex-plugin/hooks/hooks.json before opening the folder in Claude Code. No step below turns a hook on for you.

    • integrations/claude-code/hooks/hooks.json: cat "${CLAUDE_PLUGIN_ROOT}/hooks/session-start.md"
    • integrations/claude-code/hooks/hooks.json: cat "${CLAUDE_PLUGIN_ROOT}/hooks/post-tool-write-edit.md"
    • integrations/claude-code/hooks/hooks.json: cat "${CLAUDE_PLUGIN_ROOT}/hooks/post-tool-bash.md"
    • integrations/claude-code/hooks/hooks.json: cat "${CLAUDE_PLUGIN_ROOT}/hooks/pre-compact.md"
    • integrations/claude-code/hooks/hooks.json: cat "${CLAUDE_PLUGIN_ROOT}/hooks/stop.md"
    • integrations/claude-code/hooks/hooks.json: cat "${CLAUDE_PLUGIN_ROOT}/hooks/user-prompt-submit.md"
    • integrations/codex-plugin/hooks/hooks.json: cat "${PLUGIN_ROOT}/hooks/session-start.md"
    • integrations/codex-plugin/hooks/hooks.json: cat "${PLUGIN_ROOT}/hooks/user-prompt-submit.md"
  2. Not scanned by AutoGineerThe author’s MCP configuration (README.md) also starts it in a way AutoGineer does not offer. Read that file: AutoGineer did not scan that path; what it runs is listed under “This brain runs”. https://github.com/major7apps/pensyve/blob/d2c56fa44d1ee7b2d504f0008c6b9c860bc7d25f/README.md
  3. Not scanned by AutoGineerThe author’s MCP configuration (smithery.yaml) also starts it in a way AutoGineer does not offer. Read that file: AutoGineer did not scan that path; what it runs is listed under “This brain runs”. https://github.com/major7apps/pensyve/blob/d2c56fa44d1ee7b2d504f0008c6b9c860bc7d25f/smithery.yaml
  4. Not scanned by AutoGineerThe author’s README also describes installing it as the PyPI package pensyve. Read its install section: AutoGineer did not scan that path. https://github.com/major7apps/pensyve/blob/d2c56fa44d1ee7b2d504f0008c6b9c860bc7d25f/README.md#python-quick-start
  5. Not scanned by AutoGineerThe author also offers a container image (ghcr.io/major7apps/pensyve-mcp:5.0.0). https://github.com/major7apps/pensyve/tree/d2c56fa44d1ee7b2d504f0008c6b9c860bc7d25f
  6. Created by Major 7 Apps LLC. Published in major7apps/pensyve. Licence: Apache License 2.0.

Usage

AutoGineer overview, from the brain’s own files

  • Add persistent memory to Python-based AI agents using the Python SDK.
  • Connect AI coding assistants like Claude Code, Cursor, or Codex to a shared memory store via the MCP server.
  • Share a centralized memory store across multiple services using the HTTP gateway.
  • Integrate with LangChain or LangGraph frameworks for enhanced agent memory capabilities.
  • Perform semantic search and retrieval of past conversations or facts via the command-line interface.
“Save a fact about the user's preference for dark mode.”
The agent stores the fact in the local SQLite database, allowing it to recall this preference in future sessions.
“Recall previous editor settings for the current project.”
The agent retrieves relevant facts or conversation history from the memory store and uses them to inform its current task.

Documentation by Major 7 Apps LLC

Image: Pensyve logo

Pensyve

Image: CI Image: License: Apache 2.0 Image: Python 3.10+ Image: Rust 1.94+

Pensyve is an open-source runtime for persistent AI agent memory. It stores facts, conversations, observations, and action outcomes so an agent can retrieve them in later sessions. You can use it through Python, a Model Context Protocol (MCP) server, a command-line tool, or a REST API.

The Rust engine uses SQLite for local storage and runs embedding models locally to search by meaning. TypeScript and Go clients connect to a gateway you run yourself. Local use does not require a Pensyve account or API key. Your application or client integration calls Pensyve to save and retrieve memories.

Choose a setup

Use caseStart here
Add persistent memory to a Python agentPython quick start
Give Claude Code, Cursor, or Codex access to memory toolsMCP server and client setup guides
Share a memory store through TypeScript, Go, or RESTHTTP gateway
Use a LangChain or LangGraph adapterPython integration or TypeScript integration

Project status

Pensyve Cloud closed on October 1, 2026. The open-source project continues in this repository under the Apache 2.0 license, with the engine, SDKs, integrations, and documentation available here.

Pensyve is in maintenance mode. Releases cover security fixes and dependency updates, with no new features planned. See the maintenance policy for contribution and support expectations. If you have a saved Cloud export, the self-hosting guide explains how to use it with your own gateway.

What you can do

  • Store facts about users, projects, or other named entities, and record conversations as episodes.

  • Search memories using text matching, embeddings, and relationships between entities.

  • Record observations and action outcomes, and use consolidation to promote repeated facts and update memory retention.

  • Keep data in local SQLite storage, or run the HTTP gateway with SQLite or PostgreSQL.

Embedding models may download when first loaded unless they are already cached. Running without network access requires preparing the model files first. See the model setup and deployment guide.

How agent memory works

Pensyve stores memory outside the language model. Your application saves facts or conversations, searches for relevant records, and adds the results to a later prompt. Reusing the same storage path and namespace lets the agent retrieve information across processes and sessions. Saving a memory does not train the language model or change its weights.

The store holds four kinds of records: facts (semantic memory), conversations (episodic memory), action outcomes (procedural memory), and observations. Your integration decides what to record and when to retrieve it. Recording a conversation does not automatically turn it into a successful procedure. See how storage and retrieval work and the usage recipes for the APIs and their limits.

Python quick start

Python 3.10 or newer is required.

pip install pensyve

Create a local store, save a fact, and retrieve it:

import pensyve

p = pensyve.Pensyve(path="./memories", namespace="my-agent")
user = p.entity("user", kind="user")

p.remember(
    entity=user,
    fact="Prefers dark mode and vim keybindings",
    confidence=0.95,
)

for memory in p.recall("editor preferences", entity=user):
    print(memory.content)

Reuse the same path and namespace in a later process to retrieve saved memories. The Python SDK runs the engine in your process and does not need the HTTP gateway.

You can also record a conversation with the same p and user:

with p.episode(user) as episode:
    episode.message("user", "Use dark mode in my editor")
    episode.message("agent", "I updated the editor settings")
    episode.outcome("success")

groups = p.recall_grouped("editor settings", limit=10)
for group in groups:
    for memory in group.memories:
        print(memory.content)

recall_grouped() groups results by source session for use in an agent's prompt. See the Python SDK guide and recipes for more examples.

MCP server

Pensyve's local MCP memory server lets clients such as Claude Code, Codex, and Cursor store and retrieve memories across sessions. From a checkout of this repository, install the server with Rust 1.94 or newer:

git clone https://github.com/major7apps/pensyve.git
cd pensyve
cargo install --path pensyve-mcp --locked

Make sure Cargo's binary directory is on your client's PATH, then add a stdio server entry to its MCP configuration:

{
  "mcpServers": {
    "pensyve": {
      "command": "pensyve-mcp",
      "args": ["--stdio"],
      "env": {
        "PENSYVE_NAMESPACE": "my-project"
      }
    }
  }
}

The server provides tools such as pensyve_remember, pensyve_recall, pensyve_observe, and pensyve_inspect. It stores data locally and needs no API key. The configuration file location depends on your client. See the MCP setup guide and integration guides.

HTTP gateway

Run the gateway to access Pensyve over REST or MCP HTTP, including from the TypeScript and Go SDKs. From the repository root, start a local instance:

HOST=127.0.0.1 PENSYVE_API_KEYS=psy_local_example \
  cargo run --release -p pensyve-mcp-gateway

In another terminal, save and recall a fact:

curl http://localhost:3000/v1/remember \
  -H "Authorization: Bearer psy_local_example" \
  -H "Content-Type: application/json" \
  -d '{"entity":"user","fact":"Prefers Python","confidence":0.95}'

curl http://localhost:3000/v1/recall \
  -H "Authorization: Bearer psy_local_example" \
  -H "Content-Type: application/json" \
  -d '{"query":"programming language","entity":"user"}'

The MCP HTTP endpoint is http://localhost:3000/mcp. Use the same API key in your client's Authorization: Bearer header.

The example key is for local testing. For a deployment, choose your own key with the required psy_ prefix and configure HTTPS and allowed hosts. See the self-hosting guide, gateway configuration, and security documentation.

SDKs and integrations

The TypeScript and Go SDKs require a running gateway. Configure its URL and, when authentication is enabled, an API key from that gateway.

InterfaceInstallation or guide
Pythonpip install pensyve, SDK guide
TypeScriptnpm install @pensyve/sdk, SDK guide
Gogo get github.com/major7apps/pensyve/pensyve-go/v5@latest, SDK guide
Claude CodePlugin setup
CursorMCP setup and rules
CodexPlugin setup
LangChain and LangGraphPython adapter, TypeScript adapter
Other clients and frameworksIntegration index

Command-line tool

From the repository root, install the CLI and inspect its commands:

cargo install --path pensyve-cli --locked
pensyve --help
pensyve status
pensyve recall "editor preferences" --entity user

The binary is named pensyve. Its default output is JSON, and --format text selects text output. The CLI uses its own default local storage location; it does not automatically open the ./memories directory from the Python example. See the CLI source and command definitions for storage and namespace options.

Documentation

GuideContents
Documentation indexChoose a setup, find API guides, and identify historical plans
Getting startedSetup by client or SDK
Self-hostingGateway deployment, model files, backups, and saved Cloud exports
RecipesRecall, facts, episodes, observations, and other API examples
ArchitectureStorage, retrieval, and component boundaries
SecurityAuthentication, namespace isolation, and execution limits
ReliabilityTests and runtime guarantees
ChangelogRelease history and breaking changes

Development and contributions

Start with CONTRIBUTING.md for prerequisites and setup. From the repository root:

uv sync --extra dev
make build
make check

make build compiles Rust and builds the Python extension. make check runs the Rust and Python lint and test commands. TypeScript and Go have separate checks documented in the contribution guide.

Issues and pull requests follow the maintenance policy. Report security issues through private vulnerability reporting.

License

Pensyve is licensed under Apache 2.0.

512 files · 482 not served here

Advantages

  • Provides persistent, cross-session memory that functions independently of the language model's training. evidence: README.md
  • Supports multiple integration methods including Python, MCP, and REST API for flexibility across different agent architectures. evidence: README.md

Limitations

  • Embedding models may require initial download, and running without network access requires pre-caching model files. evidence: README.md
  • The project is in maintenance mode, meaning no new features are planned, with updates limited to security and dependency maintenance. evidence: README.md

Security

Risk level: No risk found

This brain runs

Agent instructions that run or fetch something (48)

  • AGENTS.md: **`README.md`** — overview, install, quick-start examples.
  • AGENTS.md: **`docs/GETTING_STARTED.md`** — first-run walkthrough for new contributors.
  • AGENTS.md: make build # Full build (Rust + PyO3 into .venv)
  • AGENTS.md: make test # Rust + Python tests
  • AGENTS.md: make lint # clippy --workspace + ruff check + pyright
  • AGENTS.md: make format # cargo fmt + ruff format
  • AGENTS.md: make check # Rust + Python lint and tests; run SDK checks separately
  • AGENTS.md: .venv/bin/pytest tests/python/ -v # Python tests (requires `make build` first)
  • AGENTS.md: cargo run -p pensyve-mcp-gateway # HTTP gateway (port 3000)
  • AGENTS.md: cargo run -p pensyve-cli -- recall "q" # CLI
  • AGENTS.md: cargo run -p pensyve-mcp # MCP stdio server
  • AGENTS.md: Python env setup: `uv sync --extra dev && uv run maturin develop --manifest-path pensyve-python/Cargo.toml`
  • AGENTS.md: Use `git add` with specific filenames.
  • AGENTS.md: Run `make check` before pushing.
  • integrations/antigravity-plugin/skills/context-loader/SKILL.md: If the user explicitly opts into cross-entity discovery, run targeted recall queries with `types: ["episodic", "procedural", "semantic"]`, `limit: 5`, and label the results as top matches ranked by relevance/RRF score.
  • integrations/antigravity-plugin/skills/memory-informed-refactor/SKILL.md: Run multiple `pensyve_recall` queries to gather comprehensive context about the target within the shared recall budget:
  • integrations/antigravity-plugin/skills/memory-review/SKILL.md: If no entity is specified, run a broad `pensyve_recall` query with `"*"` (limit: 50) to discover entities, then inspect the top entities found.
  • integrations/antigravity-plugin/skills/session-memory/SKILL.md: Then run `pensyve_recall` with a query matching the sanitized candidate fact.
  • integrations/claude-code/skills/context-loader/SKILL.md: Run the following `pensyve_recall` queries to gather session context:
  • integrations/claude-code/skills/memory-informed-design/SKILL.md: If the design process revealed a reusable way to evaluate similar decisions (e.g., "run spike vs.
  • integrations/claude-code/skills/memory-informed-longitudinal-work/SKILL.md: | What you learned | Type | Example | |---|---|---| | Per-run outcome (what this run showed) | episodic | "Run N+1: V7r accuracy improved +3.5% with new threshold" | | Stable truth about the system | semantic | "Haiku classifier plateaus above temp 0.3" | | Reusable experiment procedure …[+83 chars]
  • integrations/claude-code/skills/memory-informed-longitudinal-work/SKILL.md: When a run ends with an unresolved question ("X improved but we don't know why"), capture it as an episodic observation with open-question provenance:
  • integrations/claude-code/skills/memory-informed-longitudinal-work/SKILL.md: Before Stop fires, briefly summarize (inline, 3-5 lines): what this run taught us vs.
  • integrations/claude-code/skills/memory-informed-refactor/SKILL.md: Run multiple `pensyve_recall` queries to gather comprehensive context about the target:
  • integrations/claude-code/skills/memory-review/SKILL.md: If no entity is specified, run a broad `pensyve_recall` query with `"*"` (limit: 50) to discover entities, then inspect the top entities found.
  • integrations/claude-code/skills/memory-review/SKILL.md: **Consolidation**: Suggest running `/consolidate` (this skill does not run consolidation directly).
  • integrations/claude-code/skills/session-memory/SKILL.md: Before storing, run `pensyve_recall` with a query matching the candidate fact to check for duplicates.
  • integrations/codex-plugin/AGENTS.md: | What you learned | Type | Call | |---|---|---| | Per-run outcome | episodic | `pensyve_observe(..., content: "[proactive/in-flight/tier-1] Run N+1: ...", source_entity: "codex", about_entity: <entity>, content_type: "text")` | | Stable truth | semantic | `pensyve_remember(entity, fac …[+280 chars]
  • integrations/codex-plugin/AGENTS.md: Before wrapping: summarize what this run taught vs.
  • integrations/codex-plugin/skills/context-loader/SKILL.md: Run the following `pensyve_recall` queries to gather session context:
  • integrations/codex-plugin/skills/memory-informed-refactor/SKILL.md: Run multiple `pensyve_recall` queries to gather comprehensive context about the target:
  • integrations/codex-plugin/skills/memory-review/SKILL.md: If no entity is specified, run a broad `pensyve_recall` query with `"*"` (limit: 50) to discover entities, then inspect the top entities found.
  • integrations/codex-plugin/skills/session-memory/SKILL.md: Before storing, run `pensyve_recall` with a query matching the candidate fact to check for duplicates.
  • integrations/hermes/AGENTS.md: | What you learned | Type | Call | |---|---|---| | Per-run outcome | episodic | `pensyve_observe(..., content: "[proactive/in-flight/tier-1] Run N+1: ...", source_entity: "hermes", about_entity: <entity>, content_type: "text")` | | Stable truth | semantic | `pensyve_remember(entity, fa …[+282 chars]
  • integrations/hermes/AGENTS.md: Before wrapping: summarize what this run taught vs.
  • integrations/openclaw-plugin/AGENTS.md: | What you learned | Type | Call | |---|---|---| | Per-run outcome | episodic | `pensyve_observe(..., content: "[proactive/in-flight/tier-1] Run N+1: ...", source_entity: "openclaw", about_entity: <entity>, content_type: "text")` | | Stable truth | semantic | `pensyve_remember(entity, …[+286 chars]
  • integrations/openclaw-plugin/AGENTS.md: Before wrapping: summarize what this run taught vs.
  • integrations/opencode-plugin/AGENTS.md: | What you learned | Type | Call | |---|---|---| | Per-run outcome | episodic | `pensyve_observe(..., content: "[proactive/in-flight/tier-1] Run N+1: ...", source_entity: "opencode", about_entity: <entity>, content_type: "text")` | | Stable truth | semantic | `pensyve_remember(entity, …[+286 chars]
  • integrations/opencode-plugin/AGENTS.md: Before wrapping: summarize what this run taught vs.
  • pensyve-ts/CLAUDE.md: Use `bun <file>` instead of `node <file>` or `ts-node <file>`
  • pensyve-ts/CLAUDE.md: Use `bun test` instead of `jest` or `vitest`
  • pensyve-ts/CLAUDE.md: Use `bun build <file.html|file.ts|file.css>` instead of `webpack` or `esbuild`
  • pensyve-ts/CLAUDE.md: Use `bun install` instead of `npm install` or `yarn install` or `pnpm install`
  • pensyve-ts/CLAUDE.md: Use `bun run <script>` instead of `npm run <script>` or `yarn run <script>` or `pnpm run <script>`
  • pensyve-ts/CLAUDE.md: Use `bunx <package> <command>` instead of `npx <package> <command>`
  • pensyve-ts/CLAUDE.md: Use `bun test` to run tests.
  • pensyve-ts/CLAUDE.md: Then, run index.ts
  • pensyve-ts/CLAUDE.md: bun --hot ./index.ts

MCP servers (2)

  • README.md (pensyve): pensyve-mcp --stdio
  • integrations/codex-plugin/.mcp.json (pensyve): pensyve-mcp --stdio

Hooks (8)

  • integrations/claude-code/hooks/hooks.json (SessionStart): cat "${CLAUDE_PLUGIN_ROOT}/hooks/session-start.md"
  • integrations/claude-code/hooks/hooks.json (PostToolUse): cat "${CLAUDE_PLUGIN_ROOT}/hooks/post-tool-write-edit.md"
  • integrations/claude-code/hooks/hooks.json (PostToolUse): cat "${CLAUDE_PLUGIN_ROOT}/hooks/post-tool-bash.md"
  • integrations/claude-code/hooks/hooks.json (PreCompact): cat "${CLAUDE_PLUGIN_ROOT}/hooks/pre-compact.md"
  • integrations/claude-code/hooks/hooks.json (Stop): cat "${CLAUDE_PLUGIN_ROOT}/hooks/stop.md"
  • integrations/claude-code/hooks/hooks.json (UserPromptSubmit): cat "${CLAUDE_PLUGIN_ROOT}/hooks/user-prompt-submit.md"
  • integrations/codex-plugin/hooks/hooks.json (SessionStart): cat "${PLUGIN_ROOT}/hooks/session-start.md"
  • integrations/codex-plugin/hooks/hooks.json (UserPromptSubmit): cat "${PLUGIN_ROOT}/hooks/user-prompt-submit.md"

Attribution and licence

Created by
Major 7 Apps LLC
Declared authors
  • Major7 Apps (declared in pyproject.toml)
Publisher
Major 7 Apps LLC (Official Major 7 Apps LLC project)
Source
major7apps/pensyve · commit d2c56fa
Licence
Apache License 2.0 (files served here)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Major 7 Apps LLC.

Install from source

482 of its files are not served here, so there is no ZIP. major7apps/pensyve at d2c56fa