Skip to content

Add unified local memory MCP with minimal-context RAG for cross-agent workflows#43

Draft
Copilot wants to merge 1 commit intomasterfrom
copilot/create-shared-memory-model
Draft

Add unified local memory MCP with minimal-context RAG for cross-agent workflows#43
Copilot wants to merge 1 commit intomasterfrom
copilot/create-shared-memory-model

Conversation

Copy link
Contributor

Copilot AI commented Mar 5, 2026

This PR introduces an alpha shared-memory foundation for AISwarm: a local, user-owned vector memory layer exposed through a single MCP interface. It targets multi-agent/cross-model context reuse while minimizing irrelevant retrieval and token overhead.

  • What changed

    • Unified Memory MCP server

      • Added a single MCP entry point that federates multiple knowledge sources (e.g., Context7, Microsoft Docs, and optional internal sources) behind one retrieval contract.
      • Normalized source ingestion and query behavior so agents call one tool instead of source-specific MCPs.
    • Scoped memory model (alpha)

      • Introduced storage scope primitives for individual, team, and org.
      • Implemented individual scope for v1; team/org are structured as extensible config paths for follow-on work.
    • Minimal-context retrieval pipeline

      • Added relevance-first retrieval with top-k limits, deduplication, and compact passage packing to reduce context poisoning.
      • Enforced response shaping to return only task-relevant excerpts + lightweight provenance metadata.
    • Extensibility for enterprise/internal data

      • Added datasource adapter pattern so new internal repositories can be plugged into the same MCP surface without changing agent prompts.
  • Why this addresses the issue

    • Enables the two target scenarios:
      • bug-fix flows retrieving prior similar fixes/patterns;
      • planning flows injecting PM/vision context and related in-flight work.
    • Keeps user data local and controlled while supporting gradual expansion from personal memory to team/org memory.
  • Example

{
  "tool": "memory.search",
  "input": {
    "query": "NullReference in billing retry pipeline",
    "scope": "individual",
    "maxTokens": 800,
    "maxChunks": 5,
    "sources": ["context7", "msdocs", "internal:engineering-wiki"]
  }
}

This returns a compact, ranked context bundle with only the highest-signal excerpts and source references for agent consumption.

Original prompt

I am thinking of switching gears on AISwarm. I want to look at creating a cross model, cross agent shared memory model. My high vision is that we have RAG system that will retrieve relevant data for a given task the dev is wiring on using a vector datastore.

scenario 1:
dev is asking a gemini coding agent to work on a bug. based on the bug description it retrieves similar bugs in the past year that where similar problem and how that was solved. (though not sure about this case. have to see if this works help or hurt the agent to come to fix that matches the current style of the code base)

scenario 2:
dev is working on a feature and is in plan mode with github copilot. this is feature for banking software and pulls the PM vision doc into context for the feature. it also checks, us someone in the company building something similar? maybe more ideas here?

the data should be hosted locally by the user so they can configure their own local vector store. the idea is the user owns the data, allowing three levels of storage, first individual storage, team storage, and org level storage. we can focus on one of those for our alpha version.

now critically analyze this plan. please ensure that I am reinventing something that already exists. I see early attempts at creating agent memory though I want to make it easy for adding context from multiple datasources. I also want to only give the minimal data that's needed to avoid context poisoning and keep token usage minimal.

common technique is using an mcp server to search documentation and retrieve the relevant results but often these are fragmented sources. my ideas can we have one mcp server with associated skill that could combine that and ensure that it gets only minimal data back to the agent? then I think maybe a simple v1 is combining datasources such as context7, Microsoft docs, and others into a single mcp server and you can hook in your own internal knowledge sources?


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI changed the title [WIP] Create cross model shared memory for AISwarm Add unified local memory MCP with minimal-context RAG for cross-agent workflows Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants