Skip to main content
Glama
Rajwantmishra

agent-logbook

agent-logbook

Local SQLite long-term memory for AI assistants, served over MCP. Context window = working memory. This database = long-term memory.

Every decision logged, nothing erased: agent-logbook writes distilled facts and decisions to a plain SQLite file as your assistant works, ranks them by relevance and salience so retrieval stays cheap no matter how old the project gets, and keeps a full supersession chain when something changes — so you can always ask "why did we think that before."

Install

pip install agent-logbook

Related MCP server: MCPMem

Quickstart

cd your-project
agent-logbook-init

That's it — init detects which agentic tool you're using and wires up both the MCP server registration and the memory-protocol instructions for it.

Works with

Tool

Instructions written to

MCP config written to

Claude Code

CLAUDE.md

.mcp.json

Cursor

.cursor/rules/agent-logbook-memory.mdc

.cursor/mcp.json

GitHub Copilot

.github/copilot-instructions.md

.vscode/mcp.json

init never clobbers an existing config file — it merges in a memory server entry alongside whatever's already there, and the protocol block is idempotent (rerun it as many times as you want). If none of these three are detected, it prints the protocol text and a generic MCP config snippet for you to adapt by hand — see IMPLEMENTATION_GUIDE.md for the manual steps and agent-logbook-init --help for --dry-run and --tool to force a specific one.

Because the underlying intelligence (conflict checks, budgeted retrieval, supersession) lives in the server, not the prompt, any MCP-compatible client gets the same guarantees — the three above are just the ones init knows how to wire up automatically today.

The seven tools, in plain terms

agent-logbook exposes seven MCP tools. Your assistant calls these itself — you never type them — but here's what each one actually does, since the names alone don't tell the whole story:

Tool

In plain terms

Example

recall(query)

"What do we already know about this?" Ranked, budget-capped retrieval — it never returns more than a fixed token budget, no matter how much history exists.

recall("auth token expiry") → finds "Auth tokens are JWT, 15 minute expiry, refreshed via httpOnly cookie."

remember(type, content, entity)

"Write this down." Saves one distilled fact or decision. If a live memory already exists for the same entity, it refuses to write and hands back the conflict instead of silently overwriting.

remember("fact", "Auth tokens are JWT, 15 minute expiry", entity="auth"){"written": true, "id": 2}

supersede(old_id, new_content)

"That decision changed — replace it, but keep the history." Nothing is deleted; the old row is marked superseded and linked to the new one.

supersede(1, "Switched the stack to Django after all") → old entry hidden from recall, new one becomes the live version, both still visible in memory_history

list_open(type)

"What's still unresolved?" Lists open tasks and questions.

list_open()[{"type": "task", "content": "Add rate limiting to /login"}]

set_status(memory_id, status)

"Mark this done" (or dropped, or reopen it with open).

set_status(5, "done")

memory_history(memory_id)

"How did we get here?" Walks a memory's full supersession chain, oldest to newest.

memory_history(1)["Use Postgres for the main store", "Use SQLite (simpler ops)"]

memory_stats()

A health check, plus the savings numbers this whole project is about: how many memories exist, how many recalls have happened, and the savings_ratio — roughly how many raw reads a budgeted recall is saving you.

memory_stats(){"total": 3, "live": 2, "recall_count": 2, "savings_ratio": 2.0, ...}

Explore what's stored

agent-logbook-viewer --dir /path/to/projects

Generates a self-contained HTML report comparing every project's memory database it finds — savings metrics (recall count, tokens served, savings ratio) side by side, plus a searchable table of each project's actual stored memories. Point it at one --db path or a parent folder containing several projects.

Docs: IMPLEMENTATION_GUIDE.md (architecture + setup) and TESTING_GUIDE.md (test strategy).

Development

pip install -e ".[dev]" && pytest

Available Tools

7 tools
list_openB

List open tasks and questions (optionally filter by type: 'task' or 'question'). Call when planning what to do next.

ParametersJSON Schema
NameRequiredDescriptionDefault
typeNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It describes the tool's function but does not disclose whether it is read-only, any side effects, or rate limits. The description implies a safe operation but does not state it explicitly.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that immediately conveys purpose and usage context. It is perfectly concise with no unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the output schema exists, return values are covered. However, the description does not mention that the tool is read-only or that it does not modify state, which would be helpful since no annotations are present. Adequate but could be more complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description adds meaning by explaining the optional 'type' parameter can filter by 'task' or 'question'. This goes beyond the schema's type definition (anyOf string/null) and default value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it lists 'open tasks and questions' with optional filtering, which is a specific verb+resource. It does not explicitly distinguish from siblings, but the sibling tools are memory-related, implying this tool is about listing actionable items.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes 'Call when planning what to do next,' providing clear context for use. However, it does not specify when not to use or mention alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

memory_historyB

Show the full supersession chain for a memory — how a fact/decision evolved over time. Useful for 'why did we think X before?' questions.

ParametersJSON Schema
NameRequiredDescriptionDefault
memory_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It describes the read-like behavior but does not explicitly state it is safe, nor disclose any side effects, auth needs, or limitations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, no wasted words, front-loaded with the core action. Efficient and to the point.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema exists, so return values need not be described. However, the description lacks usage guidelines and parameter details, making it minimally complete for the tool's simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and the tool description does not explain the memory_id parameter beyond its name. For a single integer parameter, the name is somewhat clear, but additional context like valid range or source would help.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool shows the full supersession chain for a memory, which is a specific verb and resource. It implicitly distinguishes from siblings by focusing on history, but does not explicitly differentiate from tools like memory_stats or recall.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides a brief use case ('why did we think X before?') but does not specify when to use this tool versus alternatives, nor any exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

memory_statsA

Counts of total/live memories and open items. Cheap health check. Also reports token-usage metrics: recall_count, avg_tokens_per_recall, total_tokens_served (lifetime tokens returned by recall), live_corpus_tokens (estimated tokens across all live memories), and savings_ratio (live_corpus_tokens / avg_tokens_per_recall — roughly how many recalls it would take to read the whole corpus instead of a budgeted slice; null if no recalls have happened yet).

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description fully discloses the tool's behavior: it returns counts and token-usage metrics, explains each metric (e.g., savings_ratio), and notes it's non-destructive. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences: the first covers the main counts and cheapness, the second details token metrics. While clear and front-loaded, the parenthetical 'roughly how many recalls...' could be more concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given zero parameters and the presence of an output schema, the description adequately explains return values. It omits explicit sibling comparisons but the tool's purpose is clear. Minor room for improvement.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, so schema coverage is 100%. The description adds value by explaining the returned metrics beyond the input schema, which is sufficient for a zero-parameter tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool reports counts of total/live memories and open items, and describes it as a cheap health check. This distinguishes it from siblings like recall or remember, which handle specific memory operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'cheap health check' implies lightweight, suitable for quick status. However, there is no explicit guidance on when to use this tool over siblings like list_open or memory_history, nor exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

recallA

Retrieve relevant long-term memories for the current task. Call this at the START of any task before doing work. Returns ranked memories (facts, decisions, open tasks/questions) within a token budget, plus a count of open items. query should be a few keywords describing the task.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes
typesNo
budget_tokensNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Describes return structure (ranked memories, open items count) and query hint. Lacks detail on budget_tokens behavior (e.g., truncation) and error handling. No annotations to supplement.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, front-loaded with purpose and usage, no wasted words. Efficient and clear.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers key aspects: what it retrieves, when to use, query hint. Missing explanation of 'types' and specific behavior under token limit. Output schema exists but not detailed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Explains query parameter well ('few keywords'). Mentions token budget generically. Does not describe 'types' parameter or default/behavior of budget_tokens, partially compensating for 0% schema description coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states the verb (retrieve), resource (long-term memories), and context (current task). Distinguishes from siblings like 'remember' (store) and 'list_open'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says 'Call this at the START of any task before doing work', providing strong when-to-use guidance. Does not mention when not to use or alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

rememberA

Persist ONE distilled memory after completing a work block. type is one of: fact, decision, task, question, note. content must be 1-2 sentences, self-contained, in past/declarative form (a distillation — never a raw transcript). entity is a short slug for what it concerns (e.g. 'auth', 'db-choice'). If a live memory already exists for the same type+entity, this returns a CONFLICT without writing — then either supersede(old_id,...) to update it, ask the user which stands, or retry with force=true to keep both.

ParametersJSON Schema
NameRequiredDescriptionDefault
typeYes
forceNo
entityNo
contentYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses key behavior: returns CONFLICT without writing if a live memory exists for same type+entity. Also specifies content constraints. With no annotations, this is good coverage, though it doesn't mention other aspects like idempotency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single dense paragraph that is concise and front-loaded with the core purpose. Some slightly excessive detail could be structured, but overall very efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers input semantics, conflict behavior, and references sibling tools. Since output schema exists, lack of return value explanation is acceptable. Complete for the tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema coverage, the description fully explains all parameters: type enum values, content format (1-2 sentences, past/declarative), entity as short slug, and force as conflict resolution overwrite.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: persisting one distilled memory after a work block. It specifies the structure of type, content, and entity, and distinguishes itself from siblings like supersede by explaining conflict resolution.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says when to use (after completing a work block) and what to do when a conflict occurs (use supersede, ask user, or force). Provides clear alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

set_statusB

Mark a task/question as 'done' or 'dropped' (or reopen with 'open').

ParametersJSON Schema
NameRequiredDescriptionDefault
statusYes
memory_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description bears full burden. It only states the status options without explaining side effects, permissions, or reversibility. This is insufficient for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no redundant words. Every part contributes meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (2 params, no annotations), the description is adequate but lacks detail on return value (despite existing output schema) and prerequisites. It meets minimum viability.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema coverage, the description adds value by listing valid status values ('done', 'dropped', 'open'). However, it provides no additional meaning for 'memory_id', which remains unclear beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's action ('mark as done/dropped/open') and the resource type ('task/question'). It distinguishes the primary function from sibling tools like list_open or memory_history, though it doesn't explicitly contrast with them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for changing status to the listed values, but provides no when-to-use or when-not-to-use guidance. No alternatives are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

supersedeA

Replace an outdated memory with an updated one. The old memory is kept in the chain for history (never deleted). Use this when a decision or fact has changed.

ParametersJSON Schema
NameRequiredDescriptionDefault
old_idYes
new_contentYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behaviors. It states the old memory is retained (non-destructive), but does not detail permissions, reversibility, or side effects beyond that. Adequate but not comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences with no redundant information. The key points (replace, keep old, when to use) are front-loaded. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (not shown), the description need not detail returns. The simple replace operation is adequately described for an agent to understand its core behavior, though parameter semantics could be improved.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 2 parameters with 0% description coverage. The description implies 'old_id' identifies an outdated memory and 'new_content' provides updated content, but does not explain how IDs are resolved or the expected format of new_content. Minimal added value beyond schema names.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (replace), the resource (memory), and the key behavior (old memory kept for history). It distinguishes from siblings like 'remember' and 'recall' by specifying memory supersedure.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit guidance on when to use: 'when a decision or fact has changed'. It also clarifies that the old memory is never deleted, preventing misuse. No explicit when-not-to-use, but the positive guidance is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 7 tool updatesv0.1.1
    • First observedlist_open
    • First observedmemory_history
    • First observedmemory_stats
    • First observedrecall
    • First observedremember
    • First observedset_status
    • First observedsupersede

TDQS

A3.6/5.0

Scored across 7 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: listing open items, showing memory history, stats, recalling, remembering, setting status, and superseding. No two tools overlap in functionality.

Naming Consistency2/5

Names are inconsistent: some are verb_noun (list_open, set_status), some are noun_noun (memory_history, memory_stats), and others are single verbs (recall, remember, supersede). No uniform pattern.

Tool Count5/5

Seven tools is an appropriate number for a memory/logbook system. Each tool handles a distinct operation without being too many or too few.

Completeness4/5

The tool set covers creation, retrieval, update (via supersede and set_status), and history for memories. Missing explicit deletion or a way to list all memories, but these gaps are minor for the intended purpose.

Related MCP Connectors

Related MCP Servers

  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    Provides persistent local memory functionality for AI assistants, enabling them to store, retrieve, and search contextual information across conversations with SQLite-based full-text search. All data stays private on your machine while dramatically improving context retention and personalized assistance.
    3
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to store and retrieve memories with semantic search capabilities using vector embeddings. Provides persistent memory storage with SQLite backend for context retention across conversations.
    50 npm
    1
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Provides persistent cross-session memory and full-text search for AI coding assistants, storing project context, decisions, and preferences while enabling searchable access to conversation history via local SQLite.
    8
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Gives AI coding agents persistent memory by storing observations, decisions, and learnings in a local SQLite database with vector search, full-text search, and a rules engine.
    4
    MIT