feat: New Feature - Engram Teams#7
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add persistent team memory for Claude Code Agent Teams. When multiple Claude Code agents collaborate as a team, they already share one engram MCP server (same SQLite DB), so real-time memory sharing works for free. This PR adds the missing piece: capturing and consolidating team knowledge after the team ends, so future sessions and teams can build on past work.
What's New
New MCP Tool
mcp_consolidate_team— Consolidate all memories from an agent team into a structured markdown summary. Accepts optionalteam_name(auto-detected if omitted). The summary is saved as a searchable memory with tags['team-summary', 'team:{name}'].Enhanced MCP Tools
mcp_save_memory— Auto-tags memories withteam:{name}when running in a team context. Transparent, no API change. Also adds contradiction detection: when saving a memory taggedfinding, warns if very similar findings already exist (non-blocking).mcp_find_similar_sessions— Now surfaces team summaries alongside session indexes, with "Team:" prefix formatting.New CLI Commands
engram teams— List past agent teams and their memory counts. Supports--search <query>for semantic search across team summaries.engram consolidate— Manually trigger team memory consolidation. Supports--team <name>or auto-detects.Hook Integration
TaskCompletedorTeammateIdleevents) is documented in the project README.md.Architecture
Core insight: consolidation logic lives in
@engram/coreand is shared by both the MCP server tool and CLI command — no duplication.How It Works
detectTeam()checksCLAUDE_TEAM_NAMEenv var, then scans~/.claude/teams/*/config.jsonfor active teams (returns most recently modified).mcp_save_memorycall during a team session automatically addsteam:{name}tag.team:{name}are collected, categorized (finding, decision, hypothesis, blocker, action-item, other), and formatted into a structured markdown summary.mcp_find_similar_sessionsorengram teams --search.Files Changed
New Files (7)
packages/core/src/team/detector.tsdetectTeam(),listTeams()packages/core/src/team/consolidate.tsconsolidateTeam()packages/core/src/team/index.tspackages/core/test/team/detector.test.tspackages/core/test/team/consolidate.test.tspackages/server/test/integration/team.integration.test.tsModified Files (8)
packages/core/src/index.tspackages/core/tsup.config.tssrc/team/index.tsentrypackages/core/package.json./teamsubpath exportpackages/server/src/server.tspackages/cli/src/cli.tsteams+consolidatecommandspackages/server/test/server.test.tspackages/server/test/e2e/mcp-protocol.e2e.test.tsREADME.mdTest Coverage
192 tests pass (41 new), 0 failures, 15 test files
detector.test.tsconsolidate.test.tsteam.integration.test.tsDesign Decisions
team:{name}store.list({ limit: 10000 })+ JS filterKnown Limitations (V1)
detectTeam()per-request: Synchronous filesystem reads on every save. Negligible overhead for typical agent workflows.How to Test
Related
tasks/team-memory.mdfeat/swarm