Skip to main content

Fractal adds long-term memory to Grok Bot with an OAuth sign-in

GitHubGitHubfractal-memory2026-11-22

Code and reposGetting startedSource read in fullRead first
GitHubGitHubfractal-memory2026-11-22

Open original

Overview

To keep projects, preferences, and decisions across Grok Bot or Claude Code sessions, use the official fractal plugin with an MCP server, skill, and startup hook.

Workflow

  1. What it is: An official plugin pack for long-term memory in Claude Code and Grok Bot. Fractal (getfractal.it) bundles an MCP server, the fractal skill, and a startup hook. The agent automatically gets project memory on new sessions without having to remember to ask.
  2. Grok Bot parts used: Plugins in the Claude Code format, MCP server, and skill. The README says Grok reads .claude-plugin/plugin.json, expands ${CLAUDE_PLUGIN_ROOT}, and automatically loads the .mcp.json HTTP server https://getfractal.it/mcp with fractal OAuth sign-in and no key in chat, plus the fractal skill from skills/. Not part of Grok Bot: The fractal service (account required, paid status not stated in the source), Node.js, and FRACTAL_API_KEY for local hooks. Cloud bots use MCP server tools.
  3. You need: A fractal account, plus Node.js and a key for local hooks. Add the Grok Bot plugin and sign in by OAuth when prompted. For the Claude Code hook, create and export FRACTAL_API_KEY from the dashboard, where it is shown once. Set FRACTAL_URL only for a self-hosted instance. A self-deployed server is optional.
  4. Install: Add and sign in for Grok Bot or use the three repo steps for local hooks.
    • Grok Bot: Add the plugin and sign in on request. Without the plugin, choose Collega il tuo agente in fractal for text to paste into chat.
    • Step 1: Run git clone https://github.com/fractal-memory/fractal-plugin.git. Create an API key in the dashboard and export FRACTAL_API_KEY=fr_....
    • Step 2: Add a SessionStart hook in ~/.claude/settings.json or project .claude/settings.json. Point the command at scripts/fractal-hook.mjs avvio in the clone. The UserPromptSubmit hook in hooks/hooks.json is deliberately unregistered by default.
    • Step 3 (verify): node scripts/fractal-hook.mjs stato shows URL, key, connectivity, startup injection on and per-prompt injection off.
  5. After install: Inject memories at startup and let the agent decide when to store.
    • At session start, the hook retrieves project memory from fractal and injects it into context, default five memories, max 1,200 characters, eight-second timeout.
    • The agent deliberately calls memory_add or memory_correct as described in skills/fractal/SKILL.md. Store decisions, constraints, and stable preferences that still hold in a month. Exclude passwords, keys, tokens, and payment data.
    • For questions about preferences, prior decisions, people, or projects, start with semantic memory_recall. When a fact changes, memory_correct expires the old version into history, retaining it without treating both versions as current.
    • Per-prompt injection defaults to off. Enable with FRACTAL_HOOK_PROMPT=1 (see step 6).
    • On any error, including offline network, revoked key, wrong URL, and service outage, the hook silently uses exit 0 so the session continues.
  6. Did the author run it: The README gives test figures and the repo has no run record files. The author's experiment found per-prompt noise. With one memory about a roller shutter in Pontedera, asking for Madagascar's capital still injected it at similarity 0.73. A ragù memory scored 0.82 on a junk query and 0.91 on a relevant query. The author concluded e5 similarity lacks an absolute threshold for signal versus noise, so per-prompt injection defaults off. The author says fractal's harness used real processes against the real service to verify four hook failure cases. These are README claims that were not reproduced. The repository has no daily run records from the author.

Key points and results

  • Maturity: One day old on 2026-11-23, with one commit, zero stars, forks, or issues/PRs, and MIT license. It was newly published by fractal and the README does not call it a demo.
  • Permissions and boundaries: Read and write personal fractal memories only via MCP. Use OAuth for login and environment variables for keys. Keep passwords, keys, tokens, and payment data out of memory and delete only on request. Get confirmation before using files from the user's Drive. Google Drive/OneDrive connect to fractal separately from Grok Bot.
  • Known limits: Per-prompt injection defaults off. The author recommends FRACTAL_HOOK_PROMPT=1 only for informed users with single-domain memory. Hooks only work locally and cloud bots use MCP. Four hook failures look the same because they are silent. Use stato to distinguish them.
  • Worth borrowing: Inject once at startup and let the agent choose what to store (README design notes).
  • Worth borrowing: Keep sessions running by silently using exit 0 on errors and offer stato diagnostics (scripts/fractal-hook.mjs).
  • Worth borrowing: Use measured similarity scores (0.73/0.82/0.91) to reject per-prompt injection (README).

Source

Platform
GitHub
Author
fractal-memory
Published
Categories
Code and repos, Getting started

What this evidence label means

Source read in full

We read the source (post, article or transcript). That only means the original was read. It does not mean this site reproduced the author's results.

Read the editorial and evidence policy

Other cases in this scenario

This unofficial community project is independent of xAI. xAI has neither approved nor endorsed it. No sign-up. The methods and figures come from the original authors.