Skip to content

Conversation

@RichardHightower
Copy link
Contributor

Summary

Implements Phase 18 of v2.1 Multi-Agent Ecosystem milestone, adding multi-agent support to agent-memory:

  • Event.agent field — Track which AI agent (Claude, OpenCode, Gemini, Copilot) produced each event
  • memory-adapters crate — New SDK crate with AgentAdapter trait for building agent-specific adapters
  • CLI --agent filter — Filter queries by agent on teleport and retrieval commands
  • TocNode.contributing_agents — Track which agents contributed to each time period
  • Query filtering — StopConditions.agent_filter for retrieval operations

Changes

Proto Schema (proto/memory.proto)

  • Add optional string agent = 8 to Event message
  • Add agent_filter to TeleportSearchRequest, VectorTeleportRequest, HybridSearchRequest, RouteQueryRequest
  • Add agent to RetrievalResult

New Crate: memory-adapters

  • AgentAdapter trait with agent_id(), display_name(), normalize(), load_config()
  • RawEvent struct for raw event data before normalization
  • AdapterConfig for adapter-specific settings
  • AdapterError for error handling

memory-types

  • Event.agent: Option<String> with #[serde(default)]
  • TocNode.contributing_agents: Vec<String>
  • Builder methods with_agent(), with_contributing_agent()

memory-daemon CLI

  • --agent/-a filter on teleport search, teleport vector-search, teleport hybrid-search
  • --agent/-a filter on retrieval route

memory-retrieval

  • StopConditions.agent_filter for query filtering

memory-service

  • Ingest handler extracts agent from proto Event
  • Normalizes to lowercase, empty strings treated as None

Test plan

  • cargo test -p memory-types — 61 tests pass
  • cargo test -p memory-adapters — 19 tests pass
  • cargo test -p memory-retrieval — 53 tests pass
  • cargo clippy — No warnings
  • Backward compatibility tests for pre-phase-18 data

Requirements Coverage

Requirement Description Status
R4.1.1 Agent identifier field in events
R4.1.2 Automatic agent detection Foundation
R4.1.3 Agent metadata in TOC nodes
R4.2.2 Filter by agent
R5.2.1 Adapter trait definition
R5.2.2 Event normalization
R5.2.3 Configuration loading

🤖 Generated with Claude Code

RichardHightower and others added 6 commits February 8, 2026 14:15
Phase 18: Agent Tagging Infrastructure
- Standard stack identified (prost, serde, clap, async-trait)
- Architecture patterns documented (optional fields, trait SDK)
- Pitfalls catalogued (backward compat, filtering, normalization)
- Code examples for proto, types, CLI, and adapter trait
Phase 18: Agent Tagging Infrastructure
- 4 plans in 3 waves
- Wave 1: Proto/Event model + Adapter SDK crate (parallel)
- Wave 2: TocNode + CLI filters
- Wave 3: Ingest/query wiring

Ready for execution
Add multi-agent support to agent-memory system:

Proto Schema:
- Add optional agent field to Event message
- Add agent_filter to query request messages
- Add agent field to RetrievalResult

memory-types:
- Event.agent with serde(default) for backward compat
- TocNode.contributing_agents for multi-agent tracking
- Builder methods with_agent(), with_contributing_agent()

memory-adapters (NEW CRATE):
- AgentAdapter trait for adapter SDK
- RawEvent, AdapterConfig, AdapterError types
- Documentation with usage examples

memory-daemon CLI:
- --agent/-a filter on teleport search commands
- --agent/-a filter on retrieval route command

memory-retrieval:
- StopConditions.agent_filter for query filtering

memory-service:
- Ingest handler extracts agent from proto Event
- Normalizes to lowercase, empty -> None

Tests: 133 passing (61 + 19 + 53)

Requirements: R4.1.1-R4.1.3, R4.2.2, R5.2.1-R5.2.3

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add missing fields to proto struct initializers to fix CI build:
- VectorTeleportRequest: agent_filter
- TeleportSearchRequest: agent_filter
- HybridSearchRequest: agent_filter
- RouteQueryRequest: agent_filter
- ProtoEvent: agent
- RetrievalResult: agent

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix formatting in memory-adapters/src/adapter.rs
- Add pr-precheck task to Taskfile.yml for pre-push validation
- Update CLAUDE.md with pr-precheck requirement
- Update AGENTS.md with pr-precheck requirement

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add `..` to TeleportCommand and RetrievalCommand pattern matches
  to handle unused agent filter fields
- Add agent field to test Event in novelty.rs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@RichardHightower RichardHightower merged commit bcadce7 into main Feb 9, 2026
8 checks passed
@RichardHightower RichardHightower deleted the feature/phase-18-agent-tagging branch February 9, 2026 18:42
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.

1 participant