Skip to content

feat: shared read-only context DB for sub-agent team coordination #292

@100yenadmin

Description

@100yenadmin

Idea

Allow teams of coding agents (main agent + sub-agents) to share a read-only view of each other's compacted context. Currently each session has its own conversation in the same lcm.db, but sub-agents cannot query other sessions' summaries or understand what their teammates have done.

Use Case: Coding Team Orchestration

A main "chief of staff" agent spawns sub-agents for different tasks (testing, refactoring, documentation). Each sub-agent works independently but would benefit from knowing:

  • What files other agents have modified (from their session summaries)
  • What decisions were made in other sessions
  • What the main agent's current priorities are

Currently this requires the main agent to explicitly relay context to each sub-agent, which wastes tokens and is lossy.

Possible Approaches

A. Cross-session lcm_grep

Extend lcm_grep to search across all conversations in the DB (not just the current session). Sub-agents could query lcm_grep("what has the testing agent done?") to pull summaries from other sessions.

B. Shared context assembly

Allow a sub-agent to include summaries from a designated "parent" session in its assembled context. The parent's high-level condensed summaries (depth 2+) provide team awareness without duplicating raw messages.

C. Separate team coordination DB

Create a lightweight secondary database that stores:

  • Per-session activity summaries (auto-generated after each compaction)
  • File modification logs
  • Decision/outcome records

Sub-agents read from this DB for team context. Writes are append-only from each session's compaction lifecycle.

Considerations

  • SQLite concurrent read support via WAL mode makes shared reading feasible
  • The existing statelessSessionPatterns config could gate which sessions participate
  • The ignoreSessionPatterns config already excludes cron sessions — similar filtering for team DBs
  • Read-only access prevents sub-agents from corrupting each other's state
  • Team context should use condensed summaries (depth 1+) to minimize token overhead

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions