MemNexus is in gated preview — invite only. Learn more
Back to Blog
·5 min read

5-Minute Setup: Persistent Memory for Your AI Coding Assistant

Install MemNexus, save your first memory, and connect your AI tools — all with a single setup command. Your AI assistant remembers everything from here on out.

MemNexus Team

Engineering

TutorialGetting StartedDeveloper Productivity

Every AI coding assistant has the same limitation: it forgets everything when the session ends. MemNexus gives it a persistent memory layer — one that carries your project context, decisions, and debugging history into every future session.

By the end of this guide, you'll have MemNexus installed, your first memory saved, and your AI tools configured to use it. It takes about five minutes.

What you'll need

  • Node.js 18 or later
  • An API key from memnexus.ai/waitlist
  • A git repository (optional — needed for CommitContext in Step 5)

Step 1: Install the CLI and log in

Install the MemNexus CLI globally:

npm install -g @memnexus-ai/cli

Then authenticate with your API key from the dashboard:

mx auth login --api-key YOUR_API_KEY

Replace YOUR_API_KEY with the key from your MemNexus dashboard. Your key is stored locally in ~/.memnexus/config.json — it never ends up in a file that could get committed to version control.

If you prefer a guided flow, use mx auth login --interactive instead — it prompts you to paste the key rather than passing it inline.

Step 2: Create your first memory

A memory is a structured note about your project — conventions, decisions, current focus. Save one for your project now:

mx memories create \
  --conversation-id "NEW" \
  --content "My project: Building a TypeScript API. Stack: Express, PostgreSQL, TypeScript strict mode. Conventions: Result types for error handling, no exceptions. Current focus: adding rate limiting middleware." \
  --topics "project-context"

A few things to note:

  • --conversation-id "NEW" starts a fresh conversation. MemNexus groups related memories together, so future memories about the same project should use the conversation ID that gets returned (something like conv_abc123).
  • The --topics flag is for tags you want to add explicitly. MemNexus also extracts topics, facts, and entities from the content automatically — so mentioning "Express," "PostgreSQL," and "rate limiting" in the content is enough for the system to index them.

Step 3: Verify it worked

Search for what you just saved:

mx memories search --query "TypeScript API conventions" --brief

You'll get back a JSON summary of your top matches — content previews, memory IDs, and relevance scores. If your memory shows up, everything is working.

The --brief flag is designed for quick lookups: top 5 results, 80-character previews, fast output. Skip it when you want the full content of each result.

Step 4: Connect to your AI tools

This is the part that used to be manual — editing MCP config files, adding instructions to CLAUDE.md, copying API keys into JSON. Now it's one command.

From inside your project directory:

cd ~/your-project
mx setup

That's it. mx setup auto-detects which AI coding tools you have installed — Claude Code, Cursor, Copilot, Codex, Windsurf — and configures each one automatically. Here's what it does:

  • Configures MCP so your AI tools can read and write memories natively, without you running CLI commands manually.
  • Installs the CommitContext post-commit hook (if you're in a git repo), which captures the reasoning behind every commit as a searchable memory.
  • Detects existing hook managers (like Husky) and appends to them rather than overwriting.

If you only want to set up a specific tool, you can target it directly:

mx setup claude-code
mx setup cursor
mx setup copilot
mx setup codex

Run mx setup in each git repository you want to track. The CommitContext hook is installed per-project.

Step 5: Try CommitContext

CommitContext is a post-commit hook that automatically captures the reasoning behind every commit as a searchable memory. To install it, run mx setup from inside a git repository:

cd ~/your-project
mx setup hooks

This installs a post-commit hook in your repo. If you're using Husky or another hook manager, it appends to your existing hooks instead of overwriting them.

Now make a commit to test it:

git commit --allow-empty -m "test: verify commit context"

Wait a few seconds, then check:

mx commit-context list

You should see your commit listed with a summary. From now on, every commit in this repo creates a searchable memory — so when your AI tool asks "why did we change the auth middleware last week?" the answer is already there.

The hook is non-blocking — if the MemNexus API is unreachable, it caches locally and syncs later. It never prevents a commit from going through.

What to save next

Your first memory is a good start. Here are three more worth saving before your next session:

  • Coding conventions — the patterns your codebase enforces that an AI wouldn't know from reading the files alone (error handling approach, naming conventions, testing structure)
  • Architecture decisions — why you chose your current stack, what you rejected, and the trade-offs you accepted
  • Debugging findings — anything you spent real time tracking down: a gotcha in a library, a config setting that behaves unexpectedly, a race condition and its fix

The best time to save a debugging memory is right after you solve the problem, while the details are still sharp. A short paragraph is enough — the system extracts the key facts automatically.

What happens after a week

The value compounds quickly. After a week of saving memories, your AI tool starts sessions with real context: it knows your preferred error handling pattern, it remembers the rate limiting approach you landed on, it recalls that you debugged a database connection issue last Tuesday. You stop re-explaining the same things. The AI starts contributing faster. And when you hit a problem you've seen before in a different project, there's a good chance that past work surfaces — automatically.


MemNexus is in invite-only preview. Join the waitlist at memnexus.ai/waitlist to get access.

Ready to give your AI a memory?

Join the waitlist for early access to MemNexus

Request Access

Get updates on AI memory and developer tools. No spam.