whimsicality-db
OfficialClick on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@whimsicality-dbSearch my context index for the tag 'security' and summarize the relevant entries."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
whimsicality-db
A work journal for long-running agents. SQLite-backed MCP server with session tracking, event logging, and FTS5 search — so agents working across multiple context windows can recall decisions, search past events, and track their own progress.
[](https://m8ven.ai/mcp/whimsicalitylabs-whimsicality-db-14jklr
Why this exists
Agents doing long-horizon work have a problem: when the context window fills up, they lose track of what they decided, what they tried, and what's left to do. The conversation history scrolls off, and the agent re-derives conclusions it already reached.
whimsicality-db solves this with a persistent work journal:
Create a session for the task:
db_session_create({ id: "refactor-auth", name: "Refactor auth system" })Log events as they happen:
db_event_log({ sid: "refactor-auth", type: "decision", content: "Chose JWT over session cookies for stateless auth" })Search past decisions:
db_search({ query: "auth decision", collections: ["events"] })Track todos across context windows:
db_todo_add({ title: "Implement JWT verification", sid: "refactor-auth" })
When the agent comes back after a context window reset, it searches the session log and picks up where it left off — without re-reading the entire conversation.
Related MCP server: MCP Tools
Quick start
{
"mcpServers": {
"whimsicality-db": {
"command": "npx",
"args": ["whimsicality-db"]
}
}
}Data is stored at ~/.whimsicality/db-storage/whimsicality.db (SQLite, WAL mode). Set WHIMSICALITY_DB_DIR to override.
Migrating from whimsicality-mcp
If you used the deprecated whimsicality-mcp package, import your data:
db_import({ path: "~/.whimsicality/mcp-storage" })Imports memory entries, documents, and compressed cache chunks into the unified entries table.
Tools (21 total, ~2,700 tokens of schema)
Memory — key-value facts (4)
Tool | Description |
| Store a key-value fact. Namespaced. |
| Recall a value by key. |
| List keys in a namespace. |
| Delete a memory key. |
Entries — unified text store with auto-compression (5)
Replaces the old docs, cache, and context collections. Small text is stored as-is and FTS5-indexed. Large text (>64KB) is auto-compressed with brotli; the first 10K chars are kept as plain text for FTS5 indexing, and full content is paged on read via db_entry_read. Tags and source are optional. Saving to an existing id replaces content, title, and tags entirely (upsert).
Tool | Description |
| Store text. Auto-compresses >64KB. When compressed, first 10K chars are FTS-indexed. Upsert: replaces content, title, and tags entirely. |
| Read entry by ID. Supports paging via offset+length. |
| List entries. Optional tag filter. |
| Get entries matching any of the given tags. |
| Delete an entry. |
Todos — task tracking across context windows (4)
Tool | Description |
| Add a todo with priority (integer 0-100), tags, session link (sid). |
| List todos. Filter by status/tag/session. |
| Update a todo. Empty string clears a field. |
| Delete a todo. |
Sessions — long-horizon task containers (3)
Tool | Description |
| Create or update a session for long-horizon tasks. |
| List sessions. Optional status filter. Pass id to get one. |
| Update session. Empty string clears name/description. |
Events — session log (2)
Tool | Description |
| Log an event in a session (sid). FTS5-searchable. Session must exist. |
| List events. Filter by session/type. |
Search + stats + import (3)
Tool | Description |
| Unified FTS5 search across collections. Returns ranked results with BM25 scores. |
| Database statistics: counts and size. |
| Import data from whimsicality-mcp storage directory. |
Architecture
┌──────────────────────────────────────────────────────────┐
│ SQLite Database (WAL mode) │
│ │
│ memory ─── memory_fts (FTS5) │
│ entries ─── entries_fts (FTS5) │
│ ├─ small: content_text (plain, FTS5-indexed) │
│ └─ large: content (brotli BLOB) + first 10K (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). │
└──────────────────────────────────────────────────────────┘Unified search
db_search({ query, collections, k }) searches across memory, entries, todos, and events in one call. Results are merged and ranked by BM25 score (higher = better). Each result includes its collection, ID, score, and a match-centered excerpt where applicable. For compressed entries, only the first 10K chars of content are indexed — use db_entry_read for full content.
Auto-compression
Entries above 64KB are automatically brotli-compressed. The first 10K chars of content are stored as plain text for FTS5 indexing. db_entry_read decompresses on demand with offset+length paging.
Native module note
This package depends on better-sqlite3, a native Node.js addon. npm install usually finds prebuilt binaries automatically. If not, node-gyp compiles from source — you'll need Python 3 and a C++ compiler. Node 22.5+ ships node:sqlite with FTS5 built in, which is a future zero-dependency path.
Schema migrations
The schema_version table tracks the database schema version. On open, the server reads the version and applies migrations sequentially: v1→v2 (tag join tables), v2→v3 (unified entries table merging docs/cache/context).
When to use which collection
Memory: small key-value pairs you want to recall by exact key (facts, config)
Entries: any text content — documents, references, large content. Auto-compresses, tags optional, paged reads
Todos: tasks the model is tracking across context windows
Sessions: long-horizon task containers (group events and todos)
Events: chronological log within a session (decisions, milestones, errors)
Configuration
Variable | Default | Description |
|
| Database storage directory |
Development
git clone https://github.com/WhimsicalityLabs/Whimsicality-DB.git
cd Whimsicality-DB
npm install
npm test75 tests: 72 in-process (store, search, entries, todos, sessions, events, validation, import, bugfixes) + 3 bin smoke (spawns the actual bin/whimsicality-db.js entry point).
License
MIT
This server cannot be deployed
Maintenance
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. Search and store durable facts, preferences and decisions.
Universal persistent memory and knowledge retrieval layer for AI agents and LLMs.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides 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-
- AlicenseBqualityAmaintenanceProvides 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.33MIT
- AlicenseNot gradedqualityAmaintenanceEnables persistent multimodal context storage for LLM agents with thread-based scoping, metadata filtering, and hybrid search capabilities.9Elastic 2.0
- AlicenseAqualityDmaintenanceProvides persistent key-value storage with full-text search, tags, and namespaces for AI agents to maintain context across sessions.7MIT