Start free
Guide Memory

How to give Devin CLI better memory

Updated 4 min read

The short answer

Devin CLI's documented way to keep information across sessions is rules: persistent instructions injected into the agent's context at the start of every session, simplest as an AGENTS.md file at the project root. Rules in AGENTS.md are always on, and the documentation says rules and AGENTS files should be kept as small as possible (Devin CLI docs). For saved reading and memories, KnowMan's MCP server is a local stdio server whose tools include kb_search, kb_ask, and kb_memories (MCP server guide).

On this page7 sections
  1. What Devin CLI keeps between sessions
  2. Set up project rules with AGENTS.md
  3. Global rules for every project
  4. Other rule files Devin CLI reads
  5. Why rules are not a full memory
  6. Where KnowMan fits
  7. Questions people ask

What Devin CLI keeps between sessions

Devin CLI documents rules for keeping information across sessions. Rules are persistent instructions injected into the agent's context at the start of every session, so they are present from the first message (Devin CLI docs). The simplest way to add them is an AGENTS.md file at the project root, which Devin CLI reads automatically (Devin CLI docs).

Rules shape how Devin CLI behaves in your project, and all supported rule file names are treated identically, with their contents loaded as always-on rules (Devin CLI docs). The sections below cover where rule files live, other formats Devin CLI reads, and the limits the documentation sets.

Set up project rules with AGENTS.md

Create an AGENTS.md file at your project root. Devin CLI reads this file automatically, and the documentation recommends it because it is easy to read, version-controlled, and works across multiple AI tools (Devin CLI docs). Rules in AGENTS.md are always on (Devin CLI docs).

For personal instructions you do not want to share, such as working style, testing habits, or review preferences, create AGENTS.local.md next to AGENTS.md. It loads with the same always-on behavior; add it to .gitignore so it stays local (Devin CLI docs).

Global rules for every project

Global rules that apply to every project come from an AGENTS.md file placed in your user config directory (Devin CLI docs). Global rules load at the start of every session, regardless of which project you are working in, and run alongside project rules with both active at the same time (Devin CLI docs).

If you use Claude Code, Devin CLI also reads ~/.claude/CLAUDE.md as a global rule (Devin CLI docs). Rule files in your home directory, ~/.devin/rules/*.md and ~/.devin/global_rules.md, apply to every project as well (Devin CLI docs).

Other rule files Devin CLI reads

.devin/rules/*.md holds one rule per file and supports trigger frontmatter. The frontmatter matches .windsurf/rules/*.md, so the trigger values always_on, manual, model_decision, agent, and glob all apply (Devin CLI docs).

Devin CLI also reads Windsurf rules from .windsurf/rules/*.md and .windsurf/global_rules.md, and Cursor rules from .cursor/rules/*.md and .cursor/rules/*.mdc. The .devin equivalents take precedence; if both global_rules.md files exist, only .devin/global_rules.md loads (Devin CLI docs).

Standard project rules from AGENTS.md, AGENTS.local.md, AGENT.md, and .windsurfrules are read by default, and setting "agents_standard" to false disables them (Devin CLI docs). Files at the workspace root load at session start; files in subdirectories load when the agent accesses that directory (Devin CLI docs).

Why rules are not a full memory

The documentation sets clear limits. Long, verbose rules dilute the agent's attention, and rules and AGENTS files should be kept as small as possible (Devin CLI docs). Rules in AGENTS.md are always on, so every rule is present in every session (Devin CLI docs).

For material needed only sometimes, the documentation recommends Skills over rules, because Skills are only injected into the context when relevant (Devin CLI docs). The recommended pattern is a small rule that references skills for particular scenarios (Devin CLI docs).

Taken together, always-on loading and the small-size guidance point rules at standing instructions rather than bulk reference material (Devin CLI docs). For bulk material, a separate knowledge base can help: see knowledge base for AI agents.

Where KnowMan fits

KnowMan saves articles and links, reads and tags them, answers questions with citations, and keeps memories: claims, decisions, and playbooks (personal knowledge base guide). Its MCP server is a local stdio server, package @knowman/mcp, started with npx -y @knowman/mcp with Node 22 or newer (MCP server guide).

The server talks to KnowMan's HTTP API with a Bearer key in the environment variable KNOWMAN_API_KEY, created at Settings > Connections > Connect an AI agent in the web app, or by running npx -p @knowman/mcp knowman login once (MCP server guide). Its tools include kb_search for searching saved items by keyword or meaning, kb_ask for cited answers, kb_memories for claims, decisions, and playbooks, plus kb_get_item, kb_save, and kb_recent (MCP server guide).

A small rule can point the agent at this library when a task touches past reading. That follows the documented pattern of a rule referencing what the model should use in particular scenarios (Devin CLI docs).

Questions people ask

Does Devin CLI have memory across sessions?

The documented mechanism is rules: persistent instructions injected into the agent's context at the start of every session (Devin CLI docs). Rules are instructions, and the documentation recommends keeping them small (Devin CLI docs). For saved reading and memories, KnowMan's MCP server exposes kb_search, kb_ask, and kb_memories (MCP server guide).

Where does Devin CLI read rules from?

Project rules come from an AGENTS.md file at the project root, which Devin CLI reads automatically (Devin CLI docs). Global rules come from an AGENTS.md in your user config directory and load in every session (Devin CLI docs). Devin CLI also reads .devin, .windsurf, and .cursor rule files, with .devin taking precedence (Devin CLI docs).

Should AGENTS.md be long and detailed?

No. The documentation says long, verbose rules dilute the agent's attention and that rules and AGENTS files should be kept as small as possible (Devin CLI docs). It recommends Skills for material needed only sometimes, since Skills are injected only when relevant (Devin CLI docs).

Can Devin CLI use my saved reading and decisions?

Rules are persistent instructions, and the documentation recommends keeping them small (Devin CLI docs). For saved reading, KnowMan's local stdio MCP server exposes kb_search, kb_ask, and kb_memories, covering saved items, cited answers, and saved claims, decisions, and playbooks (MCP server guide). General background is in connect any AI to your notes.

Memory beyond the rules file

KnowMan keeps your reading, decisions, and playbooks and serves them to your agents (MCP server guide). Try Pro for 14 days with no credit card. Create an account

Start free

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