NexNex

Organizational context & memory for AI agents. Connect 100+ tools into one knowledge graph via 47 MCP tools.

Nex: Compounding Intelligence for AI agents

npm version Discord

Turn all your AI agent conversations into a unified knowledge graph. Supports Claude Code, Codex, OpenClaw, Cursor, OpenCode, etc. Adds additional context from Email, Meetings, Slack, HubSpot, Salesforce.

Tell something to OpenClaw. Ask about it in Claude Code. Reference it from Cursor. Context follows you across tools — no copy-pasting, no re-explaining, no lost context.

Join our Discord

Talk to the team, share feedback, and connect with other developers building AI agents with Nex.

How It Works

You → OpenClaw: "Maria Rodriguez, CTO of TechFlow, wants to expand to Europe in Q3. Budget is $2M."

You → Claude Code: "What do you know about Maria Rodriguez?"
Claude Code: "Maria Rodriguez is the CTO of TechFlow. They're planning European expansion
              in Q3 with a $2M budget."

You → Cursor: "Which companies are planning European expansion?"
Cursor: "TechFlow — Maria Rodriguez (CTO) confirmed Q3 timeline, $2M budget."

One fact entered once. Available everywhere, instantly.

Integration Options

CLI + MCP ServerOpenClaw PluginClaude Code PluginSKILL.md
PlatformsAny terminal, Claude Desktop, ChatGPT, Cursor, WindsurfOpenClawClaude Code CLIOpenClaw (script-based)
Auto-recallVia nex recall / MCP tool callsYes (smart filter)Yes (smart filter)No (manual)
Auto-captureVia nex captureYesYesNo (manual)
NotificationsDaily digest + proactive alerts (Channels API)NoNoNo
Commands50+ CLI commands, 50+ MCP tools, nex mcp4 tools + 4 commands5 slash commands + MCPbash scripts
Setupnex setupCopy pluginnex setupSet NEX_API_KEY

Quick Start (Recommended)

# Install and run setup — handles everything in one step
npm install -g @nex-ai/nex
nex setup

nex setup registers your API key, auto-detects your AI platforms (Claude Code, Cursor, Windsurf, etc.), installs hooks, scans project files, and creates config. One command, fully configured.

# Now use it from any agent
nex ask "who is Maria Rodriguez?"
nex remember "Met with Maria, CTO of TechFlow. European expansion Q3, $2M budget."

Copy-Paste Prompt For Any AI Agent

Drop this prompt into any terminal-capable AI agent when you want it to bootstrap Nex for you end to end:

Install and fully bootstrap Nex in this project from start to finish.

1. If the `nex` CLI is missing, install it globally with `npm install -g @nex-ai/nex`.
2. If Nex is not authenticated yet, ask me for the email address I want to use for registration, then continue. If Nex is already authenticated, reuse the existing account and key.
3. Run `nex setup` and complete the full install flow for every detected AI coding platform in this environment.
4. After setup, inspect integrations and connect the first available unconnected integration. Prefer this order when multiple choices are available: gmail, google-calendar, slack, salesforce, hubspot, attio, outlook, outlook-calendar. If OAuth is required, open the browser flow and wait for it to complete.
5. Run a fresh file scan for the current directory so the workspace is up to date.
6. After the scan finishes, trigger Nex compounding jobs by calling the authenticated `POST https://app.nex.ai/api/developers/v1/compounding/trigger` endpoint for these job types: `consolidation`, `pattern_detection`, and `playbook_synthesis`. Use the active Nex API key from the current environment or the config written by Nex setup.
7. Fetch the last 24 hours of insights with the insights endpoint or `nex insight list --last 24h`, then give me a clean digest with sections for Highlights, Risks, Opportunities, Open Loops, and Recommended Next Actions.
8. Finish by showing me:
   - what Nex installed
   - which integration was connected
   - how many files were scanned and ingested
   - whether the compounding/playbooks trigger succeeded
   - the formatted 24-hour insight digest

Do not stop after partial setup. Only pause if you need my email for registration or if an OAuth flow requires my interaction.

This works best in agents that can run shell commands and open OAuth URLs.

See cli/README.md for all 50+ commands.


Manual setup per platform (if you prefer step-by-step)

CLI (any terminal, any AI agent)

npx @nex-ai/nex register --email [email protected]

That's it. Now use it:

# Ask your knowledge graph
nex ask "who is Maria Rodriguez?"

# Ingest information
nex remember "Met with Maria Rodriguez, CTO of TechFlow. European expansion Q3, $2M budget."

# Or pipe from stdin
cat meeting-notes.txt | nex remember

# Search CRM records
nex search "TechFlow"

# CRUD operations
nex record list person --limit 10
nex task create --title "Follow up with Maria" --priority high
nex insight list --last 24h

# Build auto-recall hooks for any agent
nex recall "what do I know about TechFlow?"  # Returns <nex-context> XML block

# Build auto-capture hooks
nex capture "Agent conversation text..."  # Rate-limited, filtered

Install globally: bun install -g @nex-ai/nex

MCP Server (Claude Desktop, Cursor, Windsurf)

The MCP server is bundled inside @nex-ai/nex. No separate package needed.

{
  "mcpServers": {
    "nex": {
      "command": "nex-mcp",
      "env": { "NEX_API_KEY": "sk-your_key_here" }
    }
  }
}

Or without a global install:

{
  "mcpServers": {
    "nex": {
      "command": "npx",
      "args": ["-y", "@nex-ai/nex", "mcp"],
      "env": { "NEX_API_KEY": "sk-your_key_here" }
    }
  }
}

No API key? The server starts in registration mode — call the register tool with your email.

Proactive Notifications (Claude Code Channels)

The MCP server includes a built-in notification channel that pushes context updates directly into your Claude Code session — without you having to ask. This uses the Claude SDK Channels API.

What you get:

NotificationWhat it doesFrequency
Daily digestSummarizes all context collected in the last 24 hours: deal updates, new relationships, upcoming events, actionable itemsOnce per day (on first session start after 24h)
Proactive alertsPushes new insights as they're discovered — deal changes, relationship shifts, risks, opportunitiesEvery 15 minutes (configurable)

How to enable:

  1. Install Nex globally (if not already):

    npm install -g @nex-ai/nex
    
  2. Add the MCP server to your project (.mcp.json):

    {
      "mcpServers": {
        "nex": {
          "command": "nex-mcp",
          "env": {}
        }
      }
    }
    
  3. Start Claude Code with channels enabled:

    claude --dangerously-load-development-channels server:nex
    
  4. That's it. Notifications arrive as <channel> events in your session:

    ← nex: [technical_stack] MCP server utilizes experimental channel capability...
    ← nex: [deal_update | high] Meridian counter-offer moved to 12% equity split...
    

Configuration:

Environment variableDefaultDescription
NEX_NOTIFY_INTERVAL_MINUTES15How often to poll for new insights

Set it in your .mcp.json:

{
  "mcpServers": {
    "nex": {
      "command": "nex-mcp",
      "env": { "NEX_NOTIFY_INTERVAL_MINUTES": "5" }
    }
  }
}

State persistence: Digest and notification timestamps are stored in ~/.nex/channel-state.json. Delete this file to force a fresh digest on next session start.

Requirements: Claude Code v2.1.80+, claude.ai login (API keys not supported for Channels), --dangerously-load-development-channels flag during research preview.

OpenClaw Plugin (auto-recall + auto-capture)

cp -r openclaw-plugin /path/to/openclaw/plugins/nex
cd /path/to/openclaw/plugins/nex && bun install && bun run build

Add to openclaw.json:

{
  "plugins": {
    "load": { "paths": ["/path/to/plugins/nex"] },
    "slots": { "memory": "nex" },
    "entries": {
      "nex": {
        "enabled": true,
        "config": {
          "apiKey": "sk-your_key_here"
        }
      }
    }
  }
}

See openclaw-plugin/README.md for details.

Claude Code Plugin (auto-recall + auto-capture)

cd claude-code-plugin && bun install && bun run build

Add hooks to ~/.claude/settings.json:

{
  "hooks": {
    "UserPromptSubmit": [{
      "matcher": "",
      "hooks": [{
        "type": "command",
        "command": "NEX_API_KEY=sk-your_key node /path/to/claude-code-plugin/dist/auto-recall.js",
        "timeout": 10000
      }]
    }],
    "Stop": [{
      "matcher": "",
      "hooks": [{
        "type": "command",
        "command": "NEX_API_KEY=sk-your_key node /path/to/claude-code-plugin/dist/auto-capture.js",
        "timeout": 5000,
        "async": true
      }]
    }]
  }
}

Slash commands and MCP server:

cp claude-code-plugin/commands/*.md ~/.claude/commands/    # /nex:recall, /nex:remember, /nex:scan, /nex:entities
claude mcp add nex -- nex-mcp                               # Full toolset

See claude-code-plugin/README.md for details.

SKILL.md (OpenClaw script-based)

For OpenClaw agents without the plugin, SKILL.md provides bash-script-based access:

# Register and get API key
bash scripts/nex-openclaw-register.sh [email protected] "Your Name"

# Query context
printf '{"query":"who is Maria?"}' | bash scripts/nex-api.sh POST /v1/context/ask

# Ingest text
printf '{"content":"Meeting notes..."}' | bash scripts/nex-api.sh POST /v1/context/text

# Scan project files
bash scripts/nex-scan-files.sh --dir . --max-files 10

See SKILL.md for the full API reference.

Shared Config

All surfaces share configuration for cross-tool compatibility:

FilePurposeShared by
~/.nex-mcp.jsonAPI key + workspace infoAll surfaces
~/.nex/file-scan-manifest.jsonFile change trackingAll surfaces
~/.nex/rate-limiter.jsonRate limit timestampsOC, MCP, CC
~/.nex/recall-state.jsonRecall debounce stateCC

Register once via any surface → all other surfaces pick up the key automatically.

Architecture

                    ┌─────────────────────┐
                    │   Nex Context Graph  │
                    │  (people, companies, │
                    │  insights, tasks...) │
                    └──────────┬──────────┘
                               │
      ┌────────────────────────┼────────────────────────┐
      │              │                   │              │
  ┌───▼────┐  ┌─────▼───────┐  ┌───────▼──────┐  ┌───▼──────────┐
  │  CLI   │  │  MCP Server │  │  OpenClaw    │  │  Claude Code │
  │  50+   │  │  50+ tools  │  │  Plugin     │  │  Plugin      │
  │  cmds  │  │  + scan     │  │  + recall   │  │  + recall    │
  └───┬────┘  └─────┬───────┘  └──────┬──────┘  └──────┬───────┘
      │             │                 │                 │
  Any agent    Claude Desktop    OpenClaw agents   Claude Code
  Aider        ChatGPT          Clawgent          Any project
  Codex        Cursor            WhatsApp
  Custom       Windsurf

Environment Variables

VariableRequiredDefault
NEX_API_KEYYes (or register)
NEX_DEV_URLNo (dev only)https://app.nex.ai
NEX_SCAN_ENABLEDNotrue
NEX_SCAN_EXTENSIONSNo.md,.txt,.rtf,.html,.htm,.csv,.tsv,.json,.yaml,.yml,.toml,.xml,.js,.ts,.jsx,.tsx,.py,.rb,.go,.rs,.java,.sh,.bash,.zsh,.fish,.org,.rst,.adoc,.tex,.log,.env,.ini,.cfg,.conf,.properties
NEX_SCAN_MAX_FILESNo5
NEX_SCAN_DEPTHNo20
NEX_SCAN_MAX_FILE_SIZENo100000 (bytes)
NEX_SCAN_IGNORE_DIRSNonode_modules,.git,dist,build,.next,__pycache__,vendor,.venv,.claude,coverage,.turbo,.cache
NEX_NOTIFY_INTERVAL_MINUTESNo15

Testing

  • CLI: 119 tests (cd cli && bun test)
  • OpenClaw plugin: 38/38 unit tests (cd openclaw-plugin && npx vitest run)
  • Claude Code plugin: 21/21 E2E tests (see docs/nex-plugin-test-results.md)
  • MCP server: Embedded in CLI, builds clean, all tools typed with Zod schemas
  • SKILL scripts: Syntax validated, injection-resistant, cross-platform (macOS + Linux)

License

MIT

관련 서버