Skip to main content
Glama
WhimsicalityLabs

whimsicality-db

Official

whimsicality-db

長時間実行エージェントのためのワークジャーナル。SQLiteバックエンドのMCPサーバーで、セッション追跡、イベントログ、FTS5検索を備えています — 複数のコンテキストウィンドウにまたがって作業するエージェントが、決定事項を思い出し、過去のイベントを検索し、自分の進捗を追跡できるようにします。

なぜこれが存在するのか

長期的な作業を行うエージェントには問題があります。コンテキストウィンドウが満杯になると、自分が何を決定したか、何を試したか、何が残っているかを追跡できなくなります。会話履歴がスクロールアウトし、エージェントはすでに到達した結論を再導出することになります。

whimsicality-db は、永続的なワークジャーナルでこれを解決します:

  1. セッションを作成 タスク用: db_session_create({ id: "refactor-auth", name: "Refactor auth system" })

  2. イベントを記録 発生時に: db_event_log({ session_id: "refactor-auth", event_type: "decision", content: "Chose JWT over session cookies for stateless auth" })

  3. 過去の決定を検索: db_search({ query: "auth decision", collections: ["events"] })

  4. コンテキストウィンドウをまたいでTODOを追跡: db_todo_add({ title: "Implement JWT verification", session_id: "refactor-auth" })

エージェントはコンテキストウィンドウのリセット後に戻ると、セッションログを検索して、中断したところから再開します — 会話全体を読み直すことなく。

Related MCP server: MCP Tools

クイックスタート

{
  "mcpServers": {
    "whimsicality-db": {
      "command": "npx",
      "args": ["whimsicality-db"]
    }
  }
}

データは ~/.whimsicality/db-storage/whimsicality.db に保存されます(SQLite、WALモード)。上書きするには WHIMSICALITY_DB_DIR を設定します。

whimsicality-mcp からの移行

非推奨の whimsicality-mcp パッケージを使用していた場合は、データをインポートしてください:

db_import({ source_dir: "~/.whimsicality/mcp-storage" })

メモリエントリ、ドキュメント、圧縮キャッシュチャンクを統合エントリテーブルにインポートします。

ツール(合計21、スキーマ~2,700トークン)

メモリ — キーと値のファクト(4)

Tool

Description

db_memory_set

キーと値のファクトを保存します。名前空間付き。

db_memory_get

キーで値を取得します。

db_memory_list

名前空間内のキーを一覧表示します。

db_memory_delete

メモリキーを削除します。

エントリ — 自動圧縮付き統合テキストストア(5)

古いdocs、cache、contextコレクションを置き換えます。小さなテキストはそのまま保存され、FTS5でインデックス化されます。大きなテキスト(>64KB)はbrotliで自動圧縮され、読み取り時にページングされます。タグとソースはオプションです。

Tool

Description

db_entry_save

テキストを保存します。大きい場合は自動圧縮。タグとソースはオプション。

db_entry_read

IDでエントリを読み取ります。offset+lengthによるページングをサポート。

db_entry_list

エントリを一覧表示します。タグフィルタはオプション。

db_entry_by_tags

指定されたタグのいずれかに一致するエントリを取得します。

db_entry_delete

エントリを削除します。

TODO — コンテキストウィンドウをまたいだタスク追跡(4)

Tool

Description

db_todo_add

優先度、タグ、セッションリンク付きでTODOを追加します。

db_todo_list

TODOを一覧表示します。ステータス/タグ/セッションでフィルタリング。

db_todo_update

TODOを更新します。空文字列でフィールドをクリア。

db_todo_delete

TODOを削除します。

セッション — 長期タスクのコンテナ(3)

Tool

Description

db_session_create

長期タスク用のセッションを作成または更新します。

db_session_list

セッションを一覧表示します。オプションのステータスフィルタ。idを渡すと1件取得。

db_session_update

セッションを更新します。空文字列で名前/説明をクリア。

イベント — セッションログ(2)

Tool

Description

db_event_log

セッション内のイベントを記録します。FTS5で検索可能。

db_event_list

イベントを一覧表示します。セッション/タイプでフィルタリング。

検索 + 統計 + インポート(3)

Tool

Description

db_search

コレクション全体での統合FTS5検索。BM25スコア付きのランク付けされた結果を返します。

db_stats

データベース統計:件数とサイズ。

db_import

whimsicality-mcpストレージディレクトリからデータをインポートします。

アーキテクチャ

┌──────────────────────────────────────────────────────────┐
│ SQLite Database (WAL mode)                               │
│                                                          │
│  memory       ─── memory_fts (FTS5)                     │
│  entries      ─── entries_fts (FTS5)                    │
│    ├─ small:  content_text (plain, FTS5-indexed)        │
│    └─ large:  content (brotli BLOB) + title (FTS5)      │
│  entry_tags   ── normalized tag join table               │
│  todos        ─── todos_fts  (FTS5)                     │
│  todo_tags    ── normalized tag join table               │
│  sessions     (no FTS — small, direct query)            │
│  events       ─── events_fts (FTS5)                     │
│                                                          │
│  Triggers keep FTS5 indexes in sync automatically.      │
│  WAL mode: concurrent readers + 1 writer.               │
│  CHECK constraints on status columns.                   │
│  Schema version migrations (v1→v2→v3).                  │
└──────────────────────────────────────────────────────────┘

統合検索

db_search({ query, collections, top_k }) は、メモリ、エントリ、TODO、イベントを1回の呼び出しで検索します。結果はマージされ、BM25スコア(高いほど良い)でランク付けされます。各結果には、コレクション、ID、スコア、および該当する場合はマッチ中心の抜粋が含まれます。

自動圧縮

64KBを超えるエントリは自動的にbrotli圧縮されます。タイトル/サマリーはFTS5インデックス用にプレーンテキストとして保存されます。db_entry_read はoffset+lengthページングでオンデマンドに解凍します。

ネイティブモジュールに関する注意

このパッケージはネイティブNode.jsアドオンである better-sqlite3 に依存しています。npm install は通常、プリビルドバイナリを自動的に見つけます。見つからない場合は、node-gyp がソースからコンパイルします — Python 3とC++コンパイラが必要です。Node 22.5+にはFTS5が組み込まれた node:sqlite が同梱されており、将来のゼロ依存パスです。

スキーママイグレーション

schema_version テーブルはデータベーススキーマのバージョンを追跡します。オープン時に、サーバーはバージョンを読み取り、マイグレーションを順次適用します:v1→v2(タグ結合テーブル)、v2→v3(docs/cache/contextを統合したエントリテーブル)。

どのコレクションをいつ使うか

  • メモリ: 正確なキーで呼び出したい小さなキーと値のペア(ファクト、設定)

  • エントリ: 任意のテキストコンテンツ — ドキュメント、参照、大きなコンテンツ。自動圧縮、タグはオプション、ページング読み取り

  • TODO: モデルがコンテキストウィンドウをまたいで追跡しているタスク

  • セッション: 長期タスクのコンテナ(イベントとTODOをグループ化)

  • イベント: セッション内の時系列ログ(決定、マイルストーン、エラー)

設定

Variable

Default

Description

WHIMSICALITY_DB_DIR

~/.whimsicality/db-storage

データベースストレージディレクトリ

開発

git clone https://github.com/WhimsicalityLabs/Whimsicality-DB.git
cd Whimsicality-DB
npm install
npm test

67テスト:64のインプロセステスト(ストア、検索、エントリ、TODO、セッション、イベント、バリデーション、インポート)+ 3のbinスモークテスト(実際の bin/whimsicality-db.js エントリポイントを起動)。

ライセンス

MIT

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides AI agents with persistent, searchable memory that survives across conversations using semantic search, temporal versioning, and smart organization. Enables long-term context retention and cross-session continuity for AI assistants.
    14
  • A
    license
    B
    quality
    A
    maintenance
    Provides context management and todo persistence with AI second opinions from ChatGPT and Claude. Enables saving code snippets, conversations, and todos across sessions with full-text search capabilities.
    3
    3
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Provides persistent session memory for AI assistants, enabling them to store, search, and retrieve conversation summaries across sessions via the Model Context Protocol.
    10
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables persistent multimodal context storage for LLM agents with thread-based scoping, metadata filtering, and hybrid search capabilities.
    8
    Elastic 2.0

View all related MCP servers

Related MCP Connectors

  • Persistent memory for AI agents. Search, store, and recall across sessions.

  • Universal memory for AI agents and tools. Save, organize and search context anywhere.

  • Persistent memory for AI agents — verbatim conversations, searchable by meaning.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/WhimsicalityLabs/Whimsicality-DB'

If you have feedback or need assistance with the MCP directory API, please join our Discord server