Skip to main content

Request AI

The Request AI client provides a set of operations for interacting with the Ahnlich AI service, which complements the DB client by handling the generation, transformation, and interpretation of embeddings. Instead of managing storage or retrieval directly, the AI client focuses on creating meaningful vector representations from raw data and enabling higher-level reasoning tasks.

Just like the DB client, each operation follows a consistent execution pattern:

  • Request preparation β€” Input parameters are wrapped in a tonic::Request object.

  • Tracing propagation β€” If a tracing_id is provided, it is attached for observability.

  • Execution β€” The client forwards the request to the AI service.

  • Response handling β€” The response is unwrapped and returned in a typed result.

Capabilities​

With Request AI, you can:

  • Generate embeddings β€” Convert text, documents, or structured input into dense vector representations.

  • Interpret embeddings β€” Extract semantic meaning or similarity insights from stored vectors.

  • Support hybrid workflows β€” Combine AI-generated embeddings with DB operations for efficient similarity search.

  • Metadata augmentation β€” Enrich vectors with contextual or domain-specific annotations before persistence.

  • Batch processing β€” Process multiple inputs in a single request for efficiency.

Behavior​

All Request AI operations are designed to:

  • Ensure consistency β€” The same input will always yield the same embedding for reproducibility.

  • Support idempotency β€” Repeated requests with identical input and parameters return identical results.

  • Handle concurrency β€” Multiple requests can be executed in parallel, ensuring scalability under load.

  • Propagate observability β€” Optional tracing IDs allow for debugging and performance monitoring in distributed systems.

Below are the operations for generating embeddings, interpreting inputs, and integrating AI-driven vectors into the Ahnlich ecosystem.