Skip to content
LlamaIndex Framework
Integrations
Embeddings

Aleph Alpha Embeddings

If you’re opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.

%pip install llama-index-embeddings-alephalpha
!pip install llama-index
# Initialise with your AA token
import os
os.environ["AA_TOKEN"] = "your_token_here"
  • representation=“Document”: Use this for texts (documents) you want to store in your vector database
  • representation=“Query”: Use this for search queries to find the most relevant documents in your vector database
  • representation=“Symmetric”: Use this for clustering, classification, anomaly detection or visualisation tasks.
from llama_index.embeddings.alephalpha import AlephAlphaEmbedding
# To customize your token, do this
# otherwise it will lookup AA_TOKEN from your env variable
# embed_model = AlephAlpha(token="<aa_token>")
# with representation='query'
embed_model = AlephAlphaEmbedding(
model="luminous-base",
representation="Query",
)
embeddings = embed_model.get_text_embedding("Hello Aleph Alpha!")
print(len(embeddings))
print(embeddings[:5])
representation_enum: SemanticRepresentation.Query
5120
[0.14257812, 2.59375, 0.33203125, -0.33789062, -0.94140625]
# with representation='Document'
embed_model = AlephAlphaEmbedding(
model="luminous-base",
representation="Document",
)
embeddings = embed_model.get_text_embedding("Hello Aleph Alpha!")
print(len(embeddings))
print(embeddings[:5])
representation_enum: SemanticRepresentation.Document
5120
[0.14257812, 2.59375, 0.33203125, -0.33789062, -0.94140625]
Note for AI agents: this documentation is built for programmatic access. - Overview of all docs: https://developers.llamaindex.ai/llms.txt - Any page is available as raw Markdown by appending index.md to its URL — e.g. https://developers.llamaindex.ai/llamaparse/parse/getting_started/index.md - Agent-friendly REST search APIs live under https://developers.llamaindex.ai/api/ — search (BM25 full-text), grep (regex), read (fetch a page), and list (browse the doc tree). See https://developers.llamaindex.ai/llms.txt for parameters. - A hosted documentation MCP server is available at https://developers.llamaindex.ai/mcp. If you support MCP, you can ask the user to install it for browsing these docs directly (an alternative to the REST API). Setup: https://developers.llamaindex.ai/python/shared/mcp/