Search foundations

Put deepinfra embeddings to work in retrieval

Deepinfra embeddings turn text into vectors that can help a search system find related passages even when their wording differs. Start with clean, self-contained text, then test whether the retrieved results answer real questions.

Review passages before indexing
Deepinfra landing illustration

One-line value

Use embeddings to retrieve text by meaning, then inspect the source passages before relying on an answer. The right preparation depends on what your readers need to find.

Documentation teams

Readers describe a problem without using the terminology in a product guide.

Embed short sections with their headings so matches retain context. The deepinfra models guide helps teams compare the model options relevant to their workflow.

deepinfra models

Support operations

An agent needs the policy passage that addresses a customer's question.

Index distinct policy passages and return their source references. The deepinfra coding plan guide covers a separate route for coding-oriented work, not support retrieval.

deepinfra coding plan

Research teams

Related findings appear across reports that use different vocabulary.

Search embedded excerpts, then read the surrounding report before drawing conclusions. The deepinfra models guide is a starting point for checking which model suits the corpus.

deepinfra models

Three mechanisms, step by step

A retrieval workflow has three distinct jobs: make useful passages, represent them consistently, and evaluate what comes back.

  1. 1

    Prepare passages

    Remove repeated navigation and split documents at meaningful boundaries. Keep titles or section labels with each passage so an isolated result still makes sense.

  2. 2

    Embed both sides

    Use the same embedding model for stored passages and incoming queries. Keep a record of the model used for each index; switching models calls for re-embedding the stored text.

  3. 3

    Retrieve and check

    Compare query vectors with passage vectors in a search index, inspect the closest matches, and test with questions whose correct source passages you already know.

Limits and edges

A close vector match is a candidate source, not proof that the passage is correct or current.

1

Similarity is not verification

Embeddings can rank a plausible but outdated passage above the policy that currently applies. They do not establish a fact or resolve conflicting sources.

What to do instead

Store dates and source identifiers with passages, filter where appropriate, and check the original document.

2

Long documents need boundaries

Embedding an entire document as one item can bury the specific paragraph a reader needs. Splitting too finely can remove the context that gives a sentence its meaning.

What to do instead

Test passage sizes against representative questions and preserve nearby headings.

3

Models are not interchangeable inside an index

Vectors made with different embedding models may have different dimensions or represent meaning differently. Mixing them can break comparison or make rankings unreliable.

What to do instead

Record the model for every index and rebuild that index when changing models.

4

Sensitive text needs review

Embedding does not anonymize names, confidential passages, or personal details in source text.

What to do instead

Remove or mask information that should not enter the workflow, and review applicable data-handling requirements first.

Choose the text that belongs in the index

The same embedding process serves different readers, but the searchable unit and useful metadata change with the source.

Help articles

Keep the answer beside its heading

A support article may contain several unrelated answers. Index passages that cover one question or policy each, while retaining the article title and a source reference. This makes a matched excerpt easier for an agent to verify.

  • Separate unrelated policies
  • Retain article and section titles
  • Test common customer wording

Technical docs

Preserve the terms developers use

Code symbols, error messages, and version labels often matter as much as semantic similarity. Keep exact identifiers in the passage text and consider combining vector retrieval with keyword matching when those identifiers drive the question.

  • Keep version context
  • Do not strip code identifiers
  • Check results for exact errors

Research notes

Make findings traceable

A short finding without its study, date, or author can be misleading. Attach a citation or document reference to each embedded excerpt so people can read the evidence around a promising match.

  • Retain source references
  • Distinguish findings from commentary
  • Review neighboring passages

From matching text to usable evidence

The useful output of retrieval is not just a similarity ranking; it is a passage a person can locate, read, and assess.

Deepinfra feature illustration accompanying text preparation

Step 1

Make each result understandable alone

A fragment such as “this applies after 30 days” may match a query while concealing what “this” means. Before creating embeddings, include enough nearby context to identify the subject. Test passages outside their original document to catch fragments that need a heading or an additional sentence.

  • Keep a clear subject
  • Preserve the source title
  • Avoid unrelated topics in one passage
Deepinfra feature illustration accompanying retrieval review

Step 2

Evaluate the result, not just the match

Create a small set of real questions and note which source passage should answer each one. After retrieval, check whether the expected passage appears and whether competing results could mislead a reader. Repeat this check when source material or the embedding model changes.

  • Include questions with similar wording
  • Include questions with different wording
  • Inspect incorrect top results

Start with text worth finding

Take a few representative documents, turn them into self-contained passages, and write questions that should retrieve each one. That gives you a practical way to judge whether embeddings help before expanding the index.

Prepare a small retrieval test

  • Keep source references
  • Use one model per index
  • Check matches against real questions
Prepare search text

Deepinfra embeddings FAQ

They represent text as vectors that a retrieval system can compare. Common uses include semantic search and finding relevant passages to supply as context for a separate answering step. An embedding is not itself a written answer.

Check the models available for the language and type of text you need to search, then test candidates on your own questions and documents. Compare whether the correct passages appear, rather than choosing solely by a model name. Keep the chosen model consistent across queries and indexed passages.

A whole-document vector may be too broad to retrieve a specific answer reliably. Split documents into coherent passages and retain headings and source references. Test different boundaries using questions that point to particular sections.

No. The embedding model creates vectors; a search index stores and compares them when a query arrives. Your workflow also needs a way to associate each result with its original passage and source.

Do not assume vectors from the new model are comparable with those already stored. Re-embed the source passages and rebuild the affected index, then evaluate retrieval again. Record which model produced each index to avoid mixing results.

Try AI models
Try AI models