Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

RAG.CREATE

Last updated
RAG.CREATE pipeline dimensions [STRATEGY fixed | sentence | paragraph] [CHUNK_SIZE n] [CHUNK_OVERLAP n]
Group
RAG
Complexity
O(1)
Arity
-3 (at least 3 words, counting the command name)
Flags
write, slow
Keys
first 1, last 1, step 1
HotKV Cloud
Performance and Scale
On-Premise
requires the rag-pipeline license feature

A RAG pipeline splits your documents into chunks, keeps each chunk with the embedding you computed for it, and answers searches that combine keyword (BM25) relevance with vector similarity, all inside HotKV. RAG.CREATE creates a pipeline whose chunk embeddings have dimensions values. The chunking settings decide how RAG.INGEST splits each document.

Option Effect
STRATEGY fixed Split into chunks of CHUNK_SIZE characters, each overlapping the previous one by CHUNK_OVERLAP characters. The default.
STRATEGY sentence Split at sentence ends (., ! or ? followed by a space, a newline or the end of the text), joining sentences until a chunk reaches at least CHUNK_SIZE characters.
STRATEGY paragraph Split at blank lines, one chunk per paragraph. CHUNK_SIZE and CHUNK_OVERLAP are not used.
CHUNK_SIZE n Target chunk size in characters. Must be positive. Default 512.
CHUNK_OVERLAP n Overlap between consecutive fixed chunks, in characters. Default 64.

The strategy name must be written in all lower case or all upper case (fixed or FIXED); fixed_size is also accepted.

Case RESP2 RESP3
Pipeline created Simple string OK Same

Errors:

  • ERR invalid dimensions if dimensions is not a positive integer.
  • ERR unknown strategy: use fixed|sentence|paragraph for any other strategy.
  • ERR invalid CHUNK_SIZE or ERR invalid CHUNK_OVERLAP if the value is not a valid integer (or CHUNK_SIZE is 0).
  • ERR pipeline already exists or limit reached if the pipeline exists, or the server already holds its maximum number of pipelines (max_pipelines under [rag]).
  • ERR wrong number of arguments for 'rag.create' command if the argument count is wrong.
  • NOLICENSE rag-pipeline requires a HotKV license. Contact sales@hotkv.com if your license does not include the rag-pipeline feature.
127.0.0.1:6379> RAG.CREATE kb 384
OK
127.0.0.1:6379> RAG.CREATE faq 3 STRATEGY paragraph
OK
127.0.0.1:6379> RAG.CREATE docs 1536 STRATEGY sentence CHUNK_SIZE 800
OK

HotKV-only command. Redis and Valkey have no equivalent.

RAG.INGEST, RAG.SEARCH, RAG.STATS, RAG.DROP, RAG.LIST, AI features guide