Install
$ agentstack add mcp-timurgaleev-memex ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ● Environment & secrets Used
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
memex
Long-term memory for your AI agent — that never leaves your cloud.
Self-hosted on your own AWS. memex indexes your notes and code and lets any MCP agent (Claude Code, Cursor, Codex) search it and cite the source. No SaaS, no telemetry — your second brain stays yours.
[](./LICENSE)
What is memex?
You write a lot — notes, decisions, docs, code. Six months later you can't find any of it, and your AI assistant has no idea it exists.
memex is a personal knowledge brain you run in your own cloud. It reads your markdown notes and your code, turns them into a searchable index, and hands that search to your AI agent over the Model Context Protocol (MCP). Now your agent answers "what did I decide about X?" with your own words, cited back to the exact note — instead of guessing.
It's a second brain for you, and long-term memory for your AI.
See it work
memex returns the evidence, cited to the exact file. Your agent writes the answer. (The brain retrieves — it doesn't chat.)
Why it exists
- Your knowledge is private. Most "AI memory" tools upload everything to
someone else's servers. memex runs entirely inside one AWS account you control — your notes never leave your cloud, and there's zero telemetry.
- One brain, every agent. It exposes a single MCP endpoint. Any
MCP-compatible tool connects to it; you don't re-index your life per app.
- Search that actually finds things. It blends meaning (vector
embeddings), exact words (keyword search), and relationships (an entity graph) — so the thing you only half-remember still surfaces.
- Understands your code too. It indexes your source (TypeScript, Python) and
can answer "who calls this function / what does it call" from a real call graph — not just your prose.
- Surfaces notes before you ask. Hand it a conversation and it volunteers the
pages most likely relevant — deterministic, no AI guessing.
- Small and boring on purpose. No orchestrator, no SaaS to depend on. It
fits on one small EC2 box, and you can read the whole thing in an afternoon. One brain serves one person; every remote credential (OAuth client, PAT) is scoped to the sources it may read (opt-in fail-closed).
How it's different
| | memex | Hosted "AI memory" | A plain RAG script | |---|:---:|:---:|:---:| | Your data stays in your cloud | ✅ | ❌ | ✅ | | Any MCP agent, one shared index | ✅ | sometimes | ❌ | | Vector + keyword + entity-graph | ✅ | varies | vector-only | | Understands code (real call graph), not just notes | ✅ | ❌ | ❌ | | Zero telemetry, no SaaS dependency | ✅ | ❌ | ✅ |
Who it's for: developers who live in Claude Code / Cursor / Codex, note-takers with a markdown vault, and anyone who refuses to put their second brain on someone else's servers.
How it works
memex indexes your content once, then answers searches on demand. When your agent asks a question, here's the round trip — note that memex hands back evidence, and the agent composes the answer:
sequenceDiagram
autonumber
actor You
participant Agent as Your AI agent
participant memex as memex (MCP)
participant DB as Postgres + pgvector
You->>Agent: "What did I decide about X?"
Agent->>memex: tools/call search { q }
memex->>DB: vector + keyword + graph query
DB-->>memex: top chunks, ranked (RRF)
memex-->>Agent: cited chunks (evidence, not an answer)
Agent-->>You: answer, grounded in your own notes
Under the hood: a small Bun + TypeScript service, Postgres 16 with pgvector, AWS Bedrock for embeddings, and a Cloudflare Tunnel for HTTPS — so no EC2 port is ever exposed. The entire public surface is two routes: GET /health and POST /mcp. That's the whole attack surface.
> Full topology, every container, and the security model: > [ARCHITECTURE.md](./ARCHITECTURE.md).
Quickstart
You'll need an AWS account, Terraform 1.6+, docker compose v2, and a domain you control (for the Cloudflare Tunnel).
git clone https://github.com//memex.git
cd memex
make init # interactive bootstrap: AWS account, domain, buckets -> .env + tfvars
make audit # PII / secrets gate (must pass on a clean clone)
make plan # preview the AWS resources
make apply # create them
make apply boots one EC2 host, pulls the repo, fetches secrets from AWS Secrets Manager, and starts the two containers (memex + cloudflared). Your brain is then live at https://brain./mcp.
Connecting Claude Code (or any MCP client): [deploy/memex/docs/CLAUDE-CODE.md](./deploy/memex/docs/CLAUDE-CODE.md).
What's in the box
| Piece | What it does | |---|---| | memex | The brain: hybrid search, entity + code call graph, code/markdown indexers, MCP server, a built-in advisor that ranks what to fix, push-context that volunteers relevant pages, an opt-in (off-by-default) step that distils notes into concepts/opinions in a separate store (your original notes are never touched) with a take-review lifecycle (list_takes / takes_search / set_take_status), and a self-maintaining background cycle. 63 MCP tools. | | cloudflared | Public HTTPS ingress via Cloudflare Tunnel — no open EC2 ports. | | Terraform | All AWS infra (VPC, EC2, RDS, EFS, Secrets Manager) as one module. | | AWS Bedrock | Titan v2 embeddings + Claude Haiku for query intent and the optional, off-by-default note synthesis (Claude Sonnet for the paid opt-in deep-reasoning slices). Your agent still writes the answers. |
Learn more: [How it works](./docs/HOW-IT-WORKS.md) · [ARCHITECTURE.md](./ARCHITECTURE.md) · [Deployment](./docs/DEPLOYMENT.md) · [Configuration](./docs/CONFIGURATION.md) · [API / MCP tools](./deploy/memex/docs/API.md) · [Operations](./deploy/memex/docs/OPERATIONS.md) · [Privacy](./PRIVACY.md) · [Changelog](./CHANGELOG.md)
Like the idea?
If a private, self-hosted brain for your AI agent is something you want to exist, give it a ⭐ — it's the signal that keeps this maintained. Bugs and ideas welcome in [issues](../../issues).
Contributing
memex is intentionally small — one box, multi-source tenant isolation, no SaaS — so open an issue before anything that adds infrastructure or changes the deploy story. Please read [CLAUDE.md](./CLAUDE.md) (the repo's working rules) first.
Security
Found a vulnerability? Please don't open a public issue — see [SECURITY.md](./SECURITY.md) for the private disclosure channel.
License
[MIT](./LICENSE). Fork it, redeploy it, modify it, ship it. Solo-maintained, no SLA — if you need guarantees, fork and pin.
Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: timurgaleev
- Source: timurgaleev/memex
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.