Skip to main content
POST
Embeddings
Get semantic embeddings for state descriptions using Stratus encoders.

Endpoint

Use Cases

  • State similarity: Compare states for agent memory/history
  • Goal matching: Find similar historical goals
  • Clustering: Group similar states/actions
  • Search: Semantic search over agent experiences

Request Format

Example Request

TypeScript

Python

cURL

Response Format

Example Response

Model Names

For embeddings, use Stratus model without LLM suffix: Recommendation: Use stratus-x1ac-small for most applications.

Batch Embeddings

Embed multiple texts in one request:
Limits:
  • Max 100 texts per request
  • Max 2048 tokens per text

Encoding Formats

The encoding_format parameter controls how embedding vectors are returned in the response.

Float Format (Default)

Returns embeddings as an array of floating-point numbers. This is the default and most common format.
Response:
Best for:
  • Direct computation (cosine similarity, dot product)
  • Mathematical operations
  • Storage in databases with vector types (PostgreSQL pgvector, Pinecone, etc.)
  • Most common use cases

Base64 Format

Returns embeddings as base64-encoded binary data. More efficient for network transfer.
Response:
Best for:
  • Network efficiency (smaller payload size)
  • Binary storage systems
  • High-throughput batch processing
  • Bandwidth-constrained environments

Decoding Base64 Embeddings

TypeScript/Node.js

Python

Format Comparison

When to Use Each Format

Use Float When:

  • Building prototypes or demos
  • Need immediate access to values
  • Debugging or inspecting embeddings
  • Working with small batches (<10 embeddings)
  • Simplicity is more important than efficiency

Use Base64 When:

  • Processing large batches (100+ embeddings)
  • Network bandwidth is limited
  • Transferring embeddings between systems
  • Storing embeddings in binary format
  • Optimizing for production throughput

Example: Efficient Batch Processing

Use Case Examples

State Similarity

Compare agent states to find similar situations:

Goal Matching

Find past goals similar to current goal:
Build a semantic search over agent memory:

Comparison with Other Embeddings

When to use Stratus embeddings:
  • Comparing agent states
  • Finding similar goals
  • Agent memory/experience retrieval
  • State-action pattern matching
When to use general embeddings:
  • Document search
  • FAQ matching
  • Content recommendation

Performance

Latency

Throughput

  • Single text: ~1000 req/s (base model)
  • Batch (10 texts): ~200 req/s

Pricing

Embeddings are priced per 1M tokens: Example:
  • Text: “Google homepage with search box” (6 tokens)
  • Cost: 6 / 1,000,000 * 0.10=0.10 = 0.0000006

Error Handling

Next Steps