gRPC API Reference
The Soul Kernel exposes its core functionality through a gRPC API, enabling language-agnostic communication between the Rust kernel and various shells (iOS, Unity, Physical AI).Overview
The gRPC API provides three core operations:- Init: Initialize a new Soul session
- Ask: Process queries with streaming responses
- Remember: Store memories in the Soul’s memory graph
Service Definition
Endpoints
Init - Create a Soul Session
Initialize a new Soul with a name and optional metadata. Request:Ask - Query the Soul
Send queries to the Soul and receive streaming responses. Supports progressive text generation, thinking status, and skill execution feedback. Request:-
Text Chunks: Progressive text generation
-
Thinking Status: Processing feedback
-
Skill Execution: Skill activity feedback
Remember - Store Memories
Store new memories in the Soul’s memory graph. Request:Common Types
ResponseMetadata
All responses include metadata for observability:Client Examples
Rust Client
Python Client
JavaScript/TypeScript Client
Error Handling
The gRPC API uses standard gRPC status codes:| Code | Meaning | Example |
|---|---|---|
OK | Success | Normal response |
INVALID_ARGUMENT | Bad request | Missing soul_id |
UNAUTHENTICATED | Invalid session | Expired token |
NOT_FOUND | Soul not found | Unknown soul_id |
RESOURCE_EXHAUSTED | Rate limited | Too many requests |
INTERNAL | Server error | Database failure |
Performance
- Latency: p95 < 1s (online), < 6s (offline)
- Streaming: First chunk typically arrives within 100-200ms
- Throughput: Supports 1000+ concurrent connections
- Binary Size: Server binary < 20MB
Security
- Session tokens expire after 24 hours
- All responses include correlation IDs for tracing
- TLS encryption recommended for production
- Rate limiting per soul_id
Proto File Location
The complete protobuf definition is located at:Change Log
| Date | Version | Changes |
|---|---|---|
| 2025-06-12 | 0.1.0 | Initial gRPC API implementation with Init/Ask/Remember |