Define SessionContext, AgentLineage, AgentType, ToolType, OverrideLevel, SubagentResult, and other shared types used across all services. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Proto Definitions
This directory contains all Protocol Buffer definitions for the llm-multiverse service mesh.
Prerequisites
Install the buf CLI:
# Linux (x86_64)
curl -sSL https://github.com/bufbuild/buf/releases/latest/download/buf-Linux-x86_64 \
-o /usr/local/bin/buf && chmod +x /usr/local/bin/buf
# Or via Go
go install github.com/bufbuild/buf/cmd/buf@latest
Directory Structure
proto/
├── buf.yaml # Module config + lint rules
├── buf.gen.yaml # Code generation targets (Rust + Python)
├── llm_multiverse/v1/ # All proto definitions (versioned API)
│ ├── common.proto # Shared types: SessionContext, AgentLineage
│ ├── audit.proto # AuditService (write-only append log)
│ ├── secrets.proto # SecretsService (GetSecret only)
│ ├── memory.proto # MemoryService (Write, Query, GetCorrelated)
│ ├── model_gateway.proto # ModelGatewayService (Inference, Embedding)
│ ├── search.proto # SearchService (Search)
│ ├── tool_broker.proto # ToolBrokerService (Execute, Validate, Discover)
│ └── orchestrator.proto # OrchestratorService (subagent return schema)
└── scripts/
└── generate.sh # CI-ready lint + build + generate script
Usage
Lint all protos
cd proto && buf lint
Build (compile check)
cd proto && buf build
Generate stubs
cd proto && bash scripts/generate.sh
Generated code is output to gen/rust/src/ and gen/python/ (at repo root).
Breaking change detection
cd proto && buf breaking --against '.git#subdir=proto'
Conventions
- Package: All protos use
llm_multiverse.v1 - Session context: Every RPC request message must include a
SessionContextfield (defined incommon.proto) for audit trail and broker enforcement - Streaming: Use server-streaming RPCs for large/progressive output (token generation, corpus retrieval). Use unary RPCs for simple operations (cache hits, writes, validation)
- Naming: Service names match the service they define (e.g.,
AuditServiceinaudit.proto)
Adding a New Proto
- Create
proto/llm_multiverse/v1/<service>.proto - Set
syntax = "proto3";andpackage llm_multiverse.v1; - Import
common.protofor shared types:import "llm_multiverse/v1/common.proto"; - Run
buf lintto validate - Run
buf buildto compile-check - Update
buf.gen.yamlif new generation targets are needed