Skip to content

Memory

Terminal window
bee remember "Redis caches session tokens, not user data" \
--type decision --reason "user data has a different TTL"

Four kinds, and the kind is the point — it decides what else is worth asking for:

type also record
decision --reason, --alternative "option: why not" (repeatable)
error --solution, --prevention
learning (default) --category
pattern --category

Everything is stored in MongoDB and stamped with the project, the session, the author (from git config) and the time.

Terminal window
bee remember search "redis"
bee remember search "caching" --all-projects --since 30d
bee remember search "caching user sessions" --semantic

A search returns the union of the most recent matches and the most relevant ones, because each half alone loses things.

Measured on a store of 50,001 memories: the date-ordered half never reached a two-year-old fact that answered the question — it was buried under 50,000 newer ones. The relevance-ordered half returned it first, in 27 ms. Run the other way, relevance alone misses “what did I just do”, which is most of what an agent resuming work needs.

--semantic ranks by meaning rather than word overlap, so “caching user sessions” finds “Redis caches session tokens”.

  • Local (default) — a multilingual sentence-transformer (distiluse-base-multilingual-cased-v2, 50+ languages) run through ONNX Runtime and downloaded to ~/.bee/models/ on first use. No API call, no key.
  • Geminibee config set embedding.provider gemini plus bee config set gemini.apiKey <key> --secret.

The cosine is computed inside MongoDB and only the winners come back. Ranking in the client meant downloading every stored vector on every query — 96.5 MB at ten thousand memories, measured. It is now 1.5 KB, with bit-identical scores.

Embeddings are best-effort on save: if the backend cannot be reached the fact is still saved, and --semantic simply will not match it.

Terminal window
bee remember context # what this project has learned, most useful first
bee remember history --since 7d
bee remember stats

Memories record who wrote them, resolved from git’s config the same way rules are — repository-local identity wins over global, and linked worktrees are handled (the config lives in the main repository, not under the worktree’s .git file).

On a shared store this is what stops a teammate’s note reading as your own.