AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How to Combine Pieces and GitHub Copilot for Cross-Session Long-Term Memory

Annett von Lucke · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

GitHub Copilot suffers from digital amnesia. Open a fresh chat tab on Monday morning, switch feature branches, or close your editor for lunch, and its awareness collapses back to whatever files happen to be open. It has no memory that you spent two hours on Friday chasing a race condition across three browser tabs, a terminal log, and an uncommitted scratchpad.

Pieces provides the missing hippocampus. Instead of expecting Copilot to magically retain cross-application history, you link GitHub Copilot to Pieces' local Long-Term Memory (LTM) engine through the Model Context Protocol (MCP).

At 365Finds, we test AI developer toolchains relentlessly. Our assessment is straightforward: combining GitHub Copilot's in-editor code synthesis with Pieces' cross-session temporal capture turns Copilot from a forgetful autocomplete engine into a genuine workflow partner. But making this combination work reliably requires understanding how the two tools divide labor, abandoning obsolete IDE plugins in favor of local MCP endpoints, and aggressively filtering desktop noise.


The Architecture: Why Pair Pieces with GitHub Copilot?

GitHub Copilot excels at local synthesis. It reads active buffers, repository symbols, and workspace instruction files (.github/copilot-instructions.md), generating immediate code suggestions and orchestrating multi-file edits. What it cannot do natively is peer outside your workspace or remember what you investigated three sessions ago.

Pieces operates on a completely different layer. Its background daemon, PiecesOS, runs locally on macOS, Windows, or Linux, passively indexing snippets, browser research, terminal commands, and workflow context into a searchable timeline.

LayerGitHub CopilotPieces (PiecesOS + LTM)Combined Benefit
Primary ScopeActive workspace, repository tree, open tabsOperating system, browser tabs, terminal, local snippetsUnified context across tools and time
Memory HorizonActive session and repo historyWeeks to months of chronological workstream activityNo need to re-explain past debugging sessions
Execution RoleInline completions, refactoring, agentic editsPassive context ingestion, temporal search, snippet vaultCopilot writes code based on Pieces' past evidence
Integration ProtocolMCP Client (VS Code / JetBrains)MCP Server (local SSE endpoint)Direct context retrieval via ask_pieces_ltm

Pieces previously maintained standalone IDE extensions. It has since sunsetted those legacy plugins, consolidating integrations around the Model Context Protocol. By exposing PiecesOS as a local MCP server, GitHub Copilot Chat can call Pieces tools directly to query your past work.


Step-by-Step Guide: Setting Up Pieces LTM with GitHub Copilot

This workflow centers on Visual Studio Code, where GitHub Copilot’s Chat and Agent modes support custom MCP connections natively.

Step 1: Initialize PiecesOS and Enable Long-Term Memory

  1. Download and launch PiecesOS alongside the Pieces for Developers Desktop App.
  2. Confirm that PiecesOS is running in your system tray or menu bar.
  3. In the Pieces Desktop App, open Settings, locate the Long-Term Memory toggle, and ensure the LTM engine (LTM-2.7+) is active.
  4. Configure privacy boundaries immediately. Exclude password managers, messaging apps with proprietary client chats, and any directories containing .env files or hardcoded credentials.

Step 2: Retrieve the Local MCP Endpoint

PiecesOS hosts a local Server-Sent Events (SSE) server for MCP clients:

  1. Open the Pieces Desktop App and navigate to Settings > Model Context Protocol (MCP).
  2. Under Available Servers, find the active endpoint schema marked with the latest version badge.
  3. Copy the full HTTP/SSE URL. It typically looks like:
    http://localhost:39300/model_context_protocol/v1/mcp
    
    (Port numbers vary depending on active PiecesOS daemon bindings; always copy the exact port reported by your local desktop client).

Step 3: Connect Visual Studio Code to the Pieces MCP Server

In VS Code, connect Copilot Chat to Pieces using either the visual command palette or a configuration file.

Option A: Through the Command Palette

  1. Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS) to open the Command Palette.
  2. Type and select MCP: Add Server.
  3. When prompted for server type, choose HTTP (sse).
  4. Enter Pieces as the server identifier, paste your copied SSE URL, and confirm.

Option B: Through .vscode/mcp.json For project-specific or committed team configurations, add the server directly into your workspace configuration:

{
  "servers": {
    "pieces-ltm": {
      "type": "sse",
      "url": "http://localhost:39300/model_context_protocol/v1/mcp"
    }
  }
}

Once connected, VS Code will discover the exposed Pieces tools, including ask_pieces_ltm.

Step 4: Configure Copilot Instructions for Temporal Retrieval

GitHub Copilot does not always know when to consult external memory unless instructed. Add explicit retrieval rules to your workspace root at .github/copilot-instructions.md:

# Context Retrieval Rules
When answering queries regarding:
- Previous architectural decisions or debugging sessions
- Snippets or external documentation reviewed outside this repository
- Past terminal error logs or test runs

Query the Pieces MCP server using `ask_pieces_ltm` before assuming context is missing.

Everyday Workflows: How Developers Leverage the Combination

Once the MCP pipe is open, Copilot gains temporal depth. 365Finds tracks three specific patterns where this architecture eliminates repeated prompt engineering:

1. Resuming Friday’s Bug Hunt on Monday

You spent Friday diagnosing an undocumented JWT expiry edge case across internal wiki pages and local terminal sessions. On Monday, your editor is empty.

Instead of writing a 300-word prompt summarizing what happened, you prompt Copilot Chat in Agent mode:

"Query Pieces LTM for the JWT refresh token errors I handled on Friday afternoon. Use the logic from the snippet I saved to update our auth middleware in src/middleware/auth.ts."

Copilot invokes ask_pieces_ltm, pulls the exact payload structure you inspected in your browser and terminal, and drafts the implementation without hallucinating the error signature.

2. Bridging Browser Research to In-Editor Implementation

When building against third-party SDKs, documentation often stays trapped in Chrome tabs. Pieces indexes those visited pages in the background. In Copilot Chat, you can ask:

"What were the rate limits and header formats from the Stripe webhook docs I reviewed an hour ago? Implement the validation handler accordingly."

GitHub Copilot fetches the ingested technical documentation from PiecesOS and writes the handler without forcing you to switch windows and paste raw documentation blocks into the prompt window.

3. Curated Reusable Patterns via Pieces Snippets

Pieces allows you to save curated, tagged code snippets enriched with compiler context and source URLs. During an inline editing session, Copilot can call upon these verified organizational patterns rather than generating boilerplate from general internet training weights.


Trade-Offs and Frictions: The 365Finds Assessment

We do not recommend software combinations without documenting where they break. Pairing Pieces with GitHub Copilot introduces real friction:

  1. Hardware Resource Tax: PiecesOS continuously monitors clipboard events, window focus, and text buffers to build its local vector store. On a MacBook Pro or developer workstation, running PiecesOS alongside Docker, VS Code, and Copilot’s background language servers consumes noticeable RAM (often between 800 MB and 1.5 GB for PiecesOS) and accelerates battery drain.
  2. Context Pollution: Long-Term Memory captures everything unless tightly reined in. If you spent thirty minutes troubleshooting an unrelated Git rebase conflict, asking Copilot about "recent errors" might pull Git noise instead of your application logic. You must use precise temporal cues in your prompts (e.g., "between 2 PM and 4 PM yesterday").
  3. Local Daemon Fragility: If your machine wakes from deep sleep, the localhost SSE connection between VS Code and PiecesOS occasionally drops silently. Copilot will fail over to its default context window without warning you that ask_pieces_ltm was unreachable. Restarting PiecesOS or running MCP: Restart Server in VS Code is occasionally required.

365Finds Recommendation

If you use GitHub Copilot strictly for one-line autocomplete inside small, isolated scripts, setting up Pieces is unnecessary overhead. Stick to Copilot’s default editor context.

However, if your development involves multi-day sprints, complex microservice architectures, and heavy cross-referencing between browser documentation, terminal sessions, and codebases, 365Finds firmly recommends linking Pieces to GitHub Copilot via MCP. The time saved from never having to reconstruct past research sessions easily offsets the minor maintenance of running PiecesOS in the background.

References