RAG.CREATE
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.
Options
Section titled “Options”| 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.
Return value
Section titled “Return value”| Case | RESP2 | RESP3 |
|---|---|---|
| Pipeline created | Simple string OK |
Same |
Errors:
ERR invalid dimensionsifdimensionsis not a positive integer.ERR unknown strategy: use fixed|sentence|paragraphfor any other strategy.ERR invalid CHUNK_SIZEorERR invalid CHUNK_OVERLAPif the value is not a valid integer (orCHUNK_SIZEis0).ERR pipeline already exists or limit reachedif the pipeline exists, or the server already holds its maximum number of pipelines (max_pipelinesunder[rag]).ERR wrong number of arguments for 'rag.create' commandif the argument count is wrong.NOLICENSE rag-pipeline requires a HotKV license. Contact sales@hotkv.comif your license does not include therag-pipelinefeature.
Examples
Section titled “Examples”127.0.0.1:6379> RAG.CREATE kb 384OK127.0.0.1:6379> RAG.CREATE faq 3 STRATEGY paragraphOK127.0.0.1:6379> RAG.CREATE docs 1536 STRATEGY sentence CHUNK_SIZE 800OKCompatibility
Section titled “Compatibility”HotKV-only command. Redis and Valkey have no equivalent.
See also
Section titled “See also”RAG.INGEST, RAG.SEARCH, RAG.STATS, RAG.DROP, RAG.LIST, AI features guide
Was this page helpful?
Thanks for the feedback.