Central Protocol Buffer Schemas and Multi-Language Code Generation for the Paper AI Ecosystem.
paper-proto is the single source of truth for all gRPC service interfaces and message schemas across the Paper ecosystem. It defines cross-repository contracts using Protocol Buffers v3 and provides automated code generation for Python and TypeScript stubs.
paper-proto (Schema Source of Truth)
|
| `buf generate`
+------------------+------------------+
| |
generated/python/ generated/typescript/
| |
Consumed by paper-core, paper-caller, Consumed by paper-cli,
paper-memory, paper-tools, paper-mcp web client dashboards
- Contract-First Architecture: All API changes must originate in
paper-proto. No application repository defines custom inter-service network schemas. - Breaking Change Detection: Enforces strict linting and backward-compatibility rules via
buf.
paper-proto/
├── proto/ # Protocol Buffer source files
│ └── paper/
│ ├── core/v1/ # AIService & AIStreamService contracts
│ ├── caller/v1/ # VoiceService contracts
│ ├── memory/v1/ # MemoryService contracts
│ └── tools/v1/ # ToolService contracts
├── generated/ # Generated stubs (committed)
│ ├── python/ # Python gRPC stubs (*_pb2.py, *_pb2_grpc.py)
│ └── typescript/ # TypeScript gRPC web/node stubs (*.ts)
├── buf.yaml # Buf module configuration
├── buf.gen.yaml # Buf code generation plugin pipeline
├── Makefile # Build automation shortcuts
└── README.md
| Service | Proto Package | File Path | Primary RPC Methods |
|---|---|---|---|
AIService |
paper.core.v1 |
proto/paper/core/v1/ai_service.proto |
Generate() |
AIStreamService |
paper.core.v1 |
proto/paper/core/v1/ai_service.proto |
StreamGenerate() |
VoiceService |
paper.caller.v1 |
proto/paper/caller/v1/voice_service.proto |
StreamAudio() |
MemoryService |
paper.memory.v1 |
proto/paper/memory/v1/memory_service.proto |
GetContext(), SaveTurn() |
ToolService |
paper.tools.v1 |
proto/paper/tools/v1/tool_service.proto |
ExecuteTool() |
- Buf CLI (
v1.30+) - Python 3.12+
- Node.js 20+
# Clone repository
git clone https://github.com/artificialpaper/paper-proto.git
cd paper-proto
# Lint proto definitions
buf lint
# Check backward compatibility against main branch
buf breaking --against '.git#branch=main'
# Generate Python and TypeScript stubs
buf generateUsing make:
make lint
make generate- Syntax: All files must declare
syntax = "proto3";. - Package Naming: Follow
paper.<subsystem>.v1conventions. - Field Names:
snake_casefor fields,CamelCasefor messages/services,UPPER_SNAKE_CASEfor enums. - Field Numbers: Use 1-15 for hot/frequently serialized fields (single byte tag encoding).
- paper-core - Central LLM Inference Gateway
- paper-caller - Real-Time Voice AI Agent Runtime
- paper-memory - Session Memory & RAG Store
- paper-docs - Official Ecosystem Documentation Portal
This project is licensed under the MIT License - see the LICENSE file for details.