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上开设问题或提交拉动请求。