Download the PHP package coopers98/mnemon without Composer

On this page you can find all versions of the php package coopers98/mnemon. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mnemon

Mnemon

CI PHP 8.4+ Laravel 13

One memory for every AI tool you use. Mnemon is a self-hosted memory server. It keeps what you and your agents learn, verbatim, and serves it back to Claude, Cursor, ChatGPT or your own scripts over the Model Context Protocol. A compiled wiki sits on top, so what was learned stays readable instead of buried in raw notes.

Try it: a read-only demo with a sample brain is at https://trymnemon.com.

Built on Laravel 13, PostgreSQL + pgvector, and Filament v5.


Measured, not asserted

Most memory systems claim semantic retrieval helps. This one measures it. A full LongMemEval-S run — 500 questions, both legs, no subset — comparing keyword-only retrieval against the same pipeline with embeddings enabled:

Metric keyless embedded Δ
hit_rate@1 0.742 0.886 +0.144
recall@5 0.832 0.952 +0.120
MRR 0.817 0.924 +0.107
QA accuracy (gpt-4o, K=5) 0.557 0.627 +0.070

Embeddings improve every metric at every depth — including recall@10, which an earlier 25-question subset had shown as saturated and legs-identical. The subset was misleading, not merely imprecise; the full run is what corrected it. That correction is documented rather than quietly overwritten, along with two earlier ones.

Total spend was $36.76 against a ~$37 estimate extrapolated from a two-question smoke test — within 1% at 250× the sample size.

Scope, stated plainly: this measures the palace (retrieval) layer only, not the wiki, and the QA leg is self-judged by the same model family that answers. Full methodology, the three caveats the accuracy number depends on, and the conditional-split breakdown are in benchmark/README.md. The harness is in this repo and re-runnable.


Quickstart

Then open http://localhost:8080. The admin password is generated on first boot and written to storage/admin-password.txt inside the app container:

There is no password reset flow — save it somewhere safe.

Semantic search is off by default. MNEMON_EMBEDDING_DRIVER=none ships as the default so a first run needs no account and spends nothing; retrieval falls back to full-text plus a recency boost, which works but is not what the benchmark above measures. For the embedded behaviour, set MNEMON_EMBEDDING_DRIVER=openai and OPENAI_API_KEY in .env, then docker compose exec app php artisan mnemon:reembed to backfill anything already stored.

If docker compose up fails to start, check for a port collision first: the stack binds 127.0.0.1:8080 and 127.0.0.1:8443, and Docker reports this as bind: address already in use against the app container rather than as anything about Mnemon. Either stop whatever holds the port (ss -lntp | grep -E ':8080|:8443') or change HTTP_BIND / HTTPS_BIND in .env to free ports before starting.

By default the stack binds to loopback only (127.0.0.1:8080 / 127.0.0.1:8443), so a local trial is never exposed to the network. To serve on a real hostname with automatic HTTPS from Let's Encrypt instead:

  1. Point a DNS A/AAAA record for the hostname at this host before you start the stack. Let's Encrypt validates over HTTP-01, so a name that doesn't resolve yet fails issuance and Caddy serves nothing on that hostname.
  2. Set DOMAIN in .env to that hostname.
  3. Set HTTP_BIND=0.0.0.0:80 and HTTPS_BIND=0.0.0.0:443 in .env. These default to loopback so a "just trying it" run doesn't serve your knowledge base to the internet — leaving them at the defaults while DOMAIN is set is the single most likely reason certificate issuance fails.

To run behind your own TLS-terminating reverse proxy instead, leave DOMAIN blank (so Caddy serves plain HTTP on port 80 inside the container), point the proxy at the published HTTP port, and set TRUSTED_PROXIES in .env to the proxy's address or CIDR range, comma-separated if there are several. The app then honours that proxy's X-Forwarded-For, -Host, -Port, -Proto and -Prefix headers, so client IPs and https:// URLs should come out right. TRUSTED_PROXIES takes addresses and CIDRs, and it must match the address the app sees the proxy connecting from. Check what that is (for example in the access log) rather than assuming: on a typical Docker bridge network it is the network gateway, not 127.0.0.1, but it depends on how the port is published and whether the proxy runs in a container. Unset, no proxy is trusted (except on Laravel Cloud and *.on-forge.com / *.on-vapor.com hosts, where the framework default trusts all), and the app advertises http:// URLs. Setting APP_URL to the public https:// address is also sensible. Not tested end to end: the test suite covers X-Forwarded-For; the X-Forwarded-Proto path comes from Laravel's own proxy middleware, and neither it nor the APP_URL and gateway-address advice has been exercised against a real proxy in this repo.

See docs/USERGUIDE.md for the native (non-Docker) install, and CONTRIBUTING.md for running the test suite.


What this is

Mnemon has two layers:

Agents read and write both layers via 14 MCP tools. Humans manage everything through a Filament admin panel at /admin, browse the wiki at /wiki, and explore the palace at /palace.

The name is from Mnemosyne — the Greek personification of memory. The wing/room/drawer hierarchy is named after the classical method of loci (the original "memory palace").


Why it exists

Every AI tool maintains its own isolated memory. Claude knows things Cursor doesn't. ChatGPT doesn't know what Claude learned last week. Every new agent starts from zero. The result is constant re-teaching, repeated context dumps, and a fragmented picture of you spread across platforms that never talk to each other.

Existing approaches all make tradeoffs:

Approach Examples Tradeoff
Extract-and-store Mem0, Memori LLM extracts facts at ingest; clean API but lossy. ~49 % on LongMemEval.
Retrieve-raw MemPalace Store raw, retrieve hard. 96.6 % R@5 on LongMemEval, zero API calls. CLI/Python only.
Compile-knowledge Karpathy's LLM Wiki Synthesise sources into a persistent wiki. Compounds over time. No retrieval engine of its own.

Mnemon picks all three: store raw at the bottom (MemPalace's verbatim insight), put a synthesised wiki on top (Karpathy's idea), and expose both layers over MCP so any agent can use them. Self-hosted in Laravel because data sovereignty matters and Laravel makes it easy to ship.


Problems it solves


How to use it

As a human

Admin panel at /admin — full CRUD for wings, rooms, drawers and wiki pages; OAuth clients and access tokens are view-and-revoke only. Dashboard with stats, sparklines, and audit log browser.

Wiki frontend at /wiki — browsable, rendered wiki pages. Requires login; every /wiki and /palace route sits behind auth middleware today.

Palace browser at /palace — explore wings, rooms, and drawers visually.

Landing page at / — overview and entry point.

Use the Quickstart above to get a running instance fastest. The steps below are the native (non-Docker) install — useful for developing on Mnemon itself, or if you'd rather manage PHP and Postgres yourself:

Then visit http://localhost:8000/admin. The panel ships:

As an AI agent (MCP)

Mnemon exposes 14 tools over Streamable HTTP at POST /mcp (JSON-RPC 2.0). Authenticate with an OAuth 2.1 bearer token issued via Passport. All tools require the mcp:use scope; wing restrictions (selected at the consent screen) provide per-agent isolation.

To connect from Claude Code:

All tools require scope mcp:use. Wing restrictions on the token's OAuth client provide per-agent isolation.

Tool What it does
brain_status Drawer/wiki counts, wings, embedding driver, staleness summary
palace_wake_up Recent drawers, wing activity, stale wiki pages
drawer_add Add a drawer (auto-creates wing/room if missing, embeds content, flags related wiki pages for recompilation)
drawer_search Hybrid search; supports wing, room, mode, limit
drawer_get Fetch a single drawer by id
context_get Read a wiki page by name (includes structured metadata, confidence, sources)
context_set Upsert a wiki page (auto-updates index/log; stamps last_compiled_at)
context_list List wiki pages, optionally filtered by type
wiki_lint Detect stale, orphan, empty, and low-confidence wiki pages; auto-fix mode with audit trail (unrestricted tokens only)
wiki_compile Gather related drawers for wiki page compilation; supports consolidation tiers
wiki_graph Query the knowledge graph — entities, typed relationships, graph traversal
wiki_history Supersession and revision history for wiki pages; track how knowledge evolved
recall Hybrid recall of wiki excerpts and drawer snippets for a prompt, packed into a token budget; powers the Claude Code mnemon-recall.sh hook
session_digest Digest a sanitized transcript slice into drawer proposals; persists high-confidence ones, filing project-specific drawers under the session's project wing; powers the Claude Code mnemon-capture.sh hook

Wing restrictions on a token's OAuth client apply to every tool, resource and prompt — a client restricted to project-atlas cannot read, search, count or write personal drawers and wiki pages. A drawer or wiki page it cannot read answers exactly like one that does not exist, and a write addressed by name (context_set, wiki_compile, drawer_add) is refused on the name alone, whether or not anything by that name exists. See Limitations for what a restricted write still touches.


Layer 2 — automatic memory in Claude Code

The MCP server exposes Mnemon to any agent that asks. Layer 2 is automatic capture and recall for Claude Code: every prompt is silently primed with relevant palace context, and every session quietly digests to drawers in the background.

Install it as a Claude Code plugin — no repository, no PHP, no Composer on the device:

Then point it at your instance with a personal access token — see the user guide for the token step and why an OAuth token will not do.

The artisan installer (php artisan mnemon:install-claude-code-hooks) does the same thing on a machine that already has the repository checked out. Use one or the other, not both: their hooks coexist and each would fire twice.

Three hooks:

To check that a device is connected, and why not if it isn't, run /mnemon:doctor in Claude Code.

Claude Code leaves plugin auto-update off for third-party marketplaces. The setup script (curl -fsSL https://<your-instance>/install | bash) turns it on for this one; see Staying current to do it by hand.

See docs/USERGUIDE.md for the full walkthrough.


OpenClaw integration

Mnemon integrates with OpenClaw for automatic memory synchronisation:

OpenClaw's memory_search can route queries to Mnemon alongside local files, giving agents a unified view across both systems.

As an embedding backend

Configure via MNEMON_EMBEDDING_DRIVER:

Driver Model Dimensions Notes
openai text-embedding-3-small 1536 The application default (config/mnemon.php). Needs OPENAI_API_KEY. The Docker Quickstart overrides this to none in .env.docker.example, so trying Mnemon needs no account and spends nothing.
none — — Disables embeddings; search falls back to full-text + temporal only.

| ollama | nomic-embed-text | 768 | Fully local — no account, no spend, no data leaving the host. Needs an Ollama server (MNEMON_OLLAMA_HOST, default http://localhost:11434) with the model pulled. |

embedding is an unconstrained pgvector vector column, so drivers of any width are storable. Semantic queries filter on vector_dims(embedding), which means rows written by a previous driver are simply invisible to semantic search rather than an error — run php artisan mnemon:reembed after switching to bring them across.

Switching drivers requires php artisan mnemon:reembed to backfill embeddings under the new model.


Stack

The MCP server is built on laravel/mcp and laravel/passport — Streamable HTTP + OAuth 2.1 + Dynamic Client Registration + tool/resource/prompt dispatch + audit logging.


Inspiration

Mnemon is a synthesis of three quite different projects, plus the protocol that ties them all together:

The classical method of loci is the naming convention. A wing is a section of a memory palace; a room is a place within it; a drawer is a single thing you remember. Slugs and human-readable identifiers everywhere — the wing called project:atlas is searchable, scopable, and human-meaningful.


What's built

All sprints complete. 697 passing, 9 skipped on SQLite; CI runs the same suite against PostgreSQL 17.

The dated design documents behind these tiers are in docs/design/; they record what was intended at the time and are not maintained as current documentation.


Scheduled tasks

Mnemon runs several automated maintenance tasks to keep the knowledge base healthy:

Schedule Command What it does
Daily, 03:00 mnemon:decay-confidence Applies time-based confidence decay to drawers and wiki pages
Weekly, Sunday 04:00 mnemon:apply-retention --force Enforces retention policies; archives or removes content past its configured half-life

Times are in APP_TIMEZONE (default UTC). mnemon:sync-openclaw is a manual convenience wrapper, not a scheduled task — run it yourself when you want it.


Limitations

This is a working personal tool, not a finished product. Honest constraints today:


Documentation


Common commands


License

MIT — see LICENSE.


All versions of mnemon with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
filament/filament Version ^5.0
laravel/framework Version ^13.0
laravel/mcp Version ^0.7.0
laravel/passport Version ^13.7
laravel/tinker Version ^3.0
league/commonmark Version ^2.8
pgvector/pgvector Version ^0.2.2
resend/resend-laravel Version ^1.3
symfony/yaml Version ^7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package coopers98/mnemon contains the following files

Loading the files please wait ...