RFC: Composable Peers v2 — Universal Identity Containers for Honcho
Status: Draft (v2) Owner: vineeth Last updated: 2026-03-25
Changelog from v1: This v2 update incorporates decisions from the full spec-writing process. Key changes:
- Peer files (Section 4.3) extracted to standalone
file-system-primitives.mdspec with versioning, auto-embedding, and storage backend abstraction- Materialized dreams (Section 4.5) extracted to standalone
dreaming-enhancements.mdspec with TaggingSpecialist, dream_definitions table, and consolidation improvements- Custom instructions (Section 4.2) confirmed as in-progress work — field exists in config schema but not yet injected into prompts
- Non-goals updated: multi-modal support now has its own spec (
multi-modal.md), so binary files are handled there, not here- Conclusion tagging (public metadata on documents) now has its own spec (
conclusion-tagging.md), which this RFC depends on- Reasoning traces now have their own spec (
reasoning-traces.md), enabling the provenance chain needed for invalidation (Section 4.4)- Implementation phases updated to reflect dependency ordering across all specs
Original preserved at:
rfc-composable-peers.v1.md
1. Problem Statement
(Unchanged from v1 — the core problems remain.)
Honcho’s peer model is intended to represent arbitrary concepts — people, agents, groups, organizations, projects — but in practice peers are treated as individual interlocutors in conversations. The system’s rigidity manifests in:
- Peers are not composable. No way to express “engineering-team contains alice, bob, charlie” or segment a peer’s identity.
- Data flows only through conversations. No way to feed arbitrary documents or external data without synthetic sessions.
- No per-peer extraction guidance. The deriver treats every peer identically. (Being addressed by custom instructions — in progress.)
- The reasoning chain is immutable. No rename, merge, split, or correction operations.
- No developer-extensible reasoning. (Now addressed by
dreaming-enhancements.md.) - Files aren’t native. (Now addressed by
file-system-primitives.md.)
Competitive Context
(Unchanged from v1 — Supermemory analysis still applies.)
2. Goals
- Sub-peer composition — any peer can have sub-peers, any peer can belong to multiple parents, knowledge aggregates upward.
- Custom instructions — per-peer, per-session, per-message extraction context. (In progress separately.)
- Peer files — peer-scoped versioned file storage with semantic search. (Detailed in
file-system-primitives.md.) - Restructuring operations — rename, merge, split with managed invalidation.
- Materialized dreams — developer-defined recurring investigations. (Detailed in
dreaming-enhancements.md.) - Session-level filtering — fine-grained isolation in dialectic and conclusion queries.
- Dialectic enhancement — new tools for sub-peer navigation, file search, dream outputs. (Detailed in
dialectic-enhancements.md.)
3. Non-Goals
Storing binary files.→ Binary support now handled bymulti-modal.mdspec (images, PDFs via external storage).- Turning Honcho into a general-purpose vector database.
- Breaking backward compatibility.
- Introducing a new entity type. Sub-peers are just peers.
4. Design
4.1 Sub-peers: Hierarchical Peer Composition
(Core design unchanged from v1.)
A peer can have sub-peers, and a peer can belong to multiple parent peers. Sub-peers are regular peers with a membership relationship.
Knowledge aggregation is directional:
- Query a parent peer → sees parent’s own knowledge + all sub-peers’ knowledge
- Query a sub-peer → sees only that sub-peer’s knowledge
Schema:
CREATE TABLE peer_memberships (
id TEXT PRIMARY KEY,
workspace_name TEXT NOT NULL,
parent_peer TEXT NOT NULL,
child_peer TEXT NOT NULL,
metadata JSONB DEFAULT '{}',
created_at TIMESTAMPTZ DEFAULT now(),
UNIQUE (workspace_name, parent_peer, child_peer),
FOREIGN KEY (parent_peer, workspace_name) REFERENCES peers(name, workspace_name),
FOREIGN KEY (child_peer, workspace_name) REFERENCES peers(name, workspace_name)
);API surface:
POST /v3/workspaces/{id}/peers/{parent}/members -- add sub-peer
GET /v3/workspaces/{id}/peers/{parent}/members -- list sub-peers
DELETE /v3/workspaces/{id}/peers/{parent}/members/{child} -- remove sub-peer
GET /v3/workspaces/{id}/peers/{peer_id}/parents -- list parent peers
Aggregation behavior:
- Default depth: 1 (self + immediate children)
- Configurable via
depthparameter:0= self only,1= default,2= two levels,all= full tree - Cycle detection at membership creation time
Many-to-many membership: A peer can belong to multiple parents. Knowledge aggregates upward to all parents.
Interaction with observer/observed model: Collections store conclusions at the individual peer level. Sub-peer aggregation happens at query time, not storage time.
4.2 Custom Instructions
(In progress separately — field exists in ReasoningConfiguration.custom_instructions but is not yet injected into prompts.)
Peers, sessions, and messages each gain a freeform custom_instructions field that the deriver incorporates into its extraction prompt:
- Peer-level: what kind of entity, what to focus on
- Session-level: what this session represents
- Message-level: what this specific content is
4.3 Peer Files
→ See file-system-primitives.md for full design.
Summary of what changed from v1:
- Versioning added: Each file write creates a new version (PostgreSQL
file_versionstable). Full edit history preserved. - Auto-embedding: Files are automatically chunked and embedded for semantic search at the peer level.
- Storage backend abstraction: Configurable backend (PostgreSQL for text, S3/GCS/local for large content).
- Agent tools:
search_files,read_file,grep_filestools for dialectic and dreamer.
4.4 Reasoning Chain Invalidation
(Updated from v1 to leverage reasoning traces from reasoning-traces.md.)
Approach: Staleness propagation with dreamer reconciliation.
- Staleness flag. Documents (conclusions) gain
staleboolean andstale_reasontext ininternal_metadata. - Source tracking. Documents already have
source_ids. When a source is marked stale, downstream conclusions referencing it are also marked stale. - Dreamer reconciliation. The dreamer gains a
reconcile_staletask type (seedreaming-enhancements.mdconsolidation improvements). - Reasoning trace linkage. Each conclusion links to its reasoning trace (see
reasoning-traces.md). When reconciling, the dreamer can inspect the original reasoning to decide whether the conclusion is still valid.
Restructuring operations:
| Operation | Mechanism |
|---|---|
| Delete message | Tombstone message; mark directly-derived conclusions stale; dreamer reconciles |
| Rename peer | Create new peer; migrate memberships, files, conclusions; tombstone old peer |
| Merge peers | Create target peer; migrate from sources; dreamer resolves duplicates; tombstone sources |
| Split peer | Create sub-peers; move conclusions by criteria; mark affected conclusions stale |
| Correct conclusion | Update content; mark downstream conclusions stale; dreamer reconciles |
API surface:
POST /v3/workspaces/{id}/peers/{peer_id}/rename -- {new_name: str}
POST /v3/workspaces/{id}/peers/merge -- {sources: [peer_ids], target_name: str}
POST /v3/workspaces/{id}/peers/{peer_id}/split -- {criteria: {...}, sub_peer_names: [str]}
4.5 Materialized Dreams
→ See dreaming-enhancements.md for full design.
Summary of what changed from v1:
- dream_definitions table with full CRUD API.
- Three trigger types: cron (scheduled), on_change (debounced), on_demand (explicit API call).
- Three output types: conclusions (stored as tagged observations), metadata (stored in collection internal_metadata), prose (written to peer files when file system is available).
- TaggingSpecialist: New specialist that auto-generates tags on observations based on patterns.
- Consolidation improvements: Near-duplicate detection, staleness scoring, capacity pressure.
4.6 Session-Level Filtering
(Unchanged from v1.)
Dialectic and conclusion query endpoints gain session-level filtering:
honcho.peers.get_representation(
peer_id="alice",
session_ids=["session-123", "session-456"]
)
honcho.peers.get_representation(
peer_id="alice",
exclude_session_ids=["private-session-789"]
)Composes with sub-peers and metadata filters.
4.7 Dialectic Enhancement
→ See dialectic-enhancements.md for structured outputs, evidence, and completions endpoint.
Additional tools for composable peers:
list_sub_peers(peer_id)— discover sub-peerslist_parent_peers(peer_id)— discover parentssearch_files(peer_id, query, top_k)— semantic search across peer’s files (from file-system-primitives)read_file(peer_id, path)— read a peer fileget_materialized_dream(peer_id, dream_name)— read a dream output
Existing tools (search_memory, get_representation) automatically include sub-peer knowledge when called on a parent peer.
5. Mapping: Endearing’s Supermemory Architecture
(Unchanged from v1.)
| Supermemory Pattern | Composable Peers Equivalent |
|---|---|
user_{id} container | Parent peer — query for full knowledge |
groupchat_{chatId} container | Sub-peer — query for scoped knowledge |
user_{id}-chat_{chatId} | Sub-peer or session filter |
| Entity context per container | Custom instructions per peer |
client.profile() | Representation on parent peer + materialized dream |
| Fan-out search | Query parent peer (aggregates automatically) |
| Container isolation | Query specific sub-peer |
| Container merging | Peer merge operation with dreamer reconciliation |
6. Schema Changes Summary
New tables (this RFC only — files and dreams have their own specs):
CREATE TABLE peer_memberships (
id TEXT PRIMARY KEY,
workspace_name TEXT NOT NULL,
parent_peer TEXT NOT NULL,
child_peer TEXT NOT NULL,
metadata JSONB DEFAULT '{}',
created_at TIMESTAMPTZ DEFAULT now(),
UNIQUE (workspace_name, parent_peer, child_peer),
FOREIGN KEY (parent_peer, workspace_name) REFERENCES peers(name, workspace_name),
FOREIGN KEY (child_peer, workspace_name) REFERENCES peers(name, workspace_name)
);Modified tables:
documents: Addstaleandstale_reasontointernal_metadata(no schema migration — JSONB field)
Dependencies on other specs:
conclusion-tagging.md— publicmetadatacolumn on documents (must land first)file-system-primitives.md—peer_filesandfile_versionstablesdreaming-enhancements.md—dream_definitionstablereasoning-traces.md—reasoning_tracestable (for invalidation provenance)
7. Implementation Phases
Phase 1: Sub-peers (depends on: nothing)
- Implement
peer_membershipstable and CRUD endpoints - Aggregation logic in representation, conclusion queries, and search
- Cycle detection at insertion time
- Configurable aggregation depth
- Validates: does sub-peer composition cover target modeling scenarios?
Phase 2: Session-Level Filtering (depends on: nothing)
- Add
session_idsandexclude_session_idsparams to dialectic and conclusion queries - Filter on
documents.session_name - Validates: does session filtering provide useful isolation?
Phase 3: Invalidation & Restructuring (depends on: conclusion-tagging, reasoning-traces)
- Staleness propagation via
source_idsDAG - Dreamer
reconcile_staletask (from dreaming-enhancements) - Peer rename, merge, split API endpoints
- Validates: can the system recover coherent state after restructuring?
Phase 4: Dialectic Integration (depends on: phases 1-3, file-system-primitives, dreaming-enhancements)
- New tools:
list_sub_peers,list_parent_peers,search_files,read_file,get_materialized_dream - Aggregation in existing tools when called on parent peers
- Validates: does the dialectic effectively use hierarchical knowledge?
8. Open Questions
-
Aggregation depth default. Should default be 1 (immediate children) or 0 (self only, opt-in)? Recommend: 1, with clear documentation.
-
Collection model interaction. When querying a parent peer’s representation, should we fan-out to all sub-peer collections? Recommend: query-time fan-out (simpler, no aggregate collections to maintain).
-
Staleness during active ingestion. The deriver should skip stale conclusions as premises. The dreamer should prioritize reconciliation over new dream tasks.
-
Multi-parent knowledge exposure. A peer in multiple parents exposes its knowledge to all parents. Document this clearly — it’s by design but could surprise developers.
-
Restructuring atomicity. Rename/merge/split operations should be atomic or use a state machine with rollback. Recommend: queue-based with progress tracking (similar to dream task pattern).
9. Success Criteria
- Model people, teams, brands, codebases, documents, and multi-agent systems using composable peers with sub-peers.
- Parent peer aggregates sub-peer knowledge. Sub-peer provides isolation. Both without special configuration.
- Peer rename, merge, split operations recover coherent state via dreamer reconciliation.
- All changes are additive — existing API consumers experience no breaking changes.
- SDK v2.1 with sub-peer management methods.
Appendix A: Modeling Scenarios
(Unchanged from v1 — all scenarios still apply. See rfc-composable-peers.v1.md Appendix A for full scenarios covering: People, Teams, Brands, Codebases, Documents, Autonomous Agents, Multi-Agent Orchestration.)