chroma db rag
1.0.0
存儲庫概述
該存儲庫證明了矢量數據庫Chroma DB與嵌入模型的集成,以開發可靠的檢索增強生成(RAG)系統。
嵌入模型選項
重新級集成(HTTP,GRPC)
為了提高抹布的準確性,我們可以合併擁抱面的模型。這些模型評估了從vectordb重新返回的查詢結果和查詢結果之間的相似性,通過索引將結果對結果進行排名,以確保檢索到的信息相關且上下文準確。
Example:
query := " What is Deep Learning? "
retrievedResults := []string{ " Tomatos are fruits... " , " Deep Learning is not... " , " Deep learning is... " }
Response: [{ " index " :2, " score " :0.9987814},{ " index " :1, " score " :0.022949383},{ " index " :0, " score " :0.000076250595}]該存儲庫演示瞭如何將嵌入和重新固定以開發抹布系統的結合。
設置向量數據庫:
預處理文件:
商店嵌入:
查詢處理:
與LLM提供商集成:
創建提示模板:
使用LLM的過程:
這允許通過利用向量數據庫和高級嵌入模型的功能來增強語言處理任務。
<|user|> what is mirostat_tau?</s>:-
Based on the provided content, I can answer your query.
** Query Result: ** Mirostat_tau Controls the balance between coherence and diversity of the output. A lower value will result in more focused and coherent text. (Default: 5.0)
** Document Content: **
mirostat_tau Controls the balance between coherence and diversity of the output. A lower value will result in more focused and coherent text. (Default: 5.0)
float
mirostat_tau 5.0
** Additional Information on this Topic: **
Here are three main points related to Mirostat_tau:
1. ** Coherence vs Diversity: ** Mirostat_tau controls the balance between coherence and diversity of the output, which means it determines how focused or creative the generated text will be.
2. ** Lower Values Mean More Focus: ** A lower value for mirostat_tau results in more focused and coherent text, while a higher value allows for more diverse and potentially less coherent output.
3. ** Default Value: ** The default value for Mirostat_tau is 5.0, which means that if no specific value is provided, the model will generate text with a balance between coherence and diversity.
Please note that these points are based solely on the provided content and do not go beyond it.% git clone https://github.com/yourusername/chroma-db.git
cd chroma-dbgo build -o chroma-db cmd/main.go確保安裝Docker和Docker組合。使用docker-compose.yaml來設置Chroma DB服務。
docker-compose up -d./chroma-db
Usage
-load
Load and embed the data in vectordb
Provide the path to file Eg: " test/model_params.txt "
-query
Query the embedded data and rerank the results
Provide the query Eg: " what is the difference between mirostat_tau and mirostat_eta? " CMD/ :
內部/常數/ :
docker-compose.yaml :Docker組成配置文件,用於設置Chroma DB服務。
調整internal/constants/constants.go中的配置值,以滿足您的需求。這包括以下設置:
Chroma DB URL,租戶名稱,數據庫和名稱空間。 Ollama模型類型和URL。
< | system | > {{ . SystemPrompt }} < / s >
< | content | > {{ . Content }} < / s >
< | user | > {{ . Prompt }} < / s > 使用以下命令啟動VectordB:
docker compose up執行與聊天有關的操作:
go run ./cmd/main.go默認配置值在internal/constants/constants.go中提供,並且可以根據您的需求進行調整。其中一些包括:
ChromaUrl , TenantName , Database , NamespaceOllamaModel和OllamaUrl該項目是根據BSD 3範圍許可證的許可 - 有關詳細信息,請參見許可證文件。
對於任何問題或貢獻,請在Github上開設問題或提交拉動請求。