coopers98/mnemon
Mnemon is a lightweight memoization and in-memory caching helper for Laravel and PHP. It lets you store expensive computed values and reuse them within a request, cutting repeated work with a simple, expressive API.
require. It bundles the four components every "our agents should remember things" ticket eventually becomes: a verbatim store (palace: wings → rooms → drawers), hybrid retrieval (pgvector + Postgres full-text + recency boost), a compiled human-readable layer (wiki), and an MCP server with OAuth on top. Adopting it replaces a multi-month infrastructure build with an integration task.POST /mcp, plus a Claude Code plugin with three hooks (session-start injection, per-prompt context, end-of-session digest). This is a working reference implementation for what "MCP-native" looks like in practice — useful when scoping your own roadmap.mcp:use scope, and wing restrictions set at the consent screen and stored per OAuth client. Restricted tokens cannot read, search, count, or write another wing's content; hidden items read identically to missing ones. This is a stronger privacy posture than most agent-memory tools ship with, and it directly informs whether you can let third-party MCP clients touch tenant data.context_set still rebuilds wiki-wide index/log pages, session_digest replays keyed by session not device, wiki does not self-maintain (auto-compile-stale only reports), no streaming transport, 1h access / 90d refresh tokens.DOMAIN, TRUSTED_PROXIES for reverse proxies (explicitly not tested end to end), and plugin auto-update enabled by the install script (off by default for third-party marketplaces). Each is a decision about how much you operate vs. hand to users.Consider it when:
ollama embedding driver mean you can run the whole thing with no external account and no egress for embeddings./mnemon:doctor diagnostic that tells a user what to fix instead of making them file a ticket.Look elsewhere when:
To executives: We have a recurring, expensive ask across our agent products — persistent memory. Mnemon is a deployable implementation of that entire layer: verbatim storage, hybrid retrieval, a compiled wiki for humans, and a standards-based (MCP) interface that Claude, Cursor, and ChatGPT can already talk to. It ships with a real benchmark rather than a claim: enabling embeddings moves retrieval hit-rate@1 from 0.742 to 0.886 and answer accuracy from 0.557 to 0.627 on a 500-question public eval. It runs keyless and offline for a zero-cost trial, there's a read-only demo with sample data, and the test suite is 697 passing with Postgres 17 in CI. The ask is a time-boxed pilot, not a platform commitment.
To engineering: Adopt as an application, not a dependency — this is a Laravel app you deploy and own. You get Laravel Passport doing OAuth 2.1 with Dynamic Client Registration and device grant, a mcp:use scope, wing-level restrictions persisted per OAuth client, 14 MCP tools over Streamable HTTP, Filament v5 for admin, and a Compose stack that binds to loopback by default. A Claude Code plugin wires session-start injection, per-prompt context, and end-of-session digesting through three hooks, with a /mnemon:doctor command that diagnoses tools, config, token, reachability, and a live tool call. Real constraints to plan around: Postgres + pgvector is required for semantic search, the system is single-tenant with no admin/user separation, tokens are 1h access / 90d refresh, there is no streaming transport, and wiki pages are scoped by name rather than by source — so treat wiki-derived sharing as a design topic, not a solved one.
To security and legal: Self-hosted, loopback-bound by default, optional automatic HTTPS via DOMAIN, and an embedding path (ollama) that keeps everything on-premises. Access is scope-limited and wing-restricted at the consent screen, and a hidden drawer or page is indistinguishable from a missing one. The documented exceptions are narrow but real: name-addressed wiki scoping, wiki_lint auto-fix needing an unrestricted token, and context_set rebuilding wiki-wide index/log pages. We should pilot with a non-sensitive corpus first and let those specific behaviors be validated before anything regulated touches it.
Recommended motion: Two-week pilot, one team, one instance, non-critical knowledge base, embeddings enabled (not keyless), and a scorecard built on our corpus against the published keyless/embedded baseline. Go/no-go on: retrieval quality on our queries, operational burden of running the stack, and whether the wiki scoping behavior is acceptable for our sharing model.
How can I help you explore Laravel packages today?