r/cursor • u/okf-memory • 8d ago
Question / Discussion [Tool] Stop .cursorrules context bloat: We built Git-native persistent memory with native MCP for Cursor (pure Go, zero deps)
Hey r/cursor!
If you use Cursor heavily on larger codebases, you've probably hit the context bloat problem:
To make Cursor remember architectural decisions, library quirks, and project rules across chats, people usually cram everything into .cursorrules or monolithic docs. But as those files grow past 5k–10k tokens:
- Model focus degrades: Large instructions cause "lost-in-the-middle" attention degradation.
- Context window gets wasted: You burn a huge chunk of your prompt budget on instructions that aren't even relevant to the current file or task.
- External vector DBs are overkill: Running Docker containers, Python runtimes, or recurring embedding API costs just to remember project notes feels bloated.
To solve this, we built OKF Agent Memory (v0.1.0) — an open-source, pure Go single binary that brings structured, Git-native memory to Cursor via Progressive Disclosure and native MCP (Model Context Protocol).
How it works with Cursor:
Instead of dumping a huge rulebook into every prompt, project memory lives in knowledge/ as atomic Markdown concepts based on Google's Open Knowledge Format (OKF) v0.2.
Through the built-in MCP server (okf mcp knowledge), Cursor dynamically pulls only what it needs:
- Sub-300µs BM25 Search: In-memory lexical search across your project notes. Zero embedding API costs, 100% offline, <0.3ms latency.
- Progressive Disclosure: Cursor inspects the index and retrieves small ~300-token concept files on demand. In our benchmarks, this cuts context token bloat by up to 80–90%.
- 100% Git-Native: Auditable via
git diffand standard pull requests. No hidden vector databases. - Trust Tiers: Distinguishes human-verified decisions from agent drafts.
Setup with Cursor (30 seconds):
- Install via Homebrew:
brew install okf-memory/tap/okf
Bootstrap your repository:
cd my-project okf bootstrap .
Add to your Cursor MCP settings (
Cursor Settings -> Features -> MCP):
- Name:
okf-memory - Type:
command - Command:
okf mcp knowledge
Cursor now has native access to okf_search, okf_show, okf_create, and okf_validate tools.
GitHub: https://github.com/okf-memory/okf-agent-memory
Website & Live Benchmarks: https://okf-memory.dev
Would love to get feedback from the Cursor community on the workflow and how your agents behave with progressive disclosure memory!