# How to give Cursor better memory

Cursor states that large language models do not retain memory between completions ([Cursor docs](https://cursor.com/docs/rules)). Rules provide [persistent, reusable context](https://www.knowman.io/guides/ai-agent-memory) at the prompt level, and when a rule is applied, its contents are included at the start of the model context ([Cursor docs](https://cursor.com/docs/rules)). KnowMan adds a different layer: [saved articles](https://www.knowman.io/guides/how-to-save-articles) and memories exposed through an [MCP server](https://www.knowman.io/guides/mcp-server-knowledge-base) that runs locally with `npx -y @knowman/mcp` or as a hosted server at https://api.knowman.io/mcp.

## What Cursor memory is

Cursor states that large language models do not retain memory between completions ([Cursor docs](https://cursor.com/docs/rules)). Rules provide persistent, reusable context at the prompt level, and Cursor defines them as system-level instructions to its Agent ([Cursor docs](https://cursor.com/docs/rules)). When a rule is applied, its contents are included at the start of the model context ([Cursor docs](https://cursor.com/docs/rules)).

AGENTS.md is a simple markdown file for [defining agent instructions](https://www.knowman.io/guides/opencode-memory), placed in the project root as an alternative to `.cursor/rules` ([Cursor docs](https://cursor.com/docs/rules)). Together, Rules and AGENTS.md files are where you put [context that should persist](https://www.knowman.io/guides/ai-memory-for-individuals) across completions.

## Start with Project Rules

[Project Rules](https://www.knowman.io/guides/knowledge-base-for-ai-agents) are stored in `.cursor/rules`, are version-controlled, and are scoped to your codebase ([Cursor docs](https://cursor.com/docs/rules)). Rule files must use the `.mdc` extension ([Cursor docs](https://cursor.com/docs/rules)). Project rules are scoped using path patterns, invoked manually, or included based on relevance ([Cursor docs](https://cursor.com/docs/rules)).

Cursor advises checking rules into git so the whole team benefits ([Cursor docs](https://cursor.com/docs/rules)). You can also ask the Cursor agent in chat to create a new rule for you ([Cursor docs](https://cursor.com/docs/rules)).

## Control when a rule applies

A rule with `alwaysApply` set to true is always included, and its globs and description are ignored ([Cursor docs](https://cursor.com/docs/rules)). With `alwaysApply` false and globs provided, the rule is auto-attached when a matching file is in context ([Cursor docs](https://cursor.com/docs/rules)). With `alwaysApply` false, a description, and no globs, the Agent reads the description and pulls the rule in when relevant ([Cursor docs](https://cursor.com/docs/rules)).

You can also @mention rules in chat to apply them manually ([Cursor docs](https://cursor.com/docs/rules)). Cursor says to put anything that must always be in context directly in the rule body ([Cursor docs](https://cursor.com/docs/rules)).

## Use AGENTS.md for simpler projects

AGENTS.md is a simple markdown file for defining [agent instructions](https://www.knowman.io/guides/give-your-ai-context), placed in the project root as an alternative to `.cursor/rules` for straightforward use cases ([Cursor docs](https://cursor.com/docs/rules)). You can place AGENTS.md files in any subdirectory, and they are applied automatically when you work with files in that directory or its children ([Cursor docs](https://cursor.com/docs/rules)).

Instructions from nested AGENTS.md files are combined with parent directories, with more specific instructions taking precedence ([Cursor docs](https://cursor.com/docs/rules)).

## User Rules and Team Rules

User Rules are global preferences defined in Customize → Rules that apply across all projects ([Cursor docs](https://cursor.com/docs/rules)). Team Rules are team-wide rules managed from the dashboard and available on Team and Enterprise plans ([Cursor docs](https://cursor.com/docs/rules)).

All applicable rules are merged, and when guidance conflicts, earlier sources take precedence in the order Team Rules → Project Rules → User Rules ([Cursor docs](https://cursor.com/docs/rules)). Rules do not impact Cursor Tab or other AI features ([Cursor docs](https://cursor.com/docs/rules)).

## Limits to keep in mind

Cursor's best practice is to keep rules under 500 lines ([Cursor docs](https://cursor.com/docs/rules)). It recommends referencing files instead of copying their contents, which keeps rules short and prevents them from becoming stale as code changes ([Cursor docs](https://cursor.com/docs/rules)). Referenced file contents are not inlined into the prompt, and this is the same in the editor, the CLI, and Cloud Agents ([Cursor docs](https://cursor.com/docs/rules)).

To bring rules in from a GitHub repository, you must package them in a plugin and publish that plugin through a marketplace ([Cursor docs](https://cursor.com/docs/rules)).

## The KnowMan MCP server

KnowMan ships a standalone MCP server that runs locally over stdio: the `@knowman/mcp` package, started with `npx -y @knowman/mcp` on Node 22 or newer. It talks to KnowMan's HTTP API with a Bearer key in the environment variable `KNOWMAN_API_KEY`; keys look like `km_...` and are created at Settings > Connections > Connect an AI agent. KnowMan also runs as a hosted remote server at https://api.knowman.io/mcp, reachable with OAuth sign-in or an API key sent as `Authorization: Bearer <key>`, which suits clients that accept remote MCP servers.

`kb_search` finds saved items by keyword or meaning and returns titles, URLs, and metadata; `kb_ask` [answers questions with citations](https://www.knowman.io/guides/ai-knowledge-base); `kb_memories` returns saved claims, decisions, and playbooks. The server also exposes `kb_get_item`, `kb_save`, and `kb_recent`. The KnowMan README lists Claude Desktop, [Claude Code](https://www.knowman.io/guides/claude-code-knowledge-base), and Cursor as documented clients. For the wider pattern, see the [MCP server knowledge base](https://www.knowman.io/guides/mcp-server-knowledge-base) guide.

## Where KnowMan fits

Cursor defines Rules as system-level instructions to its Agent, and AGENTS.md as a markdown file for agent instructions ([Cursor docs](https://cursor.com/docs/rules)). KnowMan does a different job: it [saves articles and links](https://www.knowman.io/guides/personal-knowledge-base), reads and tags them, answers questions with citations, and keeps memories of claims, decisions, and playbooks.

The Free plan includes five Ask questions a day, and Pro is $12.99 a month or $99 a year. To go deeper, read about [persistent memory for AI agents](https://www.knowman.io/guides/persistent-memory-for-ai-agents) or [a knowledge base for AI agents](https://www.knowman.io/guides/knowledge-base-for-ai-agents).

## Use the hosted KnowMan server in Cursor

KnowMan also runs as a hosted remote server at https://api.knowman.io/mcp, so you can add it to Cursor as a remote MCP server instead of running a local process. With OAuth, the client opens a KnowMan consent page where you approve the knowman.read and knowman.write scopes. Access tokens last one hour and refresh automatically.

Alternatively, create an API key in KnowMan settings and add the server to Cursor's mcp.json with the header: `{"mcpServers":{"knowman":{"url":"https://api.knowman.io/mcp","headers":{"Authorization":"Bearer <key>"}}}}`. Once set up, ask Cursor to search or save, for example "search my KnowMan for ..." or "save this URL".

The local option remains available: run `npx -y @knowman/mcp` on Node 22 or newer, from the open-source client at https://github.com/Essatt/knowman-mcp, with your API key in the `KNOWMAN_API_KEY` environment variable.

## Questions

### Does Cursor keep memory between completions?

Cursor states that large language models do not retain memory between completions ([Cursor docs](https://cursor.com/docs/rules)). Rules provide persistent, reusable context at the prompt level, and when applied, rule contents are included at the start of the model context ([Cursor docs](https://cursor.com/docs/rules)).

### What is the difference between Rules and AGENTS.md?

Project Rules live in `.cursor/rules`, use the `.mdc` extension, and are scoped to your codebase ([Cursor docs](https://cursor.com/docs/rules)). AGENTS.md is a simple markdown file in the project root, offered as an alternative for straightforward use cases ([Cursor docs](https://cursor.com/docs/rules)).

### Can Cursor write rules for me?

Yes, you can ask the Cursor agent in chat to create a new rule for you ([Cursor docs](https://cursor.com/docs/rules)). Cursor's best practice is to keep rules under 500 lines, so review what the agent writes ([Cursor docs](https://cursor.com/docs/rules)).

### What does the KnowMan MCP server provide?

The KnowMan MCP server is a standalone server that runs locally over stdio, started with `npx -y @knowman/mcp` on Node 22 or newer, and it also runs as a hosted remote server at https://api.knowman.io/mcp. It exposes `kb_search`, `kb_ask`, `kb_get_item`, `kb_save`, `kb_recent`, and `kb_memories` over your saved library. The hosted server uses OAuth sign-in or an API key sent as `Authorization: Bearer <key>`.

## Related guides

- [How to Give Your AI Context from What You Read](https://www.knowman.io/guides/give-your-ai-context)

- [What Is a Knowledge Base for AI Agents?](https://www.knowman.io/guides/knowledge-base-for-ai-agents)

- [Persistent Memory for AI Agents](https://www.knowman.io/guides/persistent-memory-for-ai-agents)

- [Connect your knowledge base through KnowMan's MCP server](https://www.knowman.io/guides/mcp-server-knowledge-base)

## More in this topic

- [How to give Gemini CLI better memory](https://www.knowman.io/guides/gemini-cli-memory)
- [How to give Goose better memory](https://www.knowman.io/guides/goose-memory)
- [How to give Devin CLI better memory](https://www.knowman.io/guides/devin-cli-memory)

## More for Cursor

- [Add the KnowMan MCP server to Cursor](https://www.knowman.io/integrations/cursor)
- [How to teach Cursor your knowledge](https://www.knowman.io/guides/teach-cursor-your-knowledge)

## A longer memory for your reading

KnowMan saves your articles and links, reads and tags them, and keeps claims, decisions, and playbooks as memories. Try Pro free for 14 days, no credit card. [Create your account](https://app.knowman.io/signup)

[Start free](https://app.knowman.io/signup)

Every new account starts with 14 days of Pro. No credit card.

Source: https://www.knowman.io/guides/cursor-memory
