Skip to main content

RecallGate 0 API calls MIT Tests

RecallGate

Give every AI agent only the memory it needs — and nothing else.

RecallGate is a token-efficient, controllable memory gate for AI coding agents.

It helps Claude Code, Codex CLI, Cursor, Gemini CLI, Copilot-style agents, and multi-agent coding workflows stop wasting context on irrelevant history.

Without RecallGate:  1,240 tokens → $0.02 per ask → model reads everything
With RecallGate:        95 tokens → $0.001 per ask → model reads only what matters
                                                                  ▲ 92.3% cheaper

Zero dependencies. Zero API calls. Offline. One .recallgate folder.


Install

pip install recallgate
# or from source
git clone https://github.com/lamguo/recallgate.git
cd recallgate && pip install -e .

Quick start — 10 seconds to value

# 1. Init a workspace in your project
cd my-project && recall-gate init

# 2. Add project rules (they stay in Git-friendly .md files)
recall-gate add "Keep zero core dependencies." --role coder --priority high
recall-gate add "Tests use temp fixtures, not example files." --role tester
recall-gate add "README must match CLI behavior exactly." --role writer

# 3. Generate a 100-token brief for your coding agent
recall-gate brief "fix CI pipeline test failure" --role tester --budget 100

Paste the output into your AI agent. That's it.


Why you'll use this

"My AI keeps forgetting the project rules"

recall-gate correct "model keeps suggesting requests library — we use stdlib only"

Outputs a <100-token correction brief. Paste it into any AI agent. Problem solved.

"I'm burning tokens on irrelevant context"

recall-gate estimate --task "fix tests" --role tester --json

Returns structured data: {"full_active_memory_tokens": 1240, "injected_brief_tokens": 95, "estimated_saving_percent": 92.3}. Know your savings before you inject.

"Coder, tester, and writer agents need different context"

recall-gate brief "fix deployment" --role coder     # sees deployment rules
recall-gate brief "update docs"   --role writer     # sees README guidelines
recall-gate brief "review PR"     --role reviewer    # sees audit checklist

Each agent role sees only its relevant memories. Shared rules go to --role all.

"I have 50 memories and don't know what's stale"

recall-gate review --apply          # auto-archive low-value memories
recall-gate list --sort use_count   # see what's never been used
recall-gate search "fixtures"       # find without opening index.json

Features

What Why it matters
🎯 Role-filtered briefs Coder gets coding rules, writer gets docs rules, tester gets test rules
✂️ Token budget control Set default_budget = 100 in config — briefs are hard-capped
🔄 Memory lifecycle active → archive → trash → delete. Nothing lost by accident
🔧 Edit in place recall-gate edit mem_0001 --priority critical — no delete+re-create
🔍 Full-text search Searches content, short text, keywords, scope, type, priority
📦 JSON output --json on every command — pipe into scripts, editors, MCP
📂 Git-friendly storage Each memory is a .md file with YAML frontmatter. Diff, commit, review
🌐 CJK support Chinese memory gets readable slugs and meaningful keywords
🧼 Auto-review recall-gate review --apply archives unused memories automatically

Memory lifecycle

active   → readable by default
archive  → hidden but recoverable
trash    → blocked from agents, still recoverable
deleted  → permanently removed from index and disk

Role-based routing

Every memory targets one or more roles. --role all means everyone sees it.

recall-gate brief "fix tests"    --role tester     # only tester memories
recall-gate brief "update README" --role writer    # only writer memories
recall-gate brief "review"       --role reviewer   # only reviewer memories

The goal: Shared outline, private depth.


Command reference

recall-gate
  init                           Create workspace
  add <content>                  Add a memory
  edit/update <id>               Edit memory fields
  info <id>                      Full memory details
  list [--sort] [--reverse]      List memories
  search <query>                 Full-text search
  brief <task>                   Token-efficient memory brief
  correct <issue>                Correction brief (model forgets)
  estimate                       Token cost estimate
  review [--apply]               Suggest/apply cleanup
  archive / trash / restore      Lifecycle commands
  promote <id>                   Move conversation to project
  delete <id> --yes              Permanent removal

Global flags:
  --json      Machine-readable output on all commands
  --root      Target a specific workspace (for automation)

About injection

brief prints plain text by design in v0.1.0. You copy the output into Claude Code, Codex CLI, Cursor, Gemini CLI, Copilot Chat, or any other coding agent.

Automatic injection is intentionally not included in the first version because the core tool should stay local, predictable, and provider-agnostic. Future integrations can add MCP, editor plugins, or agent hooks on top of the same brief engine.


Design philosophy

Default model calls:       0
Default API keys:          0
Default runtime deps:      0
Default storage:           local Markdown + JSON
Default tokenizer:         built-in estimator
Default test discovery:    python -m unittest discover

RecallGate is built to be cheap, local, and predictable. No vector database. No LLM calls. No network. No vendor lock-in. You commit your .recallgate folder to Git, and every teammate gets the same memory.

What RecallGate is

  • A local memory gate
  • A memory firewall
  • A token-saving brief generator
  • A role-based memory router
  • A stale model memory correction layer

What RecallGate is not

  • Not a hosted memory service
  • Not a vector database
  • Not a full AI agent framework
  • Not a replacement for Claude Code, Codex, Cursor, or Copilot
  • Not a tool that blindly remembers everything

Status

v0.1.0 — alpha MVP with 31 unit tests, 0 dependencies, and 17 CLI commands.

Coming next: MCP server, editor plugins, auto-conflict detection, and optional AI compression.

License

MIT

Metadata

Release files for recallgate 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for recallgate 0.1.0
File Size Uploaded Provenance
recallgate-0.1.0.tar.gz 24.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for recallgate 0.1.0
File Interpreter ABI Platform
recallgate-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 42.6 kB

Release files / recallgate-0.1.0.tar.gz

Download URL recallgate-0.1.0.tar.gz
Size 24.2 kB
Tags Source
SHA-256 checksum
How to use checksums
58af6bafa82f1f0aedba0da135168f3bf24281cda81f83743b54aed0f840ff39
BLAKE2b-256 checksum
How to use checksums
136c24058301615ca9f1168669cedaa192b188909333743d891931af1dad493e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / recallgate-0.1.0-py3-none-any.whl

Download URL recallgate-0.1.0-py3-none-any.whl
Size 18.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d46931f0e025f8947ae8d071b9100d3ae939546c476ed9fa85b3f990c063ccb
BLAKE2b-256 checksum
How to use checksums
4be2cb6b0da88c5946c8c08596312fe6e6071de6a213874b32b88f25d2843de4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Security for recallgate 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page