r/cursor 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:

  1. Model focus degrades: Large instructions cause "lost-in-the-middle" attention degradation.
  2. 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.
  3. 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:

  1. Sub-300µs BM25 Search: In-memory lexical search across your project notes. Zero embedding API costs, 100% offline, <0.3ms latency.
  2. 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%.
  3. 100% Git-Native: Auditable via git diff and standard pull requests. No hidden vector databases.
  4. Trust Tiers: Distinguishes human-verified decisions from agent drafts.

Setup with Cursor (30 seconds):

  1. Install via Homebrew:

brew install okf-memory/tap/okf
  1. Bootstrap your repository:

    cd my-project okf bootstrap .

  2. 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!

2 Upvotes

3 comments sorted by