Ahnlich DB
Ahnlich DB is a database for meaning. A normal database is great at exact
matches — "find the user whose email is x". Ahnlich DB is built for a different
question: "find the things that are most similar to this one." Similar
photos, similar products, documents about the same topic, songs with the same
vibe.
It does this by storing your data as vectors (lists of numbers that capture meaning) and finding the ones that sit closest together. It keeps everything in memory, so answers come back in milliseconds.
The two things you store
Every item you put in Ahnlich DB has two parts:
- A vector — a list of numbers, e.g.
[0.12, 0.98, 0.41, …]. A machine-learning model produces this from your raw data (a sentence, an image, a product). Items that mean similar things end up with vectors that are close together. New to this idea? Start with Vectors & embeddings. - Metadata — plain key–value labels attached to the vector, like
{"genre": "sci-fi", "year": 1968}. You use these to filter results.
If you don't want to generate vectors yourself, the Ahnlich AI proxy does it for you — you send text, images, or audio and it handles the numbers.
What you can do with it
Find the nearest matches (similarity search)
Give Ahnlich DB a vector and ask for the N closest items. This powers semantic
search, recommendations, and "more like this" features.
GETSIMN 3 WITH [0.23, 0.91, -0.44] USING cosinesimilarity IN article_storeReturns the 3 most similar articles.
cosinesimilarityis one way to measure "closeness" — see Similarity metrics.
Filter by metadata at the same time
Combine "closest" with "matches these labels", so results are relevant and correct.
GETSIMN 5 WITH [0.11, 0.75, -0.32] USING euclideandistance IN music_store WHERE (genre = "jazz")The 5 most similar songs — but only jazz ones.
Stay fast as you grow
Because everything lives in memory, lookups are quick enough for live features like chat assistants or real-time recommendations. When a store gets large, you can add a vector index (HNSW) to keep searches fast.
A first end-to-end example
CREATESTORE books DIMENSION 3 # 1. make a store for 3-number vectorsSET book1 [0.12, 0.98, 0.41] WITH {"genre": "sci-fi"} # 2. add an itemGETSIMN 2 WITH [0.10, 0.95, 0.44] USING cosinesimilarity IN books # 3. searchThat's the whole loop: create a store → add vectors → search for the nearest ones.
Where to go next
- Quickstart: Ahnlich DB — a hands-on walkthrough with a relatable example.
- Command reference — every command, explained.
- Concepts — the ideas (vectors, metadata, similarity, indexes) in plain language.
- Advanced — algorithms, tuning, and performance.