Ahnlich CLI β AI Commands
The Ahnlich CLI supports AI-powered vector stores that enable semantic search, similarity matching, and predicate-based queries. This allows developers to insert embeddings (from text, images, or other binary inputs), query them with different similarity algorithms, and manage AI stores just like databases.
An AI Store is a specialized store that maintains:
-
Query Model β model used to process incoming query inputs (e.g.,
resnet-50,all-MiniLM-L6-v2). -
Index Model β model used to generate embeddings for inserted data.
-
Predicates β metadata fields associated with each input (e.g.,
author,category). -
Non-Linear Algorithm Index β optional advanced indexing (e.g.,
kdtree) to accelerate nearest-neighbor search.
With AI Stores, you can:
-
Insert text, image, or binary inputs with metadata.
-
Run similarity searches (
cosinesimilarity,l2, etc.). -
Filter results by predicates.
-
Create and manage indexes for faster queries.
-
Delete stores or individual keys when no longer needed.
Example Workflowβ
-
Create an AI Store with models and metadata fields.
-
Insert AI Data (text or image embeddings + metadata).
-
Query AI Data using similarity search.
-
Refine queries with predicates and indexes.
-
Manage lifecycle of stores, indexes, and entries.
AI CLI Commandsβ
Below are the most common commands you can run against your AI store:
1. Ping the AI serverβ
PING
Checks if the AI server is alive and responding.
2. Get AI server informationβ
INFOSERVER
Returns server metadata, including version, address, type, and resource limits.
3. List all AI storesβ
LISTSTORES
Lists all stores currently available on the AI server.
4. Create a Store for AIβ
CREATESTORE my_store QUERYMODEL resnet-50 INDEXMODEL resnet-50 PREDICATES (author, category) NONLINEARALGORITHMINDEX (kdtree) STOREORIGINAL
Creates a new store my_store with resnet-50 as both query and index models, supporting predicates author and category, and enables a KD-Tree index.
5. Insert AI Dataβ
SET (([This is the life of Alice], {author: Alice, category: ml}),
([This is the life of Bob], {author: Bob, category: dev})) IN my_store
Inserts two text entries into my_store with metadata tags.
6. Drop a Storeβ
DROPSTORE my_store IF EXISTS
Deletes the store my_store if it exists.
7. Query AI Data by Similarityβ
GETSIMN 4 WITH [This is the life of Alice] USING cosinesimilarity IN my_store WHERE (category = ml)
Finds the top 4 entries most similar to "This is the life of Alice" within category ml.
8. Query AI Data by Predicateβ
GETPRED (author = Alice) IN my_store
Retrieves all entries in my_store where author = Alice.
9. Create Predicate Indexβ
CREATEPREDINDEX (author, category) IN my_store
Creates an index on the author and category predicates to speed up lookups.
10. Drop Predicate Indexβ
DROPPREDINDEX (category) IN my_store
Removes the index on the category predicate.
11. Create Non-Linear Algorithm Indexβ
CREATENONLINEARALGORITHMINDEX (kdtree) IN my_store
Creates a KD-Tree index for non-linear similarity search.
12. Drop Non-Linear Algorithm Indexβ
DROPNONLINEARALGORITHMINDEX (kdtree) IN my_store
Drops the KD-Tree index from the store.
13. Delete a Keyβ
DELETEKEY ([This is the life of Alice]) IN my_store
Deletes the entry "This is the life of Alice" from my_store.