RAG Parameter Adjustment
Each knowledge space supports argument customization, including the relevant arguments for vector retrieval and the arguments for knowledge question-answering prompts.
As shown in the figure below, clicking on the "Knowledge" will trigger a pop-up dialog box. Click the "Arguments" button to enter the parameter tuning interface.
- Embedding Argument
- Prompt Argument
- Summary Argument
Embedding Arguments
- topk:the top k vectors based on similarity score.
- recall_score:set a similarity threshold score for the retrieval of similar vectors. between 0 and 1. default 0.3.
- recall_type:recall type. now nly support topk by vector similarity.
- model:A model used to create vector representations of text or other data.
- chunk_size:The size of the data chunks used in processing.default 500.
- chunk_overlap:The amount of overlap between adjacent data chunks.default 50.
Prompt Arguments
- scene:A contextual parameter used to define the setting or environment in which the prompt is being used.
- template:A pre-defined structure or format for the prompt, which can help ensure that the AI system generates responses that are consistent with the desired style or tone.
- max_token:The maximum number of tokens or words allowed in a prompt.
summary arguments
- max_iteration: summary max iteration call with llm, default 5. the bigger and better for document summary but time will cost longer.
- concurrency_limit: default summary concurrency call with llm, default 3.
Knowledge Query Rewrite
set KNOWLEDGE_SEARCH_REWRITE=True
in .env
file, and restart the server.
# Whether to enable Chat Knowledge Search Rewrite Mode
KNOWLEDGE_SEARCH_REWRITE=True
Change Vector Database
- Chroma
- Milvus
- Weaviate
- OceanBase
set VECTOR_STORE_TYPE
in .env
file.
### Chroma vector db config
VECTOR_STORE_TYPE=Chroma
#CHROMA_PERSIST_PATH=/root/DB-GPT/pilot/data
set VECTOR_STORE_TYPE
in .env
file
### Milvus vector db config
VECTOR_STORE_TYPE=Milvus
MILVUS_URL=127.0.0.1
MILVUS_PORT=19530
#MILVUS_USERNAME
#MILVUS_PASSWORD
#MILVUS_SECURE=
set VECTOR_STORE_TYPE
in .env
file
### Weaviate vector db config
VECTOR_STORE_TYPE=Weaviate
#WEAVIATE_URL=https://kt-region-m8hcy0wc.weaviate.network
set VECTOR_STORE_TYPE
in .env
file
OB_HOST=127.0.0.1
OB_PORT=2881
OB_USER=root@test
OB_DATABASE=test
## Optional
# OB_PASSWORD=
## Optional: SQL statements executed by OceanBase is recorded in the log file specified by {OB_SQL_DBG_LOG_PATH}.
# OB_SQL_DBG_LOG_PATH={your-sql-dbg-log-dir}/sql.log
## Optional: If {OB_ENABLE_NORMALIZE_VECTOR} is set, the vector stored in OceanBase is normalized.
# OB_ENABLE_NORMALIZE_VECTOR=True
## Optional: If {OB_ENABLE_INDEX} is set, OceanBase will automatically create a vector index table.
# OB_ENABLE_INDEX=True