Skip to main content
Glama

tidbits-memory

A memory/tidbits voting framework for AI agents. Agents can record learnings (facts, methods, gotchas) and vote on them to surface the most useful tidbits.

Installation

uv pip install -e ".[dev]"

Quick start

from tidbits_memory.adapters.memory import InMemoryAdapter
from tidbits_memory.store import MemoryStore

store = MemoryStore(InMemoryAdapter())

# Create a voter id for this session
voter_id = store.create_voter_id()

# Create a memory
mem = store.create_memory("Python dicts preserve insertion order since 3.7", voter_id=voter_id)

# Get memories (random order, no vote counts) — ideal for agent consumption
result = store.get_memories(voter_id=voter_id)
print(result["memories"])

# Upvote a useful memory
store.upvote_memory(mem.id, voter_id="another-session-id")

# List memories sorted by votes (most upvoted first)
for m in store.list_memories():
    print(f"[{m.votes}] {m.content}")

# Downvote an erroneous memory
store.downvote_memory(mem.id, voter_id="yet-another-session")

# Unvote (remove a prior vote)
store.unvote_memory(mem.id, "another-session-id")

# Remove a memory
store.remove_memory(mem.id)

Persistent storage (JSON file)

from tidbits_memory.adapters.json_file import JsonFileAdapter
from tidbits_memory.store import MemoryStore

store = MemoryStore(JsonFileAdapter("memories.json"))
store.create_memory("Use `uv` for fast Python packaging")

Voter ID generation

When an agent doesn't have a session/conversation ID, use create_voter_id:

voter_id = store.create_voter_id()
# Use this voter_id for all votes in this session

If no voter_id is provided when calling get_memories, one is automatically generated and returned in the response.

MCP Tool Wrappers

from mcp.server import FastMCP
from tidbits_memory.adapters.memory import InMemoryAdapter
from tidbits_memory.store import MemoryStore
from tidbits_memory.tools import register_tools

store = MemoryStore(InMemoryAdapter())
mcp = FastMCP("tidbits")
register_tools(mcp, store)

# Registered tool names:
# create_memory, upvote_memory, downvote_memory, unvote_memory,
# list_memory, get_memories, remove_memory, create_voter_id

Running tests

uv run pytest

Available Tools

8 tools
create_memoryC

Create a new memory/tidbit. Returns the created memory with its id.

Inputs: content (required), creator, tags, voter_id. Returns: object

create_voter_idB

Generate a new unique voter_id for this agent session.

Inputs: no named parameters. Returns: object

downvote_memoryB

Downvote a memory. Provide voter_id to enforce one vote per session.

Inputs: memory_id (required), voter_id. Returns: object

get_memoriesB

Get the list of memories.If voter_id is not provided, a new one is generated and included in the response for use in subsequent votes.

Inputs: voter_id. Returns: object

list_memoryB

List all memories sorted by votes descending (most upvoted first).

Inputs: order_by, limit. Returns: result

remove_memoryB

Remove a memory by id.

Inputs: memory_id (required). Returns: object

unvote_memoryC

Remove a prior vote from a memory by voter_id.

Inputs: memory_id (required), voter_id (required). Returns: object

upvote_memoryB

Upvote a memory. Provide voter_id to enforce one vote per session.

Inputs: memory_id (required), voter_id. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 8 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no ambiguity: create_memory, create_voter_id, downvote_memory, get_memories, list_memory, remove_memory, unvote_memory, and upvote_memory. The actions (create, get, list, remove, upvote, downvote, unvote) and targets (memory, voter_id) are well-defined and non-overlapping.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern using snake_case (e.g., create_memory, downvote_memory, get_memories). The naming is predictable and uniform across all eight tools, with no deviations in style or convention.

    Tool Count5/5

    With 8 tools, the count is well-scoped for a memory/voting system. Each tool serves a specific function in managing memories and votes, and none appear redundant or unnecessary for the server's purpose.

    Completeness5/5

    The tool set provides complete coverage for the memory and voting domain: CRUD operations (create, get/list, remove), voting lifecycle (upvote, downvote, unvote), and voter management (create_voter_id). There are no obvious gaps, and agents can handle all core workflows without dead ends.

    Related MCP Connectors