Skip to content

API Contract

This document extracts the API contract from the ChronosVector Technical PRD, covering REST endpoints, gRPC services, error codes, timestamp semantics, and supported vector types.


TypeStorage Size (D=768)Use Case
FP323072 bytesDefault. Full precision for hot tier.
FP161536 bytesWarm tier option for 2x compression with <1% recall loss.
INT8 (Scalar Quantized)768 bytes4x compression. Good for large-scale with moderate accuracy needs.
PQ (Product Quantized)8-64 bytes (configurable)Cold tier. 50-400x compression. Lossy.

  • Timestamps are i64 representing microseconds since Unix epoch.
  • Negative timestamps are valid (pre-1970 data for historical corpora).
  • Timestamp resolution: microsecond. Sub-microsecond events at the same entity_id are rejected (collision).
  • Timestamps must be monotonically increasing per entity. Out-of-order ingestion returns error with option to force (overwrite).

MethodPathDescriptionRequest BodyResponse
POST/v1/ingestBatch insert{ points: [TemporalPoint] }{ receipts: [WriteReceipt] }
POST/v1/queryExecute queryQueryRequestQueryResponse
GET/v1/entities/{id}Entity timeline infoEntityTimeline
GET/v1/entities/{id}/trajectoryFetch trajectory?t1=&t2=[TemporalPoint]
GET/v1/entities/{id}/velocityVector velocity?t={ velocity: [f32], magnitude: f32 }
GET/v1/entities/{id}/changepointsList change points?t1=&t2=&method=[ChangePoint]
GET/v1/healthHealth check{ status, uptime, version }
GET/v1/readyReadiness probe200 or 503
POST/v1/admin/compactTrigger compaction{ tier: "hot_to_warm" }{ status: "started" }
GET/v1/admin/statsSystem statisticsSystemStats

service ChronosVector {
rpc IngestStream (stream TemporalPoint) returns (stream WriteReceipt);
rpc Query (QueryRequest) returns (QueryResponse);
rpc QueryStream (QueryRequest) returns (stream ScoredResult);
rpc WatchDrift (WatchRequest) returns (stream DriftEvent);
}

HTTPgRPCMeaning
400INVALID_ARGUMENTMalformed request, dimension mismatch, invalid timestamp
404NOT_FOUNDEntity not found
409ALREADY_EXISTSDuplicate (entity_id, timestamp) with different vector hash
422FAILED_PRECONDITIONInsufficient data for requested operation (e.g., prediction with <5 points)
429RESOURCE_EXHAUSTEDRate limit exceeded
500INTERNALUnexpected error
503UNAVAILABLENot ready (WAL recovery in progress, index loading)