nexus

module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2026 License: AGPL-3.0

README

BubbleFish Nexus

THE Underlying AI Memory Infrastructure. Connects the memory of your AI apps and agents. Survives kill -9.

One daemon. Shared memory across Claude Desktop, ChatGPT, Perplexity, OpenWebUI, OpenClaw, LM Studio, and Cursor — all at once. Stored on your machine. Zero data loss.

Single Go binary. No Docker required. Runs on Windows, Linux, macOS.


The problem

Every AI client keeps its memory in its own silo. Claude doesn't know what you told ChatGPT. Perplexity doesn't know what Claude learned. When the session ends, everything disappears.

Your AI memory is fragmented across vendors, and none of them talk to each other.

Nexus is a local daemon that gives all your AI clients a shared, persistent memory. Write a memory from Claude Desktop. Read it back from ChatGPT. Kill the process mid-write. Restart. Nothing lost.

Verified working simultaneously: Claude Desktop, ChatGPT Desktop, ChatGPT Web, Claude Web, Perplexity Comet, OpenWebUI, and LM Studio — all reading and writing to the same memory store in one session.


What it does

Shared memory across all your AI apps. Any client connected via MCP or HTTP can write a memory. Every other client can read it. No additional configuration. The shared model is the default.

Crash-safe persistence. Every write hits a Write-Ahead Log with a CRC32 checksum and an fsync before you get a 200 OK. Kill the process mid-write. Restart. The WAL replays automatically. There is no window where data is at risk.

6-stage retrieval cascade. Policy gate → exact cache → semantic cache → structured lookup → vector search → hybrid merge with temporal decay. Cheapest safe path first. Every response tells you which stage fired.

Multi-destination routing. One write fans out to SQLite, PostgreSQL (pgvector), and Supabase asynchronously. Local fast access and remote shared access at the same time.

MCP native. Claude Desktop and Cursor integration via Model Context Protocol. Same pipeline as HTTP, lower latency.

Local-first. Binds to localhost by default. Your data never leaves your machine unless you configure it to.


Crash recovery demo

This is the pitch. Everything else is details.

# 1. Send 50 memories through Nexus
for i in $(seq 1 50); do
  curl -s -X POST http://localhost:8080/inbound/default \
    -H "Authorization: Bearer $KEY" \
    -H "Content-Type: application/json" \
    -H "X-Idempotency-Key: demo-$i" \
    -d "{\"message\":{\"content\":\"Memory $i\",\"role\":\"user\"},\"model\":\"test\"}"
done

# 2. Kill the daemon mid-flight
kill -9 $(pgrep bubblefish)

# 3. Restart
bubblefish start

# 4. Query — all 50 are there. Zero duplicates. Zero data loss.
curl http://localhost:8080/query/sqlite -H "Authorization: Bearer $KEY" | jq '.results | length'
# → 50

Or just run:

bubblefish demo    # Does all of the above automatically. Exits 0 on success.

Quick start

Linux
curl -L https://github.com/bubblefish-tech/nexus/releases/latest/download/bubblefish-linux-amd64 -o bubblefish
chmod +x bubblefish && sudo mv bubblefish /usr/local/bin/
bubblefish install --mode simple
bubblefish start
Windows (PowerShell)
Invoke-WebRequest -Uri "https://github.com/bubblefish-tech/nexus/releases/latest/download/bubblefish-windows-amd64.exe" -OutFile bubblefish.exe
.\bubblefish.exe install --mode simple
.\bubblefish.exe start
macOS (Apple Silicon)
curl -L https://github.com/bubblefish-tech/nexus/releases/latest/download/bubblefish-darwin-arm64 -o bubblefish
chmod +x bubblefish && sudo mv bubblefish /usr/local/bin/
bubblefish install --mode simple
bubblefish start

That's it. Nexus is running on localhost:8080 with a SQLite backend, a single source, and an auto-generated API key. No Docker, no Python, no cloud signup, no embedding API keys. Simple Mode prints your key and example commands.


Connect your clients

Claude Desktop
{
  "mcpServers": {
    "bubblefish-nexus": {
      "command": "bubblefish",
      "args": ["mcp"]
    }
  }
}
ChatGPT / Perplexity / remote clients

Expose Nexus via Cloudflare Tunnel, then use the tunnel URL as your MCP endpoint:

cloudflared tunnel --url http://localhost:7474
OpenWebUI + Ollama
bubblefish install --dest sqlite --profile openwebui
bubblefish start
OpenClaw

Install the bubblefish-nexus plugin. See OPENCLAW_SKILL.md.

Full setup for all clients: MCP_CLIENTS.md


Benchmarks

bubblefish bench --mode throughput   # writes/sec, WAL latency, p50/p95/p99
bubblefish bench --mode latency      # per-stage read breakdown
bubblefish bench --mode eval         # retrieval precision/recall/MRR/NDCG

How is this different?

Capability Cloud Services Agent Frameworks Script Wrappers Nexus
Data stays on your machine No Depends Yes Yes
Crash-safe WAL with checksums Varies No No Yes
Works with any AI client No (siloed) No (coupled) Manual Yes
Single binary, zero deps No No No Yes
Idempotency + dedup Varies Rare No Yes
Temporal decay reranking Some Some No Yes
Tamper detection (HMAC) Varies No No Yes
MCP native integration Some Some No Yes
60-second setup No No Maybe Yes
Built-in reliability demo No No No Yes

Known limitations

  • Single WAL encryption key. Key rotation ring is planned for a future version.
  • No RBAC. Per-source API keys and policies provide isolation. Sufficient for personal and small-team use.
  • No clustering or HA. Single-node daemon.
  • The MCP server does not currently support mutual TLS (use a reverse proxy for mTLS).

Roadmap — v0.2

Coming in v0.2: Credential gateway. Synthetic key routing so your AI clients never touch your real provider API keys. Rate limiting per synthetic key. Model allowlists.

Target-state design:

# daemon.toml (planned — not implemented in v0.1.x)
[credentials]
  [[credentials.mappings]]
  synthetic_prefix = "bfn_sk_"
  provider = "openai"
  real_key = "env:OPENAI_API_KEY"
  allowed_models = ["gpt-4o", "gpt-4o-mini"]
  rate_limit_rpm = 100

This will let Nexus act as a credential proxy — clients authenticate with a bfn_sk_ synthetic key and Nexus substitutes the real provider key on the upstream call. Not yet implemented.


Docs


Building from source

git clone https://github.com/bubblefish-tech/nexus.git
cd nexus
go build -o bubblefish ./cmd/bubblefish/

Running tests with race detection requires GCC:

CGO_ENABLED=1 go test ./... -race

End users never need Go or GCC. The pre-built binaries include everything.


Contributing

Contributions use the Developer Certificate of Origin (DCO). Sign off your commits:

git commit -s -m "Add feature X"

See CONTRIBUTING.md for details.


License

AGPL-3.0. See LICENSE.

Commercial license available for SaaS deployment, OEM embedding, or no-AGPL-obligation use. Contact: licensing@bubblefish.sh


Built by Shawn Sammartano / BubbleFish Technologies, Inc. Your data. Your machine. Your rules.

Directories

Path Synopsis
cmd
bubblefish command
Command bubblefish is the entry point for BubbleFish Nexus.
Command bubblefish is the entry point for BubbleFish Nexus.
internal
audit
Package audit implements the AI Interaction Log (Black Box Recorder) for BubbleFish Nexus.
Package audit implements the AI Interaction Log (Black Box Recorder) for BubbleFish Nexus.
backup
Package backup implements online backup and restore for BubbleFish Nexus.
Package backup implements online backup and restore for BubbleFish Nexus.
bench
Package bench implements the `bubblefish bench` command: throughput, latency, and retrieval-evaluation benchmarks against a running Nexus daemon.
Package bench implements the `bubblefish bench` command: throughput, latency, and retrieval-evaluation benchmarks against a running Nexus daemon.
cache
Package cache implements the Stage 1 exact cache for the BubbleFish Nexus 6-stage retrieval cascade.
Package cache implements the Stage 1 exact cache for the BubbleFish Nexus 6-stage retrieval cascade.
config
Package config provides config loading, resolution, and validation for BubbleFish Nexus.
Package config provides config loading, resolution, and validation for BubbleFish Nexus.
daemon
Package daemon implements the BubbleFish Nexus gateway daemon.
Package daemon implements the BubbleFish Nexus gateway daemon.
demo
Package demo implements the BubbleFish Nexus reliability demo — the golden crash-recovery scenario that proves WAL-first durability.
Package demo implements the BubbleFish Nexus reliability demo — the golden crash-recovery scenario that proves WAL-first durability.
destination
Package destination defines the DestinationWriter interface and canonical write envelope (TranslatedPayload) consumed by all memory backends.
Package destination defines the DestinationWriter interface and canonical write envelope (TranslatedPayload) consumed by all memory backends.
doctor
Package doctor implements the "bubblefish doctor" health check subsystem.
Package doctor implements the "bubblefish doctor" health check subsystem.
embedding
Package embedding provides the EmbeddingClient interface and provider implementations (OpenAI-compatible, Ollama) for BubbleFish Nexus.
Package embedding provides the EmbeddingClient interface and provider implementations (OpenAI-compatible, Ollama) for BubbleFish Nexus.
eventsink
Package eventsink implements the optional webhook notification layer for BubbleFish Nexus.
Package eventsink implements the optional webhook notification layer for BubbleFish Nexus.
firewall
Package firewall implements the Retrieval Firewall: policy-governed access control at the retrieval level using sensitivity labels, classification tiers, blocked-label enforcement, and namespace isolation.
Package firewall implements the Retrieval Firewall: policy-governed access control at the retrieval level using sensitivity labels, classification tiers, blocked-label enforcement, and namespace isolation.
fsutil
Package fsutil provides filesystem utilities that abstract over OS-specific behaviour differences, particularly Windows mandatory file locking.
Package fsutil provides filesystem utilities that abstract over OS-specific behaviour differences, particularly Windows mandatory file locking.
hotreload
Package hotreload implements live config reloading for BubbleFish Nexus source files.
Package hotreload implements live config reloading for BubbleFish Nexus source files.
idempotency
Package idempotency provides an in-memory deduplication store for BubbleFish Nexus write requests.
Package idempotency provides an in-memory deduplication store for BubbleFish Nexus write requests.
jwtauth
Package jwtauth implements JWT-based authentication for BubbleFish Nexus using JWKS (JSON Web Key Set) validation.
Package jwtauth implements JWT-based authentication for BubbleFish Nexus using JWKS (JSON Web Key Set) validation.
lint
Package lint validates BubbleFish Nexus configuration and warns about dangerous or suboptimal settings.
Package lint validates BubbleFish Nexus configuration and warns about dangerous or suboptimal settings.
mcp
Package mcp implements the Model Context Protocol JSON-RPC 2.0 server for BubbleFish Nexus.
Package mcp implements the Model Context Protocol JSON-RPC 2.0 server for BubbleFish Nexus.
metrics
Package metrics provides a private Prometheus registry and all initial BubbleFish Nexus metrics.
Package metrics provides a private Prometheus registry and all initial BubbleFish Nexus metrics.
oauth
Package oauth implements an OAuth 2.1 authorization server for BubbleFish Nexus, enabling ChatGPT and other OAuth-only MCP clients to connect.
Package oauth implements an OAuth 2.1 authorization server for BubbleFish Nexus, enabling ChatGPT and other OAuth-only MCP clients to connect.
policy
Package policy compiles source policy configurations into a versioned JSON artifact (compiled/policies.json) that the daemon loads at startup for fast, lock-free policy enforcement.
Package policy compiles source policy configurations into a versioned JSON artifact (compiled/policies.json) that the daemon loads at startup for fast, lock-free policy enforcement.
projection
Package projection implements the response projection engine: field allowlist filtering, byte-budget truncation on word boundaries, _nexus metadata injection, and metadata stripping.
Package projection implements the response projection engine: field allowlist filtering, byte-budget truncation on word boundaries, _nexus metadata injection, and metadata stripping.
query
Package query implements the 6-stage retrieval cascade for BubbleFish Nexus.
Package query implements the 6-stage retrieval cascade for BubbleFish Nexus.
queue
Package queue implements the bounded in-memory message queue for BubbleFish Nexus.
Package queue implements the bounded in-memory message queue for BubbleFish Nexus.
securitylog
Package securitylog provides an append-only, mutex-protected JSON Lines writer for structured security events.
Package securitylog provides an append-only, mutex-protected JSON Lines writer for structured security events.
signing
Package signing implements HMAC-SHA256 config signing and verification for BubbleFish Nexus compiled config files.
Package signing implements HMAC-SHA256 config signing and verification for BubbleFish Nexus compiled config files.
tray
Package tray provides system tray support for BubbleFish Nexus.
Package tray provides system tray support for BubbleFish Nexus.
tui
Package tui implements the Bubble Tea terminal UI for BubbleFish Nexus.
Package tui implements the Bubble Tea terminal UI for BubbleFish Nexus.
tui/api
Package api provides HTTP client and types for the Nexus admin API.
Package api provides HTTP client and types for the Nexus admin API.
tui/styles
Package styles defines all lipgloss colors and styles for the TUI.
Package styles defines all lipgloss colors and styles for the TUI.
tui/tabs
Package tabs implements Bubble Tea sub-model tabs for the BubbleFish Nexus TUI.
Package tabs implements Bubble Tea sub-model tabs for the BubbleFish Nexus TUI.
version
Package version holds the single source of truth for the public version string.
Package version holds the single source of truth for the public version string.
vizpipe
Package vizpipe implements the live pipeline visualization event channel for the BubbleFish Nexus dashboard.
Package vizpipe implements the live pipeline visualization event channel for the BubbleFish Nexus dashboard.
wal
Package wal implements the Write-Ahead Log engine for BubbleFish Nexus.
Package wal implements the Write-Ahead Log engine for BubbleFish Nexus.
web
Package web provides the BubbleFish Nexus web dashboard.
Package web provides the BubbleFish Nexus web dashboard.
web
dashboard
Package dashboard embeds the v4 dashboard HTML and static assets so they are baked into the binary at build time.
Package dashboard embeds the v4 dashboard HTML and static assets so they are baked into the binary at build time.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL