SwiftRelay

← All sprint notes

Your First Embedding Lap: A Request Checklist

First lapsEN

An embedding request turns text into coordinates

An embedding request sends text to an embedding model and receives a list of numbers called a vector. Those numbers represent patterns in the text that help software measure similarity. You usually store and compare them rather than read them.

Think of a support article about changing a password. Someone searching for “I cannot get into my account” might need that article even though the wording differs. Embeddings can help connect related meanings without requiring an exact keyword match.

An embedding request does not normally produce a written answer. That is the job of a text-generation request. Embeddings help find useful material; generation helps explain it.

Start with a task that needs similarity

You actually need embeddings when comparing meaning is an important part of your application. Common starting points include:

  • Semantic search: Find relevant documentation when people use different words from the author.
  • Retrieval for an assistant: Select useful passages from a document collection before asking a model to answer.
  • Related-content suggestions: Find articles or support tickets that discuss similar topics.
  • Clustering: Group feedback into themes for later review.

Embeddings are not automatically necessary because your product uses AI. A chatbot answering from a short prompt can work without them. So can a summarizer that receives the whole document directly. Exact identifiers, invoice numbers, and product codes often benefit more from ordinary database queries or keyword search.

Follow one document through the retrieval lap

Imagine building an assistant for an internal handbook. First, divide the handbook into useful passages. Keep headings with their paragraphs, and avoid cutting instructions halfway through a step.

Next, send those passages to an embedding model. Store each returned vector alongside the original text, its document identifier, and useful metadata such as department or access level. A vector-capable database or search engine can handle similarity queries; a separate vector database is not always required.

When someone asks a question, embed that question using the same embedding model and configuration. Search the stored vectors for relevant passages. Then send the selected text and the question to a generation model, such as Claude Sonnet 5, to draft an answer.

Retrieval is not a guarantee of correctness. Check whether the selected passages actually support the answer, and give the assistant a way to say the documents do not contain enough information.

Check the embedding endpoint before wiring requests

OpenAI-compatible embedding APIs commonly accept a model identifier and text input at an embeddings endpoint. Their responses contain vectors, not conversational messages. A service supporting chat requests does not necessarily support embedding requests or every embedding model.

SwiftRelay is a practical option for the generation step if you want pay-as-you-go access through an OpenAI-compatible SDK. Its API host is https://api.fastapirelay.com, and OpenAI SDK configurations use the host with /v1 appended. Before routing embeddings through any relay, including SwiftRelay, confirm its current embedding endpoint and model support.

Sign up for SwiftRelay to try the generation side with the small gift credit available to new accounts.

Run these checks before indexing everything

  • Keep vectors compatible: Matching vector length alone is insufficient. Use the same embedding model and settings for documents and queries.
  • Plan for updates: Re-embed changed passages. Switching embedding models usually means rebuilding the stored vectors.
  • Protect private content: Review what text leaves your system, and enforce document permissions before passages reach the answering model.
  • Test real questions: Inspect retrieved passages, including results for ambiguous questions and requests with no answer.
  • Track separate costs: Initial indexing, document updates, query embeddings, storage, and answer generation each contribute to the bill.

Begin with a small document collection and a handful of realistic questions. Add embeddings when finding related meaning solves a visible problem, not simply because a vector store appears on an architecture diagram.

Keep reading

Back for another lap?Log in