Skip to main content

ALLGATE / DEVELOPER WORKFLOW GUIDE

Embeddings and reranking APIs for semantic search and RAG.

Embeddings convert text into vectors for similarity search. Reranking scores retrieved documents against a query. Together they can support retrieval-augmented generation (RAG), while your application manages documents, vector storage, access control and the final answer workflow.

01 / WORKFLOW

Prepare documents and create compatible vectors

Split source documents into chunks that preserve useful context and keep a source identifier with each chunk. Send text to the embeddings endpoint using an available embedding model. Store the returned vectors in your own index. Use the same compatible model and dimensional configuration for document and query vectors; changing the embedding model can require rebuilding the index.

02 / WORKFLOW

Retrieve candidates, then rerank a bounded set

Embed the user query and run similarity search in your storage layer. Enforce document permissions before exposing candidate content. Pass a manageable list of candidate texts and the query to the rerank endpoint, then use its returned indices and scores to order the original documents. Reranking improves the selection step; it does not replace a searchable vector store or authorize access to private documents.

03 / WORKFLOW

Generate answers with sources and evaluate retrieval

Send the selected passages to a compatible language model along with instructions for using the context and citing sources. Handle cases where retrieval finds no suitable evidence. Evaluate against representative questions with known source documents, looking at retrieval relevance separately from answer quality. This makes it easier to tell whether chunking, ranking or the final prompt needs attention.

Request example

This example does not execute automatically. Verify the current model and parameters, then set these environment variables on your server. Replace any YOUR_* placeholders with confirmed supported values.

Server environment
export ALLGATE_BASE_URL='https://api.allgate.ai/v1'
export ALLGATE_API_KEY='YOUR_API_KEY'
HTTP · curl
curl --fail-with-body --silent --show-error "$ALLGATE_BASE_URL/embeddings" \
  -H "Authorization: Bearer $ALLGATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_EMBEDDING_MODEL",
    "input": ["Allgate gateway", "openai compatible gateway"]
  }'

curl --fail-with-body --silent --show-error "$ALLGATE_BASE_URL/rerank" \
  -H "Authorization: Bearer $ALLGATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_RERANK_MODEL",
    "query": "Allgate model gateway",
    "documents": [
      "The weather is nice today",
      "Allgate is a unified model gateway",
      "A cat is sitting on a mat"
    ],
    "top_n": 2
  }'

Reranking request and response index reference →

Check models and current availability

These entries come from the public catalogue build snapshot. A listing does not guarantee endpoint capability or continuing supply. For audio, verify synthesis or transcription support separately. Open a model to check its exact ID, settings and billing unit.

Catalogue snapshot:

This catalogue snapshot has no matching model entries for this workflow. Check the live catalogue before integrating and do not guess a model ID.

Compare live models and API pricing →

Costs and workflow limits

Embedding, reranking and answer generation are separate model calls. Check each model’s billing unit: do not assume every retrieval step shares a token rate. Estimate initial document indexing separately from recurring queries, and include candidate volume and final context length. Allgate provides model API access, not a managed document repository or vector database.

Review API pricing and prepaid credits →

COMMON QUESTIONS

Before you integrate

Does an embeddings API include a vector database?
No. The embeddings endpoint returns vectors. Your application chooses and operates storage, similarity search, document permissions and index updates.
When should I use a reranking API?
Use reranking after an initial retrieval step when you want to score a bounded candidate set against the query. Evaluate its quality and extra cost on your own workload.
Can I switch embedding models without reindexing?
Do not assume that vectors from different models are comparable. Verify dimensions and compatibility; a model change may require re-embedding the documents.