Skip to content

πŸ‘₯ Multi-agent as first-class citizenΒ #231

Closed

Description

@hurttlocker

Problem

The --agent flag exists but it's bolted on, not woven in. In a world where personal agents are the primary users of Cortex, multi-agent support needs to be seamless β€” not an afterthought.

Today: three agents (Mister, Niot, Hawk) each have separate Cortex databases on separate machines. That works, but it's the brute-force version. The v1.0 vision is that multiple agents can share a single Cortex instance with scoped access.

Current State

  • --agent flag exists on import and search
  • Agent field stored in memories table
  • No agent scoping on: graph, MCP tools, connectors, stats, stale, conflicts, classify, cleanup
  • No agent-level access control

What "First-Class" Means

Every command respects --agent

Command Agent-scoped today? v1.0 target
import βœ… βœ…
search βœ… βœ…
extract ❌ βœ… Extracts only from agent's memories
classify ❌ βœ… Classifies only agent's facts
graph ❌ βœ… Graph shows only agent's knowledge
stats ❌ βœ… Stats scoped to agent
stale ❌ βœ… Staleness per agent
conflicts ❌ βœ… Conflicts within agent's facts
cleanup ❌ βœ… Cleanup scoped to agent
connect sync ❌ βœ… Connector data tagged with agent
MCP tools ❌ βœ… Agent context passed through MCP

Agent Discovery

  • cortex agents β€” list all agents that have imported data
  • Shows: agent name, memory count, fact count, last import time, DB size contribution

MCP Agent Context

When an MCP client connects, it should be able to declare its agent identity. This could be:

  • A --agent flag on cortex mcp startup
  • Or a session-level parameter in the MCP protocol
  • All subsequent tool calls are automatically scoped to that agent

Shared vs. Scoped

Some data should be agent-scoped, some shared:

  • Scoped: Memories, facts, connectors, graph edges (an agent's knowledge is its own)
  • Shared: Schema, embeddings model config, LLM provider config (infrastructure is shared)
  • Configurable: Whether search can see other agents' data (default: own agent only, --all-agents flag to see everything)

Non-Goals for v1.0

  • No authentication/authorization (agents are trusted, this isn't multi-tenant SaaS)
  • No network-level isolation (single binary, single DB file)
  • No agent-to-agent messaging (that's OpenClaw's job)

Acceptance Criteria

  • Every CLI command respects --agent flag
  • cortex agents lists known agents with stats
  • MCP server accepts agent identity at startup
  • Graph explorer can filter by agent
  • Stats/stale/conflicts all support agent scoping
  • Tests cover agent isolation (agent A's facts don't leak into agent B's search)
  • Documentation explains the multi-agent model

Activity

  1. added
    enhancement
    v1.0
    hardening
    on Feb 25, 2026
  2. hurttlocker commented on Feb 26, 2026

    @hurttlocker
    OwnerAuthor

    All acceptance criteria met:

    --agent wired through every applicable command:

    Command Status Commit
    import βœ… pre-existing
    search βœ… pre-existing
    stats βœ… e4cb3ff
    stale βœ… e4cb3ff
    conflicts βœ… e4cb3ff
    classify βœ… 2b8c0a6
    graph <id> βœ… pre-existing
    graph --serve βœ… 2b8c0a6 (middleware)
    cleanup βœ… 2b8c0a6
    connect sync βœ… 2b8c0a6
    extract N/A file-based, not stored data

    Other criteria:

    851 test functions, 15 packages green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementhardeningv1.0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions