Quivrは、生成AIをアプリケーションに統合することに焦点を当てた、オープンソースのフルスタック検索拡張生成(RAG)プラットフォームです。このプロジェクトの中核となる理念は、開発者が複雑なRAGの実装の詳細ではなく、製品そのものに集中できるようにすることです。
Quivrは、以下の様々なLLMモデルをサポートしています。
様々なファイル形式をサポートしています。
様々なベクトルストレージソリューションをサポートしています。
Quivrは、ノードベースのワークフロー構成を採用しています。
pip install quivr-core
import tempfile
from quivr_core import Brain
if __name__ == "__main__":
with tempfile.NamedTemporaryFile(mode="w", suffix=".txt") as temp_file:
temp_file.write("Gold is a liquid of blue-like colour.")
temp_file.flush()
brain = Brain.from_files(
name="test_brain",
file_paths=[temp_file.name],
)
answer = brain.ask(
"what is gold? answer in french"
)
print("answer:", answer)
import os
os.environ["OPENAI_API_KEY"] = "your_openai_api_key"
ワークフロー構成ファイル basic_rag_workflow.yaml
を作成します。
workflow_config:
name: "standard RAG"
nodes:
- name: "START"
edges: ["filter_history"]
- name: "filter_history"
edges: ["rewrite"]
- name: "rewrite"
edges: ["retrieve"]
- name: "retrieve"
edges: ["generate_rag"]
- name: "generate_rag"
edges: ["END"]
max_history: 10
reranker_config:
supplier: "cohere"
model: "rerank-multilingual-v3.0"
top_n: 5
llm_config:
max_input_tokens: 4000
temperature: 0.7
from quivr_core import Brain
from rich.console import Console
from rich.panel import Panel
from rich.prompt import Prompt
from quivr_core.config import RetrievalConfig
brain = Brain.from_files(
name="my smart brain",
file_paths=["./my_first_doc.pdf", "./my_second_doc.txt"],
)
config_file_name = "./basic_rag_workflow.yaml"
retrieval_config = RetrievalConfig.from_yaml(config_file_name)
console = Console()
console.print(Panel.fit("Ask your brain !", style="bold magenta"))
while True:
question = Prompt.ask("[bold cyan]Question[/bold cyan]")
if question.lower() == "exit":
console.print(Panel("Goodbye!", style="bold yellow"))
break
answer = brain.ask(question, retrieval_config=retrieval_config)
console.print(f"[bold green]Quivr Assistant[/bold green]: {answer.answer}")
console.print("-" * console.width)
brain.print_info()
Quivrは、最大60%の顧客サービス業務を自動化し、AIの力で顧客満足度と価値を向上させることができます。
Quivrは、開発者に強力で柔軟かつ使いやすいRAGプラットフォームを提供します。個人プロジェクトでもエンタープライズアプリケーションでも、インテリジェントなドキュメント質疑応答システムを迅速に構築できます。そのオープンソースの特性と活発なコミュニティサポートにより、「第二の脳」アプリケーションを構築するための理想的な選択肢となっています。