Skip to main content
Glama

Shiori (栞)

Shared memory and Markdown notes for all your AI agents.

Shiori (栞, bookmark / trail marker) is a self-hosted remote MCP server that lets Muse, Grok, Claude, ChatGPT, and your local coding agents share the same context. Start a conversation in one agent and pick it up in another without repeating yourself.

How it works

Shiori Architecture

Shiori runs as a single lightweight Node 24 + SQLite + Git container with two complementary layers:

  1. Episodic Memory Tree: An append-only timeline of 1-line facts, preferences, and decisions, organized into a binary tree of summaries. When any agent starts a session (memory_wake), it gets recent memories verbatim and older memories exponentially compressed inside a fixed token budget, and can drill down (memory_zoom) or search (memory_recall) anytime.

  2. Long-form Notes: Editable Markdown documents backed by a real Git repository (every edit is a commit, nothing is ever lost) with hybrid search combining SQLite FTS5 keywords and API embeddings (OpenAI, Gemini, or keyword-only).

  3. Zero-trust OAuth 2.1: Every client authenticates via OAuth 2.1 + GitHub sign-in restricted to your numeric OWNER_GITHUB_ID, with a consent screen, PKCE S256, redirect allowlist, and per-client grant revocation.

Binary-Tree Episodic Memory

See ARCHITECTURE.md for the OAuth 2.1 and hybrid search flow diagrams.

Related MCP server: MemoryGate

Quick start (Coolify / Docker)

  1. Create a GitHub OAuth App (Settings → Developer settings → OAuth Apps):

    • Homepage URL: https://shiori.yourdomain.com

    • Authorization callback URL: https://shiori.yourdomain.com/callback

  2. Deploy in Coolify (or any Docker host):

    • Point a new resource at 8bury/shiori using the Dockerfile.

    • Mount a persistent volume at /data (stores /data/notes, /data/shiori.db, and /data/memory.log).

    • Set your domain (https://shiori.yourdomain.com). Coolify/Traefik handles HTTPS and checks /health.

  3. Configure environment variables (see .env.example):

    • PUBLIC_URL, GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, OWNER_GITHUB_ID

    • ADMIN_SECRET (random hex string for /admin/*)

    • EMBEDDING_PROVIDER (openai, gemini, or none) and EMBEDDING_API_KEY

    • ALLOWED_REDIRECT_PREFIXES (comma-separated callback prefixes for extra clients like Muse or Grok; Claude, ChatGPT, and localhost are allowed by default)

Full setup, importing existing notes, and operations: docs/setup.md.

Local development

npm ci
cp .env.example .env
npm run dev

Run checks:

npm run lint
npm run typecheck
npm run build
npm test

Connecting your agents

  • Claude Code:

    claude mcp add -s user --transport http shiori https://shiori.yourdomain.com/mcp
  • Muse, Grok, Claude (web/desktop/mobile), ChatGPT: add a custom remote MCP connector pointing to https://shiori.yourdomain.com/mcp.

    • If a new client gets a 403 during sign-in, check the container logs for {"auth":"redirect refused","redirectUri":"..."} and add its callback prefix to ALLOWED_REDIRECT_PREFIXES.

  • Agent instructions: Shiori sends usage instructions automatically via MCP server instructions. For best results, also paste MEMORY_PROMPT.md into your AGENTS.md / CLAUDE.md or custom instructions in Muse and Grok.

Web viewer

Open https://shiori.yourdomain.com/ui and sign in with GitHub (same OAuth App, same OWNER_GITHUB_ID check) to browse your memory timeline, notes, and summaries, and search across both. The viewer is read-only; sessions last 7 days.

MCP Tools

Episodic Memory Tree

Tool

Description

memory_wake

Read the logarithmic timeline (recent verbatim, older summarized) at session start

memory_note

Record a 1-line memory (<= 280 bytes); tree compaction runs automatically in the background when a summary LLM is configured

memory_zoom

Open a #lo-hi summary node into its two halves down to raw memories

memory_nap

(Fallback only, registered when MEMORY_SUMMARY_PROVIDER=none) Save a 1-line summary for a pending #lo-hi range

Tool

Description

search

Search both episodic memories (FTS5 + substring fallback; opt-in safe regex) and long-form notes (hybrid FTS5 + vector search) in separate sections, or filter with scope

Long-form Notes

Tool

Description

list_notes

List Markdown note paths (optional prefix filter)

read_note

Read a note and its version hash

write_note

Create or overwrite a note (with optimistic version check)

edit_note

Replace an exact passage in a note

delete_note

Delete a note (recoverable in Git history)

move_note

Move or rename a note in one commit

Admin endpoints

Protected by Authorization: Bearer <ADMIN_SECRET>:

  • GET /admin/grants: list active OAuth client grants

  • DELETE /admin/grants/<id>: revoke one client grant

  • POST /admin/reconcile: reconcile the search index with Git (?mode=rebuild for a full rebuild)

  • POST /admin/memory/forget: drop a bad #lo-hi summary (and ancestors) so it rebuilds from the raw log ({"range":"0-1"})

  • GET /admin/status: inspect embedding & memory-summary health, rate-limit counters, pending compactions, and open alerts

  • POST /admin/alerts/resolve: clear open alerts (optional ?id=<n> or ?source=embedding|memory-summary|dlq|reconcile)

Credits & License

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Git-native long-term memory for AI agents: your markdown files are the source of truth, the search index is a disposable projection rebuilt from git, and every memory the agent writes is a reviewable git commit. Served over one OAuth-secured MCP endpoint with hybrid lexical+semantic recall and a gated, git-first commit_note write tool.
      7
      9
      AGPL 3.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides durable memory for AI agents with structured storage, semantic search, OAuth authentication, and lifecycle controls.
      10
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides AI coding agents with a persistent memory layer to save, recall, update, and track memories across sessions and repositories using hybrid semantic search.
      5
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to capture, classify, synthesize, and retrieve persistent knowledge through MCP and REST APIs, so multiple agents can share memory and improve across sessions. It provides full-text, semantic, and hybrid search with token-optimized context retrieval from sources like Obsidian, code, transcripts, and terminal sessions.
      10 npm
      MIT