agentleFS
major7appsmajor7apps/pensyve/AGENTS.md

pensyve

AGENTS.md101 starsChanged 6 months agoApache-2.0View on GitHub

Canonical agent entry point for the pensyve open-source repo. Shared by Claude Code, Codex, Cursor, Aider, and any other agentic harness. CLAUDE.md is a thin pointer to this file. Pensyve is an Apache 2.0 memory runtime for AI agents. The repository contains the Rust engine, Python/TypeScript/Go SDKs, MCP server, HTTP gateway, CLI, and integrations. SQLite is the default storage backend, and PostgreSQL support is available through the core's postgres feature. Pensyve Cloud closed on October 1, 2026. The project runs…

  • Reads credentials
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 33,398 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository3 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Do not commit secrets, API keys, or .env files.

    line 79
  2. Distinctive:

    Do not break the public API surface without a deprecation cycle — unless the old API is itself the defect.

    line 80
  3. Very specific:

    Do not regress test counts (274+ across Rust/Python/TypeScript/Go).

    line 87
  4. Very specific:

    Run make check before pushing.

    line 89
  5. Very specific:

    All three variables are resolved in pensyve_core::snapshot and apply the same way to the MCP stdio server, the gateway, and the Python …

    line 117

≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

pensyve — AGENTS.md

Canonical agent entry point for the pensyve open-source repo. Shared by Claude Code, Codex, Cursor, Aider, and any other agentic harness. CLAUDE.md is a thin pointer to this file.

What this repo is

Pensyve is an Apache 2.0 memory runtime for AI agents. The repository contains the Rust engine, Python/TypeScript/Go SDKs, MCP server, HTTP gateway, CLI, and integrations. SQLite is the default storage backend, and PostgreSQL support is available through the core's postgres feature.

Pensyve Cloud closed on October 1, 2026. The project runs locally or on an operator's own server and is in maintenance mode. Read MAINTENANCE.md for the release and contribution policy. Current setup instructions must use the public documentation in this repository and must not depend on the retired hosted service.

Start here

  1. README.md — overview, install, quick-start examples.
  2. CONTRIBUTING.md — dev environment setup, testing, submitting changes.
  3. docs/GETTING_STARTED.md — first-run walkthrough for new contributors.
  4. docs/ARCHITECTURE.md — system architecture, data flow, module boundaries.
  5. docs/RECIPES.md — common task patterns (recall, remember, episodes, multimodal).
  6. docs/SECURITY.md — authentication, RBAC, tenant isolation, execution bounds.
  7. docs/RELIABILITY.md — test suite, performance, memory model guarantees.
  8. docs/guides/ — per-integration user guides (e.g. docs/guides/openclaw.md).

Directory map

PathPurpose
pensyve-core/Rust rlib — storage, embedding, retrieval, graph, decay, consolidation, observability, mesh
pensyve-python/Rust cdylib (PyO3) — Python SDK (import pensyve)
pensyve-mcp/Rust binary — MCP stdio server
pensyve-mcp-tools/Rust rlib — shared MCP tool definitions (stdio + HTTP gateway)
pensyve-mcp-gateway/Rust binary — self-hostable HTTP gateway (REST + MCP on port 3000)
pensyve-cli/Rust binary — pensyve CLI
pensyve-benchmarks/Rust bench harness
pensyve-ts/TypeScript HTTP SDK (bun)
pensyve-go/Go HTTP SDK
pensyve-wasm/Rust cdylib (wasm-bindgen) — browser/edge variant (not in workspace)
integrations/vscode/VS Code extension
integrations/claude-code/Claude Code marketplace plugin
pensyve_server/Python utilities (usage quotas, Tier 2 extraction) — NOT a standalone server
integrations/Framework adapters (LangChain, CrewAI, etc.)
benchmarks/LongMemEval + tuning harnesses
tests/python/Python integration tests
docs/Long-form documentation

Build & dev commands

make build    # Full build (Rust + PyO3 into .venv)
make test     # Rust + Python tests
make lint     # clippy --workspace + ruff check + pyright
make format   # cargo fmt + ruff format
make check    # Rust + Python lint and tests; run SDK checks separately

Per-component:

cargo test -p pensyve-core              # Single Rust crate
cargo build -p pensyve-core --features postgres  # Postgres feature
.venv/bin/pytest tests/python/ -v       # Python tests (requires `make build` first)
cd pensyve-ts && bun test               # TypeScript SDK
cd pensyve-go && go test ./...          # Go SDK
cd pensyve-wasm && cargo check          # WASM (standalone, not in workspace)
cargo run -p pensyve-mcp-gateway        # HTTP gateway (port 3000)
cargo run -p pensyve-cli -- recall "q"  # CLI
cargo run -p pensyve-mcp               # MCP stdio server

Python env setup: uv sync --extra dev && uv run maturin develop --manifest-path pensyve-python/Cargo.toml

Hard rules

  • Do not commit secrets, API keys, or .env files. Use git add with specific filenames.
  • Do not break the public API surface without a deprecation cycle — unless the old API is itself the defect. A deprecation cycle assumes the old entry point still works and is merely superseded. When it cannot be called safely at all (an unscoped deletion that has no namespace to scope to, a documented-but-inert safety switch), keeping it for a release ships the defect with a compiler warning as its only mitigation. Break it, bump the major version at release prep, and call it out in the release notes. Do not add a fail-closed shim that errors at runtime: for a trait downstream code implements, that turns a build failure into a production one. Precedent: PRs #247, #253, #259 (2026-08-16).
  • Do not regress test counts (274+ across Rust/Python/TypeScript/Go). New code adds tests.
  • Match existing style: Rust edition 2024, MSRV 1.94, clippy pedantic. Python ruff (line-length 100), pyright basic. TypeScript eslint. Go go vet, stdlib only.
  • Run make check before pushing. CI runs the same gate.

Conventions

  • UUIDs as TEXT in SQLite (native UUID in Postgres), embeddings as BLOB, metadata as JSON TEXT (JSONB in Postgres).
  • PyO3 module compiles to pensyve._core — stubs at pensyve-python/python/pensyve/_core.pyi.
  • Episode IDs are UUID v4 strings; 30-minute TTL in the REST API.
  • Auth opt-in via PENSYVE_API_KEYS (open only when it, PENSYVE_VALIDATION_URL, and OAUTH_PUBLIC_KEY are all unset).
  • Rust: edition 2024, 100-char line width, 4-space indent. Python: ruff rules E/W/F/I/N/UP/B/SIM/RUF.
  • conftest.py at project root adds the project root to sys.path for test imports.

Environment variables

VariableDefaultPurpose
PENSYVE_PATH~/.pensyve/SQLite database path
PENSYVE_NAMESPACEdefaultMemory namespace
PENSYVE_API_KEYS(unset)Comma-separated API keys for auth
DATABASE_URL(unset)Postgres connection string (optional)
REDIS_URL(unset)Redis for caching, rate limiting, and daily quota enforcement (optional)
PENSYVE_SNAPSHOT_RETENTION_DAYS30How long a forget pre-delete snapshot is kept; 0 disables the age bound; maximum 36500
PENSYVE_SNAPSHOT_MAX_PER_NAMESPACE50How many snapshots one namespace keeps; 0 disables the count bound; maximum 1000000
PENSYVE_SNAPSHOT_DIR<storage_root>/snapshotsRoot directory for forget pre-delete snapshots

The two retention bounds apply per namespace to the pre-delete snapshot store (<storage_root>/snapshots, overridable with PENSYVE_SNAPSHOT_DIR) that makes entity-wide forget recoverable. Setting both to 0 keeps every snapshot forever, which is how the store behaved before #265.

Both bounds are clamped. A value above its maximum (36500 days, 1000000 snapshots), or one that is not a whole number, is rejected: the server logs a warning naming the value and uses the default instead. It does not use the maximum, and it does not disable the bound. 0 is the only way to turn a bound off.

All three variables are resolved in pensyve_core::snapshot and apply the same way to the MCP stdio server, the gateway, and the Python SDK's Pensyve.forget.

When in doubt

README.md for the project pitch, CONTRIBUTING.md for how to contribute, docs/ARCHITECTURE.md for engine internals.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.