Featured image of post Agent Memory on GitHub Copilot

Agent Memory on GitHub Copilot

Agent memory helps GitHub Copilot remember context across sessions. This post explains how it works and which memory tools you can use with Copilot and similar MCP clients.

When you work with GitHub Copilot, every conversation starts with a limited context window. The model can only use what fits inside that window. If you switch threads, close the editor, or come back later, Copilot can lose the details you already explained. This is where agent memory becomes useful.

Agent memory gives Copilot a way to remember facts, preferences, and project context across sessions. Instead of repeating yourself, you can let it store and retrieve important information when needed.

In this post, we will look at how agent memory works with GitHub Copilot and review popular tools that can provide persistent memory through MCP.

Why Agent Memory Matters

Large language models are stateless. They do not remember anything between requests unless you send the previous conversation along with the new prompt. That works fine for short tasks, but it becomes painful for long-running projects.

Here are a few common problems:

  • Repeated explanations: You have to describe your coding style, project structure, or preferences every time.
  • Lost context: Decisions made in earlier sessions disappear, so Copilot suggests things that conflict with what you already agreed on.
  • Inconsistent output: Without memory, generated code drifts between sessions because the model has no stable reference.
  • Lost conversation history: After a week away from your project, you come back and the assistant has no memory of what you discussed, what decisions were made, or what issues were resolved.

Agent memory solves these problems by storing facts outside the model and loading them back into the context when needed.

The Core Use Case: Continuing Work After Days Away

The most practical use of agent memory isn’t about storing preferences - it’s about being able to continue a conversation after days or weeks away from your project.

The Scenario

Day 1 (Monday): You start working on a new microservice. You spend 4 hours with GitHub Copilot:

  • Discuss the architecture: You decide to use gRPC for inter-service communication, Redis for caching, and PostgreSQL for persistence
  • Design the database schema together: users table, orders table, and their relationships
  • Generate entity classes, repositories, and services in C# or Java
  • Discuss error handling: You decide on a specific error response format
  • Review and refine the code together
  • Copilot generates hundreds of lines of code across multiple files

Day 2 (Tuesday): You continue working:

  • Implement the gRPC service with the proto definitions you created
  • Set up the Redis cache layer for frequently accessed data
  • Write unit tests for the business logic
  • Discuss deployment configuration and environment variables
  • Close VS Code for the night

Day 9 (Next Tuesday): You come back to the project after a long weekend and holiday. You open VS Code and ask Copilot:

“Can you help me add a new endpoint to our gRPC service?”

Without Agent Memory

Copilot has no idea what you’re talking about:

“I don’t see any existing gRPC service. Could you share your proto file or tell me which service you’re working on? Also, what error handling format are you using?”

You now have to:

  1. Remember everything you did 7 days ago
  2. Explain the architecture again
  3. Re-describe the database schema
  4. Re-explain the error handling format
  5. Share the proto file and code context
  6. Hope you didn’t forget any important details

You waste 30-60 minutes just re-establishing context that you already built over 2 days.

With Agent Memory

Copilot remembers everything:

“I see we built a UserService gRPC service last week with these methods: GetUser, CreateUser, and UpdateUser. The proto file is in protos/user_service.proto. Should I add the new endpoint there? I’ll follow the same error handling format we decided on - returning ErrorResponse with code, message, and details fields. Also, I remember we were using Redis for caching user data.”

You can immediately start working on the new endpoint. No re-explaining. No lost context. Just continue where you left off.

This is what agent memory does. It’s not about storing random preferences. It’s about maintaining continuity in your development work across days, weeks, or even months.

How GitHub Copilot Handles Memory

GitHub Copilot and other modern coding assistants can use memory through the Model Context Protocol (MCP). MCP is an open standard that lets an assistant connect to external tools and data sources. One of those tools is a memory server.

A memory server acts like a persistent store for:

  1. Conversation history: The full chat log from all your sessions
  2. Facts and decisions: Important details extracted from conversations

When you work with Copilot and memory is enabled:

  1. Every conversation you have is automatically saved
  2. Important decisions and facts are extracted and stored
  3. When you start a new session, the assistant loads the relevant history
  4. You can continue conversations exactly where you left off

This approach has a few benefits:

  • Persistence: Memory survives across sessions, projects, and even devices.
  • Continuity: You can work on a project for months without repeating yourself.
  • Portability: Because MCP is a standard, the same memory server can work with GitHub Copilot and other clients that support MCP.

Copilot does not ship with a built-in long-term memory store for your project decisions. You add that capability by configuring an MCP server. Each memory tool below can be added independently, so you can choose the one that fits your workflow.

How MCP Servers Connect to Your Assistant

MCP servers are small programs that Copilot starts and talks to through standard input and output. In VS Code, you register an MCP server by adding an entry under the mcp.servers setting in settings.json. The assistant then discovers the tools exposed by that server and can call them during a chat session.

A typical MCP server entry looks like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
  "mcp": {
    "servers": {
      "my-memory": {
        "command": "npx",
        "args": ["-y", "package-name"],
        "env": {
          "SOME_API_KEY": "your-key"
        }
      }
    }
  }
}

You can add more than one memory server, but they will each have their own storage. In practice, pick one and use it consistently so Copilot does not split memory across multiple places.

The sections below show how to set up each tool for GitHub Copilot. Most of them also work with Claude Code, Cursor, and other MCP clients.

The order below is based on current popularity, community usage, and how often these tools show up in real AI coding workflows. Right now, AgentMemory, Context-Mode, and Mem0 are some of the most visible options in the broader agent-memory space, while Basic Memory has become one of the most widely used local-first choices.

1. AgentMemory

AgentMemory is an open-source persistent memory system for AI coding agents. It captures session history, compresses useful context, and makes that context searchable across future sessions. It supports MCP clients, plugin-based integrations, and multiple coding assistants, including GitHub Copilot CLI.

Install and run

The main package can be started with npx:

1
npx -y @agentmemory/agentmemory@latest

If you only want the MCP layer, AgentMemory also provides a standalone MCP entry point:

1
npx -y @agentmemory/agentmemory mcp

On Windows, the full server setup needs the iii-engine runtime or Docker Desktop. If you want the simplest path for GitHub Copilot style MCP usage, the standalone MCP mode is the easier starting point.

Add to your assistant

For MCP-based clients, the configuration follows the standard MCP server pattern:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
  "mcp": {
    "servers": {
      "agentmemory": {
        "command": "npx",
        "args": ["-y", "@agentmemory/mcp"],
        "env": {
          "AGENTMEMORY_URL": "http://localhost:3111"
        }
      }
    }
  }
}

If you are using GitHub Copilot CLI specifically, the project also documents a dedicated connect flow for Copilot environments.

Use Case

You spend several sessions building an API with Copilot. During those sessions, the assistant helps you add JWT authentication, fix an N+1 query problem, and choose a rate-limiting strategy.

Days later, you come back and ask:

“Continue the API work from last week and keep the same auth and performance decisions.”

AgentMemory can restore the important working context, such as:

  • The authentication approach you already implemented
  • The files and middleware involved in the auth flow
  • The performance issue you fixed earlier and why you changed it
  • The patterns and decisions that should carry into the next task

Because it is built for coding-agent workflows, it focuses on searchable session memory, tool-driven context capture, and cross-session continuity instead of acting like a simple note store.

When to use it

Choose AgentMemory when you want a more full-featured memory system for coding agents, especially if you care about searchable session history, MCP support, and cross-agent workflows. It is a strong option when you want something more advanced than a simple file-based memory server but still want an open-source project you can inspect and run yourself.

2. Context-Mode

Context-Mode is an MCP server for AI coding agents. It combines persistent session memory with context-window optimization, so the assistant can continue work across long sessions without flooding the model with raw tool output.

Install and run

Context-Mode is published as an npm package. You can run it with npx:

1
npx -y context-mode@latest

It also supports platform-specific installs for tools like VS Code Copilot, Claude Code, Cursor, Codex CLI, and others. For GitHub Copilot and VS Code workflows, the MCP setup is the most relevant path.

Add to your assistant

For MCP-only setup in VS Code or GitHub Copilot style clients, the configuration follows the same pattern as the other tools:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
  "mcp": {
    "servers": {
      "context-mode": {
        "command": "npx",
        "args": ["-y", "context-mode@latest"]
      }
    }
  }
}

Context-Mode also supports hook-based integrations on several platforms. That matters because it can capture session events, restore state after compaction, and keep memory more accurate than a plain MCP-only setup.

Use Case

You spend two full days building a microservice with Copilot. The session includes architecture decisions, generated code, debugging output, file edits, and follow-up corrections.

On Day 9, you come back and ask:

“Continue the gRPC service work from last week and keep the same architecture decisions.”

Context-Mode restores the useful working state instead of replaying raw history:

  • The important architecture decisions
  • The files and components that mattered most
  • The corrections you made to earlier generated code
  • The unresolved tasks still left in the workflow

It also keeps large tool outputs out of the main context window by indexing and retrieving only the relevant parts later. That makes it especially useful for long coding sessions where both memory and context efficiency matter.

When to use it

Choose Context-Mode when you want one of the most widely used modern tools for agent memory and context control. It is a strong fit for developers who work with coding agents every day and want better continuity, less context waste, and stronger session recovery.

3. Mem0

Mem0 is an open-source memory layer with a hosted option. It stores memories as structured entities and supports semantic search, so Copilot can find relevant facts even when the wording changes.

Install and run

Mem0 provides an MCP server package. Run it with npx:

1
npx -y @mem0/mcp

If you use the hosted version, create an API key at mem0.ai. For self-hosting, follow the Mem0 documentation to run the platform locally.

Add to your assistant

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
  "mcp": {
    "servers": {
      "mem0": {
        "command": "npx",
        "args": ["-y", "@mem0/mcp"],
        "env": {
          "MEM0_API_KEY": "your-api-key"
        }
      }
    }
  }
}

If you self-host, you may also need to set MEM0_API_URL to your local endpoint.

Use Case

Mem0 automatically stores your entire 2-day conversation. On Day 9, you ask:

“What were we working on last week with the microservice?”

Mem0 retrieves the full context:

  • “You were building a UserService gRPC microservice”
  • “The architecture uses PostgreSQL for persistence and Redis for caching”
  • “You created proto definitions, entities, and repositories”
  • “You decided on a specific error response format with code, message, and details fields”

You can also ask more flexibly:

“I remember we discussed some caching strategy, but forgot the details”

Mem0 uses semantic search to find the relevant conversation even if you don’t use the exact words.

When to use it

Choose Mem0 when you want semantic search, user-specific memory, and a memory layer that improves over time. It’s a good middle ground between simplicity and power for team environments where multiple people might ask about past decisions.

4. Server Memory

Server Memory is the official reference MCP server for memory. It stores facts and conversation history as plain text in a JSON file on disk and exposes remember, recall, and forget tools.

Install and run

You do not need a global install. npx downloads and runs it on demand:

1
npx -y @modelcontextprotocol/server-memory

If you prefer, install it globally:

1
npm install -g @modelcontextprotocol/server-memory

Add to your assistant

Open VS Code settings (Ctrl + , or Cmd + ,), search for mcp, and add a server. Or edit settings.json directly:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
  "mcp": {
    "servers": {
      "memory": {
        "command": "npx",
        "args": ["-y", "@modelcontextprotocol/server-memory"],
        "env": {
          "MEMORY_FILE_PATH": "C:\\Users\\YourName\\.assistant-memory.json"
        }
      }
    }
  }
}

On macOS or Linux, use a path like /Users/YourName/.assistant-memory.json or /home/YourName/.assistant-memory.json.

If you also use other MCP clients, you can usually reuse the same server there too.

Use Case

After your 2 days of work on Monday and Tuesday, Server Memory automatically stores:

  1. The full chat history: All discussions, code generation, and decisions
  2. Key facts extracted: Architecture decisions, technology choices, patterns used

On Day 9 when you return, ask Copilot:

“Continue from last week. Help me add a new gRPC endpoint.”

Server Memory loads the conversation history and Copilot remembers:

  • The gRPC service you built (UserService)
  • The proto file location
  • The database schema and entities
  • The error handling format you decided on
  • The Redis caching strategy
  • Your deployment preferences

When to use it

Choose Server Memory when you want a zero-dependency, file-based memory store. It’s the fastest way to get persistent conversation history and works offline. Perfect for solo developers who want simple session continuity.

5. Supermemory

Supermemory is a hosted memory and context engine. It extracts facts, builds user profiles, and runs hybrid RAG and memory search. It also offers connectors for Notion, Gmail, GitHub, and other sources, so your assistant can remember information from outside the chat.

Install and run

Supermemory is a managed service, so there is no local install. Create an account and get an API key from the Supermemory dashboard. The MCP server is exposed as a remote URL.

Add to your assistant

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
  "mcp": {
    "servers": {
      "supermemory": {
        "url": "https://mcp.supermemory.ai/mcp",
        "headers": {
          "Authorization": "Bearer sm_your_key"
        }
      }
    }
  }
}

Use Case

Your team uses Notion for documentation and GitHub for code. During Monday and Tuesday, you created Notion pages documenting the architecture and GitHub issues tracking tasks.

On Day 9, you ask:

“Continue the gRPC service work from last week. Check our Notion docs for the API design”

Supermemory connects to your Notion workspace and GitHub repo, retrieving:

  1. The conversation history from your Copilot sessions
  2. Notion pages with architecture diagrams and API design
  3. GitHub issues and PRs from the work

It gives you a complete picture of what was done, documented, and what remains.

When to use it

Choose Supermemory when you want managed, cross-agent memory with user profiles and external connectors. It works well for teams that use multiple assistants and want a single memory layer that integrates with existing documentation.

6. Cognee

Cognee is an open-source AI memory platform. It ingests data and builds a self-hosted knowledge graph for persistent agent memory. Because it runs locally, you keep full control over your data.

Install and run

Install the Python package:

1
pip install cognee

Or run the MCP server with Docker:

1
docker run -e TRANSPORT_MODE=sse --env-file .env -p 8000:8000 cognee/cognee-mcp:main

The .env file should include your LLM_API_KEY.

Add to your assistant

For the Docker SSE server:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
  "mcp": {
    "servers": {
      "cognee": {
        "type": "sse",
        "url": "http://localhost:8000/sse"
      }
    }
  }
}

Use Case

Cognee builds a knowledge graph of your work. On Monday and Tuesday, it ingests:

  • Your conversation history with Copilot
  • The code you generated
  • Your decisions and reasoning

On Day 9, you ask:

“What’s the relationship between UserService and OrderService in our gRPC architecture?”

Cognee returns a graph-based answer:

“UserService and OrderService communicate via gRPC. UserService handles user authentication and profile management. OrderService depends on UserService for user validation. Both services share the same PostgreSQL database but use separate Redis cache instances.”

It understands the connections between concepts because it’s stored as a knowledge graph, not just plain text.

When to use it

Choose Cognee when you need self-hosted graph memory and want to keep data on your own infrastructure. It’s a strong fit for teams with privacy requirements or complex systems where relationships between components matter.

7. Basic Memory

Basic Memory is a local-first knowledge graph stored as Markdown files. It supports bidirectional editing by both you and the assistant through MCP, and the files are Obsidian-compatible.

Install and run

Install with uv:

1
uv tool install basic-memory

Add to your assistant

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
  "mcp": {
    "servers": {
      "basic-memory": {
        "command": "uvx",
        "args": ["basic-memory", "mcp"]
      }
    }
  }
}

Use Case

After Monday-Tuesday, Basic Memory creates a knowledge graph as Markdown files in your Obsidian vault:

myblog/ ├── knowledge/ │ ├── projects/ │ │ └── UserService-Microservice.md │ ├── architecture/ │ │ └── gRPC-Design-Decisions.md │ └── code/ │ └── Entity-Framework-Setup.md

On Day 9, you open Obsidian and review these notes. Then ask Copilot:

“Continue the gRPC service work. I reviewed the notes in Obsidian.”

Copilot sees the updated notes and continues from where you left off. Any changes you make in Obsidian are immediately available to the assistant.

When to use it

Choose Basic Memory when you want plain Markdown files as the source of truth, with no cloud required. It’s ideal if you already use Obsidian or similar tools and want seamless integration between your note-taking and AI development.

8. Cloud-Mem

Cloud-Mem is a lightweight cloud-backed memory store for agents. At the time of writing, it does not have a widely published package or MCP registry entry, so treat it as experimental. If you adopt it, you will likely configure it through a custom MCP wrapper or direct API calls.

Use Case

You work on multiple machines: office desktop, home laptop, and a shared server. Cloud-Mem stores your conversation history in the cloud.

On Day 9, you’re at home (different machine than Monday/Tuesday). You ask:

“Continue our microservice work”

Cloud-Mem syncs the conversation history and Copilot remembers everything, regardless of which machine you’re using.

When to use it

Consider Cloud-Mem if you want a simple hosted key-value memory and are comfortable writing a small bridge. For production use, prefer one of the better-documented options above.

9. EverOS

EverOS is a local-first Python memory runtime. It stores conversations and agent trajectories as Markdown files, indexed in SQLite and LanceDB. The Markdown-as-source approach makes memories easy to read and edit by hand.

Install and run

1
2
3
pip install everos
everos init
everos server start

Add to your assistant

EverOS does not ship with an official MCP package. You can call its HTTP API directly at http://127.0.0.1:8000/api/v1/memory/*, or bridge it to MCP with a small wrapper. Some community integrations expose an evermem_search tool over stdio.

Use Case

EverOS stores your Monday-Tuesday conversation as Markdown files in your project. On Day 9, you can:

  1. Ask Copilot: “Continue our work from last week”
  2. Or simply open the Markdown files in your editor to review

The files might look like:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Session: UserService gRPC Microservice - 2026-07-06

### Architecture Decisions
- Using gRPC for inter-service communication
- PostgreSQL for persistence with Entity Framework Core
- Redis for caching user data (TTL: 15 minutes)
- Error handling: ErrorResponse message with code, message, details

### Generated Code
- Entity classes in `Entities/User.cs`, `Entities/Order.cs`
- Repository pattern in `Repositories/`
- gRPC service in `Services/UserService.cs`
- Proto definitions in `protos/user_service.proto`

### Next Steps
- Implement authentication middleware
- Set up health checks
- Configure Docker deployment

You can edit these files manually, add notes, or correct the assistant’s memory directly.

When to use it

Choose EverOS when you want Markdown-as-source-of-truth memory that stays fully local. It’s a good fit if you prefer files you can inspect, edit, and version control. Great for organized developers who want manual control over their memory.

10. Memu

Memu is a personal memory system that compiles conversations, documents, and code into a local Markdown file tree. It is designed for fast retrieval by coding agents.

Install and run

Install the Python CLI:

1
pip install memu-py

Or use the Node wrapper:

1
npx memu-cli

Add to your assistant

Memu does not ship with an MCP server. It integrates through custom skills or by calling CLI commands. You can create a small wrapper or skill that tells Copilot how to run memu memorize and memu retrieve.

Use Case

On Monday, after 4 hours of work, you ask:

“Memorize this workspace”

Memu indexes:

  • All your code
  • The conversation history
  • Any documents in the workspace

On Day 9, you ask:

“Retrieve our work on the UserService from last week”

Memu returns:

  • The architecture decisions
  • The code you generated
  • The discussion about error handling
  • The deployment configuration discussion

All from the indexed memory, organized as a file tree you can browse.

When to use it

Choose Memu when you want file-based memory for coding agents and prefer skill or CLI integration over MCP. It’s designed specifically for software development context.

Comparing the Options

If you want the short version, use this:

Tool Best for Pros Cons
AgentMemory Full-featured coding-agent memory ✅ Strong MCP support, ✅ searchable session history, ✅ works across multiple agent workflows ❌ More setup than very simple local tools
Context-Mode Long coding sessions ✅ Remembers recent work well, ✅ helps manage large context, ✅ widely used ❌ Less simple than basic memory tools
Mem0 Rich memory and retrieval ✅ Finds past info by meaning, ✅ works for teams, ✅ strong ecosystem ❌ More setup than simple local tools
Server Memory Easiest starting point ✅ Very easy to set up, ✅ runs locally, ✅ official MCP example ❌ Limited features
Supermemory Teams and hosted workflows ✅ Easy cloud setup, ✅ connects to other tools, ✅ good for shared knowledge ❌ Not ideal if you want everything local
Cognee Self-hosted graph memory ✅ Good at connected knowledge, ✅ self-hosted, ✅ powerful for complex projects ❌ Harder to set up
Basic Memory Local-first notes workflow ✅ Plain Markdown files, ✅ works well with Obsidian, ✅ easy to inspect ❌ More manual than hosted tools
Cloud-Mem Cross-device hosted memory ✅ Works across devices, ✅ simple hosted idea ❌ Smaller ecosystem, ❌ may need more custom work
EverOS Editable local memory ✅ Local files, ✅ easy to read, ✅ easy to edit by hand ❌ Less standard MCP support
Memu Coding-focused file memory ✅ Built for code context, ✅ easy to inspect files ❌ Usually needs custom integration

If you want the safest starting point, pick Server Memory or Basic Memory. If you want a more full-featured coding-agent memory system, start with AgentMemory, Context-Mode, or Mem0. If you want richer hosted features, look at Supermemory. If privacy and self-hosting matter most, Cognee is the stronger choice.

When to Use Agent Memory

Agent memory is not always necessary. For one-off questions or small scripts, the default context window is enough. But memory becomes valuable when:

  • You work on the same codebase over many sessions.
  • You close the editor and come back days later.
  • You have strong conventions the assistant should follow.
  • You want the assistant to learn from corrections and feedback.
  • You are building a complex system with many decisions.

Start small. Set up a memory server and work on a project for a week. Close the editor, come back after 3 days, and see if the assistant remembers. You’ll immediately understand the value.

Conclusion

Agent memory turns GitHub Copilot from a stateless helper into a tool that adapts better to your project over time. The most practical use case is simple: after working with Copilot for hours, days, or weeks, you can close the editor and come back later. It remembers the architecture decisions, the code you generated, the problems you solved, and the plans you made.

Server Memory and Basic Memory are still the simplest ways to get started. If you want a more modern and widely discussed workflow, Context-Mode or Mem0 are better first picks. If you need more power, tools like Supermemory and Cognee offer richer memory models. Choose the one that matches your architecture, privacy needs, and how much control you want.

Memory is still an evolving area in AI tooling. The best approach today is to experiment, store what matters, and keep your memory layer simple enough to understand and maintain. The goal is not to build a perfect memory system - it’s to stop repeating yourself and focus on writing code.

Built with Hugo
Theme Stack designed by Jimmy