{
  "markdown": "# Mnema\n\nYour AI assistant answers from its training data, not your team's. Mnema is a\nself-hostable knowledge workspace that publishes your docs, decisions, and\nstep-by-step workflows to any MCP-aware AI client (Claude, ChatGPT, Cursor,\nWindsurf, Cline) over the Model Context Protocol — so your agents read *your*\ncontext, live, with no uploads or copy-paste.\n\nThis is the **open-core** repository (fair-code, [Mnema Community License](./LICENSE)).\nIt is the full core product and runs on its own; the enterprise modules are separate.\n\n<!-- ASSET: hero screenshot (editor + connected Claude) -->\n<!-- ASSET: 30s demo GIF (ask Claude → it reads a doc → proposes an edit → Approve) -->\n\n## Quickstart (self-host in a few minutes)\n\nClone to a live MCP endpoint in about 4 minutes — a one-time image build. (A\nstone-cold first-ever build can take longer; it's I/O-bound on Docker's\nfilesystem, not downloads. Native Linux is as fast or faster.)\n\nRequirements: **Docker + Docker Compose**. (Working on the code itself, outside\nDocker? **Node 22** — `nvm use` picks it up from [`.nvmrc`](./.nvmrc) — and\n**pnpm 10**; see [CONTRIBUTING.md](./CONTRIBUTING.md).)\n\n```bash\ngit clone https://github.com/nbkdoesntknowcoding/mnema.git\ncd mnema\n./scripts/self-host-init.sh          # generates secrets + the OAuth keypair, writes .env\ndocker compose up -d --build         # postgres, redis, api, collab, workers, web\n```\n\nThen:\n\n- Open **http://localhost:4321** and create an account at **`/auth/local`** (email + password).\n- Connect an MCP client to your server: **`http://localhost:8080/mcp`**\n  (in Claude/Cursor, add it as a custom MCP/connector URL; you'll be sent back here to log in and approve).\n\nThat's it — the first workspace comes with a welcome doc and an example flow, so your\nfirst connection has something real to read.\n\nOptional: set `VOYAGE_API_KEY` (semantic search) and `GEMINI_API_KEY` (autocomplete)\nin `.env` — bring your own keys. Both stay disabled until set.\n\n## Documentation\n\n- **[Connect an AI client](./docs/connect/)** — [Claude](./docs/connect/claude.md), [ChatGPT](./docs/connect/chatgpt.md), [Cursor](./docs/connect/cursor.md), [Windsurf](./docs/connect/windsurf.md), [Antigravity](./docs/connect/antigravity.md)\n- **[Embed Mnema in your own app](./docs/connect/api-integration.md)** — REST API + an API key\n- **[REST API reference](./docs/api/)** — every public endpoint, auth, scopes, examples\n\n## What's in the core (this repo) vs. licensed\n\nThe free layer carries the full product; the gates sit on what organizations and\nR&D need. Plainly:\n\n| Capability                                         | Core (this repo) | Licensed |\n| :------------------------------------------------- | :--------------: | :------: |\n| Docs, real-time editor, folders, search            | ✅ | ✅ |\n| Flows (build + walk step-by-step via MCP)          | ✅ | ✅ |\n| MCP server (read + propose/commit writes)          | ✅ | ✅ |\n| Built-in email+password auth, or generic OIDC      | ✅ | ✅ |\n| Self-host, single-workspace, unlimited docs        | ✅ | ✅ |\n| Version history + document export                   | ✅ free with a community license | ✅ |\n| Knowledge graph (build, report, traverse)          | ❌ | ✅ |\n| Meeting intelligence (bot, transcription, summaries) | ❌ | ✅ |\n| Org / IAM / SSO, audit logs, multi-workspace       | ❌ | ✅ |\n\nThe knowledge graph, meeting intelligence, org/IAM+SSO, audit, and multi-workspace\nmode are commercial add-ons — the core runs perfectly without them, and its CI\nproves it builds and boots with the enterprise modules entirely absent. Licensing:\n[LICENSE](./LICENSE) for the core; enterprise inquiries via the website.\n\n> Docs, flows, collaboration, and live MCP are free forever, registered or not.\n> Version history and export are also free — we just ask for your email (a free\n> community license, entered in **Settings**). Your history is recorded from day\n> one; registering reveals it.\n\n## Self-host notes\n\n- **Pin to a release tag.** For a stable deployment, check out a tagged release\n  rather than tracking `main`: `git fetch --tags && git checkout vX.Y.Z`, then\n  `docker compose up -d --build`. Release tags are immutable and signed; upgrade\n  by checking out a newer tag and rebuilding. See [RELEASING.md](./RELEASING.md)\n  and [CHANGELOG.md](./CHANGELOG.md).\n- **HTTPS / reverse proxy.** Behind TLS, expose the collab WebSocket as\n  `wss://<your-host>/collab` (WebSocket upgrade enabled) and set\n  `PUBLIC_COLLAB_URL=wss://<your-host>/collab`, then **rebuild the web app**\n  (`PUBLIC_*` vars are baked in at build time). Otherwise the browser falls back to\n  `ws://localhost:1234`, which is blocked as mixed content on an HTTPS page — and\n  every document shows \"disconnected.\" Re-run `./scripts/self-host-init.sh --url https://<your-host>`\n  to regenerate `.env` for a public host.\n- **Backups.** Everything lives in Postgres + the named volumes. Back up with\n  `docker compose exec postgres pg_dump -U mnema mnema > backup.sql` and snapshot the\n  `pgdata` / `redis_data` volumes.\n- **Requirements.** Comes up on a 4 GB machine. Migrations apply automatically on\n  first `up` (idempotent).\n\n## Troubleshooting (self-host)\n\n- **`docker compose up` exits immediately with \"set POSTGRES_PASSWORD in .env\" (or\n  `REDIS_PASSWORD`).** There's no `.env` yet — the compose refuses to boot with\n  empty credentials. Run `./scripts/self-host-init.sh` first (it writes `.env`\n  with generated secrets); add `--force` to regenerate one that already exists.\n- **\"port is already allocated\" on startup.** The stack publishes three ports on\n  127.0.0.1: `4321` (web), `8080` (api), `1234` (collab). Stop whatever holds the\n  port, or change the host side of that service's `ports:` entry in\n  `docker-compose.yml`.\n- **Every document shows \"disconnected\" (HTTPS deploys).** The browser is trying\n  `ws://localhost:1234` — blocked as mixed content on an HTTPS page. Set\n  `PUBLIC_COLLAB_URL=wss://<your-host>/collab`, proxy that path with WebSocket\n  upgrade enabled, and **rebuild the web image** — see the HTTPS note above.\n  `./scripts/self-host-init.sh --url https://<your-host> --force` regenerates\n  `.env` with the whole URL block derived for you.\n- **Changed a `PUBLIC_*` var in `.env` but the app ignores it.** `PUBLIC_*` values\n  are baked into the web image at build time, not read at runtime. Rebuild it:\n  `docker compose up -d --build web`.\n- **First boot looks stuck.** Startup is gated: postgres healthy → `migrate`\n  completes → api healthy → web starts. Watch `docker compose ps` and\n  `docker compose logs -f migrate api`. `(non-fatal on re-run)` lines from\n  `migrate` are normal — the migrations are idempotent and re-runs are safe.\n- **The login page shows SSO buttons, or sign-up is nowhere to be found.**\n  Self-host sign-in lives at **`/auth/local`** (email + password). Keep both\n  `AUTH_PROVIDER=password` and `PUBLIC_AUTH_PROVIDER=password` in `.env` — the\n  `PUBLIC_` one is baked at build time, so rebuild the web image after changing it.\n\n## Run it with an AI agent (alternative)\n\nOpen the repo in **Claude Code** (or any coding agent) and paste:\n\n> **Set up and run Mnema (this repo) for self-hosting.** Confirm Docker is running,\n> then run `./scripts/self-host-init.sh --defaults` and `docker compose up -d --build`.\n> Wait for all services healthy, open the web URL, create an account at `/auth/local`,\n> and report the URLs. Fix any error you hit and continue.\n\n## Stack\n\npnpm monorepo — **api** (Fastify + Drizzle/Postgres), **collab** (Hocuspocus/Yjs),\n**workers** (BullMQ/Redis), **web** (Astro + React). Node 22, Postgres 16 + pgvector, Redis 7.\n\n## License\n\nThe core is licensed under the **Mnema Community License** (a Sustainable-Use\nfair-code license): free to use, modify, and self-host for your own internal or\npersonal use; commercial hosting/reselling requires an agreement. See [LICENSE](./LICENSE),\n[CONTRIBUTING.md](./CONTRIBUTING.md), and [TRADEMARK.md](./TRADEMARK.md).\n\n\"Mnema\" is a trademark of the maintainer — forks may use the code, not the name.\n",
  "bytes": 8042,
  "sha": "d8ec302dbea23ed6bf463f1dac17c8526604aa651e4a8c832847406758c0b547",
  "repo_slug": "nbkdoesntknowcoding/mnema",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_in_theboringpeople_mnema_1bc9f830/readme"
}