ai-agent

Embeddings

Embeddings are dense vector representations of text (or other data) produced by a neural network, where semantically similar content maps to nearby points in vector space.

An embedding model transforms a piece of text — a word, sentence, paragraph, or document — into a fixed-length vector of floating-point numbers. The model is trained so that semantically related texts produce vectors that are geometrically close (high cosine similarity), while unrelated texts produce distant vectors. This property allows semantic search: a query vector finds documents by meaning rather than exact keyword match.

Embeddings are the foundation of modern retrieval systems, clustering algorithms, recommendation engines, and RAG pipelines. Common embedding models include OpenAI's `text-embedding-3-large`, Cohere Embed, and open-source alternatives like `all-MiniLM-L6-v2` from Sentence Transformers.

In a web scraping context, scraped text is typically chunked into overlapping segments of 200–500 tokens, embedded, and stored in a vector database. At query time, the user's question is embedded and the nearest chunks are retrieved by approximate nearest-neighbour search.

Examples

from openai import OpenAI

client = OpenAI()
response = client.embeddings.create(
    model="text-embedding-3-small",
    input="What is the price of AlterLab's Pro plan?"
)
vector = response.data[0].embedding  # 1536-dim float list

Related Terms

Extract Embeddings data from any website

AlterLab returns clean, structured data from any public URL — no scraper infrastructure needed. Start free, no credit card required.

View API docs

Your first scrape.
Sixty seconds.

$1 free balance. No credit card. No SDK.Just a POST request.

terminal
curl -X POST https://api.alterlab.io/v1/scrape \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "formats": ["markdown"]}'

No credit card required · Up to 5,000 free scrapes · Balance never expires

    Embeddings — Web Scraping Glossary | AlterLab