ReferenceAPI
Overview
Overview of GoodMem APIs - choosing between gRPC and REST protocols
GoodMem API Overview
GoodMem provides two equivalent API protocols for vector-based memory storage and retrieval: gRPC and REST. Both APIs offer the same functionality and are automatically kept in sync.
Protocol Comparison
| Feature | gRPC | REST |
|---|---|---|
| Performance | Binary protocol, faster | JSON over HTTP, standard |
| Type Safety | Strong typing via Protocol Buffers | JSON with OpenAPI schemas |
| Streaming | Bidirectional streaming support | Request/response only |
| Browser Support | Requires gRPC-Web | Native browser support |
| Tooling | Protocol buffer ecosystem | Standard HTTP tools |
| Best For | Backend services, high performance | Web apps, integrations, testing |
Choosing a Protocol
Use gRPC when:
- Building backend services or microservices
- Performance is critical
- You need streaming capabilities
- Your team is comfortable with Protocol Buffers
- Type safety is important
Use REST when:
- Building web applications or frontend integrations
- Working with standard HTTP tooling
- You need browser compatibility
- Your team prefers JSON APIs
- You're prototyping or testing
Authentication
Both protocols use the same authentication method:
gRPC: Include API key in metadata
authorization: Bearer your_api_key_hereREST: Include API key in HTTP header
Authorization: Bearer your_api_key_hereError Handling
Both protocols return the same error information:
gRPC: Uses standard gRPC status codes
UNAUTHENTICATED- Invalid or missing API keyPERMISSION_DENIED- Insufficient permissionsNOT_FOUND- Resource does not existINVALID_ARGUMENT- Invalid request parametersINTERNAL- Server-side error
REST: Maps to standard HTTP status codes
401 Unauthorized- Invalid or missing API key403 Forbidden- Insufficient permissions404 Not Found- Resource does not exist400 Bad Request- Invalid request parameters500 Internal Server Error- Server-side error
Rate Limiting & Quotas
Both protocols share the same rate limits and quota enforcement. Rate limit information is provided in response headers (REST) or metadata (gRPC).
Data Formats
gRPC: Uses Protocol Buffer binary format
- UUIDs are sent as 16-byte binary values
- Timestamps use
google.protobuf.Timestamp - Efficient binary encoding
REST: Uses JSON format
- UUIDs are sent as standard string format (8-4-4-4-12)
- Timestamps are ISO 8601 strings
- Human-readable JSON structure
Getting Started
- Get an API Key: Create an API key using the CreateApiKey method
- Choose Your Protocol: Select gRPC or REST based on your use case
- Explore the APIs: Browse the service documentation for your chosen protocol
- Try It Out: Use the provided examples to make your first API calls
Next Steps
- gRPC Reference - Complete gRPC API documentation
- REST Reference - Complete REST API documentation (coming soon)