Start free
Guide Memory

How to give GitHub Copilot better memory

Updated 4 min read

The short answer

The VS Code Copilot docs do not describe a built-in memory that persists across chat sessions. The documented options are custom instructions files, which guide the model with reusable project guidance (custom instructions), and MCP servers, which connect the agent to tools and data sources (MCP servers in VS Code). KnowMan ships an MCP server, hosted and local, that exposes saved items and memories as tools (knowman-mcp repo).

On this page9 sections
  1. What Copilot can remember
  2. Write instructions once instead of repeating them in every prompt
  3. Scope and activation
  4. Target instructions to specific files
  5. Add an MCP server for external data
  6. The KnowMan MCP server
  7. Verify your setup
  8. Limits to keep in mind
  9. Questions people ask

What Copilot can remember

The VS Code customization docs do not describe a built-in Copilot memory that persists across chat sessions. What they describe are custom instructions and MCP servers: instructions give the agent reusable guidance about your project, such as where to add code, which libraries to use, and which tests to run, while Model Context Protocol (MCP) connects agents to tools and data sources. See VS Code custom instructions and MCP servers in VS Code.

Write instructions once instead of repeating them in every prompt

VS Code documents storing instruction guidance in Markdown files instead of repeating it in every prompt, and sharing project instructions through source control. The documented project instruction files for the Copilot harness are .github/copilot-instructions.md and AGENTS.md. See custom instructions.

AGENTS.md is a cross-agent format, not a Codex-only file. See custom instructions.

Scope and activation

Scope determines where guidance is available and who shares it. Activation determines when that guidance is included in a request. User scope holds personal preferences that apply across projects, in a location supported by your harness, so preferences like favorite libraries or formatting rules can follow you between projects. See custom instructions.

Target instructions to specific files

Targeted instruction files use applyTo frontmatter to specify which files the instructions apply to. They are saved under .github/instructions, for example .github/instructions/python-tests.instructions.md. See custom instructions.

In Local sessions, a description lets the agent decide whether to read an instructions file for the task, so you can keep specialized guidance out of the way until it is relevant. See custom instructions.

Add an MCP server for external data

VS Code documents adding an MCP server when the agent needs a capability its existing tools do not provide, such as querying a database or retrieving information from an external service. See MCP servers in VS Code. To add an MCP server manually, select MCP Servers in the Agent Customizations editor, select Add Server ( + ) in the User or Workspace group, and follow the guided flow. The Agent Customizations editor can create and edit instructions, skills, custom agents, and supported configurations using inline editors and forms. See customization overview.

For command-line Copilot setups, a personal Copilot Global MCP configuration writes to $COPILOT_HOME/mcp-config.json, or ~/.copilot/mcp-config.json when COPILOT_HOME is unset. See MCP servers in VS Code.

One caution from the docs: adding an MCP server configuration is not proof that the agent can use the server. See MCP servers in VS Code.

The KnowMan MCP server

KnowMan provides a hosted remote MCP server at https://api.knowman.io/mcp using Streamable HTTP. The hosted server accepts OAuth sign-in, where the client opens a KnowMan consent page and you approve, or an API key sent as Authorization: Bearer <key>. Setup requires one KnowMan account at https://app.knowman.io. See the knowman-mcp repo.

The OAuth consent page requests knowman.read for search, read, and ask, and knowman.write for saving links. Access tokens last one hour and refresh automatically. You disconnect an app by deleting its "OAuth: <app name>" entry in your KnowMan API-keys list, and changing your password disconnects every app. See the knowman-mcp repo.

The server exposes six tools: kb_search (search saved items), kb_ask (answers with citations), kb_get_item (readable content of one item), kb_save (save a URL with an optional note), kb_recent (recent items), and kb_memories (saved claims, decisions, and playbooks, read-only). KnowMan also runs as a local stdio server through the npm package @knowman/mcp, launched with npx -y @knowman/mcp on Node 22 or newer. Details in the knowman-mcp repo and the guide to an MCP server knowledge base.

Verify your setup

When verifying instructions, start a new chat so the test does not depend on guidance from the conversation that created the instructions. See custom instructions. Then ask the agent to use the new capability, for example "search my KnowMan for …" or "save this URL". See the knowman-mcp repo. If a server does not respond, remember that a configuration alone is not proof the agent can use the server. See MCP servers in VS Code.

Limits to keep in mind

VS Code documents that instructions guide the model without guaranteeing compliance, do not replace tests, code review, or security controls, and do not apply to inline suggestions as you type. See custom instructions. Treat instruction files and MCP servers as aids, not enforcement.

For the bigger picture, see GitHub Copilot and your knowledge base and what an MCP server is.

Questions people ask

Does GitHub Copilot have memory across chats?

The VS Code Copilot docs do not describe a built-in memory that persists across chat sessions. What the docs describe are custom instructions files for reusable guidance and MCP servers for connecting the agent to tools and data sources. See custom instructions and MCP servers in VS Code.

Should I use .github/copilot-instructions.md or AGENTS.md?

Both are documented project instruction files (custom instructions). AGENTS.md is a cross-agent format, not a Codex-only file. The docs do not state which file wins when both exist, so pick one for project guidance.

How do I connect KnowMan to Copilot?

KnowMan provides a hosted remote MCP server at https://api.knowman.io/mcp, which accepts OAuth sign-in or an API key sent as Authorization: Bearer <key> (knowman-mcp repo). In VS Code, the documented path is to select MCP Servers in the Agent Customizations editor, select Add Server ( + ) in the User or Workspace group, and follow the guided flow (customization overview). VS Code also notes that adding a configuration is not proof that the agent can use the server (MCP servers in VS Code).

Do instruction files guarantee Copilot follows my rules?

No. VS Code documents that instructions guide the model without guaranteeing compliance, do not replace tests, code review, or security controls, and do not apply to inline suggestions as you type (custom instructions).

Build a knowledge base your agents can reach

Save, tag, and ask about everything you read, and expose it over MCP. Try KnowMan Pro for 14 days with no credit card. Create your account

Start free

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