Skip to main content

Reflective memory - remember and search documents by meaning

Project description

keep

An agent-skill for self-reflection and learning. It includes skill instructions for reflective practice, and a semantic memory system with a command-line interface.

uv tool install keep-skill       # or: pip install keep-skill
export OPENAI_API_KEY=...        # Or GEMINI_API_KEY (both do embeddings + summarization)

# Index content (store auto-initializes on first use)
keep put https://inguz.substack.com/p/keep -t topic=practice
keep put "file://$(keep config tool)/docs/library/han_verse.txt" -t type=teaching
keep put "Rate limit is 100 req/min" -t topic=api

# Search by meaning
keep find "what's the rate limit?"

# Track what you're working on
keep now "Debugging auth flow"
keep now -V 1                    # Previous intentions

# Instructions for reflection
keep reflect

What It Does

Store anything — URLs, files, notes — and keep summarizes, embeds, and tags each item. You search by meaning, not keywords. Content goes in as text, PDF, HTML, Office documents, audio, or images; what comes back is a summary with tags and semantic neighbors. Audio and image files auto-extract metadata tags (artist, album, camera, date, etc.).

What makes this more than a vector store: when you view your current context (keep now) or retrieve any item (keep get), keep automatically surfaces relevant open commitments, past learnings, and breakdowns — ranked by similarity and recency. The right things appear at the right time. That's what makes reflection real.

  • Summarize, embed, tag — URLs, files, and text are summarized and indexed on ingest
  • Contextual feedback — Open commitments and past learnings surface automatically
  • Semantic search — Find by meaning, not keywords
  • Tag organization — Speech acts, status, project, topic, type — structured and queryable
  • Strings — Every note is a string of versions; reorganize history by meaning with keep move
  • Works offline — Local models (MLX, Ollama), or API providers (OpenAI, Gemini, Voyage, Anthropic)

Backed by ChromaDB for vectors, SQLite for metadata and versions.

keepnotes.ai — Hosted service. No local setup, no API keys to manage. Same SDK, managed infrastructure.

The Practice

keep is designed as a skill for AI agents — a practice, not just a tool. The skill instructions teach agents to reflect before, during, and after action: check intentions, recognize commitments, capture learnings, notice breakdowns. keep reflect guides a structured reflection; keep now tracks current intentions and surfaces what's relevant.

This works because the tool and the skill reinforce each other. The tool stores and retrieves; the skill says when and why. An agent that uses both develops skillful action across sessions — not just recall, but looking before acting, and a deep review of outcomes afterwards.

Why build memory for AI agents? What does "reflective practice" mean here? I wrote a story: Wisdom, or Prompt-Engineering?

Integration

The skill instructions and hooks install into your agent's configuration automatically on first use (Claude Code, Kiro, OpenAI Codex, OpenClaw). Hooks inject keep now context at session start, on each prompt, and at session end — so the agent always knows its current intentions.

Layer What it does
Skill prompt Always in system prompt — guides reflection, breakdown capture, document indexing
Hooks Inject keep now -n 10 context at session start, prompt submit, and session end
Daily cron Scheduled deep reflection in an isolated session (OpenClaw cron)

The CLI alone is enough to start. The hooks make it automatic.


Installation

Python 3.11–3.13 required. Use uv (recommended) or pip:

uv tool install keep-skill

Hosted (simplest — no local setup needed):

export KEEPNOTES_API_KEY=...   # Sign up at https://keepnotes.ai

Self-hosted with API providers:

export OPENAI_API_KEY=...      # Simplest (handles both embeddings + summarization)
# Or: GEMINI_API_KEY=...       # Also does both
# Or: VOYAGE_API_KEY=... and ANTHROPIC_API_KEY=...  # Separate services

Local (offline, no API keys): If Ollama is running, keep auto-detects it. Or on macOS Apple Silicon: uv tool install 'keep-skill[local]'

See docs/QUICKSTART.md for all provider options.


Quick Start

# Index URLs, files, and notes (store auto-initializes on first use)
keep put https://inguz.substack.com/p/keep -t topic=practice
keep put "file://$(keep config tool)/docs/library/han_verse.txt" -t type=teaching
keep put "Token refresh needs clock sync" -t topic=auth

# Search
keep find "authentication flow" --limit 5
keep find "auth" --since P7D           # Last 7 days

# Retrieve
keep get file:///path/to/doc.md
keep get ID -V 1                       # Previous version
keep get "ID@V{1}"                     # Same as -V 1 (version identifier)
keep get ID --history                  # All versions

# Tags
keep list --tag project=myapp          # Find by tag
keep find "auth" -t topic=auth         # Cross-project topic search
keep list --tags=                      # List all tag keys

# Current intentions
keep now                               # Show what you're working on
keep now "Fixing login bug"            # Update intentions

Python API

from keep import Keeper

kp = Keeper()

# Index
kp.put(uri="file:///path/to/doc.md", tags={"project": "myapp"})
kp.put("Rate limit is 100 req/min", tags={"topic": "api"})

# Search
results = kp.find("rate limit", limit=5)
for r in results:
    print(f"[{r.score:.2f}] {r.summary}")

# Version history
prev = kp.get_version("doc:1", offset=1)
versions = kp.list_versions("doc:1")

See docs/QUICKSTART.md for configuration and more examples.


Documentation


License

MIT


Contributing

Published on PyPI as keep-skill.

Issues and PRs welcome:

  • Provider implementations
  • Performance improvements
  • Documentation clarity

See CONTRIBUTING.md for guidelines.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

keep_skill-0.42.2.tar.gz (790.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

keep_skill-0.42.2-py3-none-any.whl (833.6 kB view details)

Uploaded Python 3

File details

Details for the file keep_skill-0.42.2.tar.gz.

File metadata

  • Download URL: keep_skill-0.42.2.tar.gz
  • Upload date:
  • Size: 790.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for keep_skill-0.42.2.tar.gz
Algorithm Hash digest
SHA256 a9d1c94d4f56e3a2906c243a5f7514e490cea466478a320202217e2a5effb4f6
MD5 c503848232893f4e0947ccb0f6105e11
BLAKE2b-256 a8e2847d60c07a3127487a9ad9cf8d290dc6b63e968e24ed4cf8e43413a4fc2e

See more details on using hashes here.

File details

Details for the file keep_skill-0.42.2-py3-none-any.whl.

File metadata

  • Download URL: keep_skill-0.42.2-py3-none-any.whl
  • Upload date:
  • Size: 833.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for keep_skill-0.42.2-py3-none-any.whl
Algorithm Hash digest
SHA256 55b8032665b4b4c1e544499fa78738207184e1965e82e0a2fbb80b59cdca1c5a
MD5 af262b58ae86decaade92269ccffc1da
BLAKE2b-256 4818822f4b4926bc2927c67850778ae57f183e868dfae7f830334520cd47bf66

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page