The Go client is primarily used for Chroma’s internal services and backend infrastructure. For application development, we recommend using the Python or JavaScript clients which provide more comprehensive client APIs.
Package Structure
Chroma’s Go codebase is organized into several key packages:Core Packages
Types Package
Thetypes package provides fundamental type definitions:
types.go
Common Package
Provides shared constants and component interfaces:SysDB Coordinator
The coordinator package manages metadata and system state:Dependencies
Key dependencies used in the Go codebase:go.mod
Building from Source
To build the Go components:Prerequisites
- Go 1.23+ - The project requires Go 1.23.0 or later
- Protocol Buffers - Install
protoc,protoc-gen-go, andprotoc-gen-go-grpc - PostgreSQL (for development) - Required for local testing
Database Setup
For local development with PostgreSQL:Schema Migrations
Chroma uses Atlas for schema migrations:gRPC Services
The Go backend provides gRPC services for internal communication:Development Workflow
- Make changes to Go source files
- Generate protobuf files:
make build - Run tests:
go test ./... - Apply migrations if schema changed
Architecture Overview
The Go backend serves as Chroma’s distributed system coordinator:- Coordinator Service: Manages metadata, collections, and segments
- gRPC APIs: Internal service communication
- SysDB: Metadata storage using PostgreSQL
- Storage Integration: S3 and local filesystem support
Related Resources
Python Client
Recommended client for application development
JavaScript Client
Browser and Node.js client library
CLI Reference
Command-line interface documentation
GitHub Repository
View source code and contribute