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.
Mnemon is not a composer require library — it is a self-hosted Laravel application (Passport for OAuth, Filament v5 for admin) that you run as a service and talk to over MCP. Budget accordingly: you are deploying infrastructure, not adding a trait.
/wiki and /palace before you install anything — it is the fastest way to understand wings → rooms → drawers (verbatim, append-only) versus wiki pages (compiled, typed markdown, staleness-tracked).docker compose up -d. It binds to loopback by default, so nothing is exposed until you deliberately change it. Set DOMAIN only when you want the optional automatic HTTPS.MNEMON_EMBEDDING_DRIVER=none, so no OpenAI account and no spend. Search degrades to full-text plus recency — good enough to validate the workflow, not good enough to judge retrieval quality (see Gotchas).docs/USERGUIDE.md → the Limitations section. The limitations list is unusually honest and several items (wiki scoping by page name, single-tenant admin) affect design decisions you make on day one.curl -fsSL https://<your-instance>/install | bash, then run /mnemon:doctor. That command checks tools, config, token, reachability and performs a real tool call, telling you what to fix. It is the correct first debugging step and saves an hour of guessing.If you install from source instead of Docker, treat it as a normal Laravel app: composer install, .env, artisan migrate, Passport keys, queue worker. Verify against the repo — the release notes only commit to the Docker path.
Model it as a service with one OAuth client per integration. Register a distinct OAuth client for each environment and each caller (local dev, staging, prod worker, your laptop's Claude Code). Wing restrictions are stored per OAuth client at the consent screen, so separate clients are what make least-privilege real. Scopes must include mcp:use.
Wing-per-bounded-context. Create a wing per application, team, or domain (billing, onboarding, infra-runbooks). Write raw facts and transcripts into drawers; let wiki pages be compiled from them. This maps cleanly onto a Laravel codebase where each domain module or team owns its wing and its own restricted token.
Drive it from Laravel jobs, not from controllers. A listener or scheduled job that calls POST /mcp for recall or session_digest keeps request latency out of your app and lets you retry. Use the HTTP client with an explicit timeout — the transport is request/response only, so a slow compile is a slow HTTP call.
Use the three hook points differently. Session-start injection (recent palace state) and per-prompt injection (relevant context) are for interactive developer tooling; the end-of-session digest is the one you want to mirror in your own pipeline if you use agents outside Claude Code. The hooks are a reference implementation of the pattern, not a general-purpose SDK.
Schedule wiki maintenance yourself. mnemon:auto-compile-stale only reports. A nightly job should read its report and issue compile calls for the stale pages you care about, then a lint pass. Treat the wiki as a build artifact with a cron, not as something that heals itself.
Compile a nightly digest into a durable page. The combination people actually want: end-of-day job runs session_digest for each active session, then compiles/refreshes a "what happened this week" page per wing. The knowledge graph and revision history tools make that page diffable over time.
Ops through Filament, humans through /wiki and /palace. /admin is for you (users, config, browsing). /wiki and /palace are for the team to read what the agents learned. Put the admin panel behind the same proxy auth as everything else.
Integrate via MCP, not by reaching into the database. The 14 tools are the contract: drawers, wiki pages, lint, compile, knowledge graph, revision history, recall, session_digest. Anything you do with raw SQL against the palace tables is unsupported and will not respect wing restrictions.
Local testing: keep MNEMON_EMBEDDING_DRIVER=none in CI so tests cost nothing and need no account; the suite runs on SQLite (697 passed, 9 skipped) and CI mirrors it on PostgreSQL 17. If you fork, that suite is your regression net — run it on Postgres before trusting search behaviour.
composer require, no service provider to register in your app. Upgrades are pull-image-and-migrate. v1.0.0 is the first release, so there is no battle-tested upgrade path yet — pin the image tag and read the changelog before every bump.billing/…, infra/…) in whatever compiles pages, or your isolation model quietly becomes advisory.wiki_lint auto-fix requires an unrestricted token, and a restricted context_set still rebuilds the wiki-wide wiki:index and wiki:log. If you need cross-wing index pages accurate, run those operations from a dedicated unrestricted service token and keep it off developer machines.session_digest replay keys on session id, not device. Running the same session digest from two machines can collide or double-write. Dedupe client-side, or keep digesting to a single designated runner.openai or ollama driver. Do not evaluate the product on a SQLite dev box./admin to the internet without proxy-level auth. This alone rules the v1.0.0 instance out for multi-user deployments.artisan rather than from a request path.TRUSTED_PROXIES is untested end to end. Behind nginx/Traefik, verify X-Forwarded-* handling, HTTPS scheme detection, and — the classic breakage — OAuth redirect URIs. Test the full device-grant flow through the proxy, not just curl /mcp./mnemon:doctor first, always. It exercises tools, config, token, reachability, and a real tool call. Only after it is green should you start reading logs.How can I help you explore Laravel packages today?