duohub retriever package for querying memories
Project description
duohub GraphRAG python client
This is a python client for the Duohub API.
Duohub is a blazing fast graph RAG service designed for voice AI and other low-latency applications. It is used to retrieve memory from your knowledege graph in under 50ms.
You will need an API key to use the client. You can get one by signing up on the Duohub app. For more information, visit our website: duohub.ai.
Table of Contents
Installation
pip install duohub
or
poetry add duohub
Usage
Default Mode - Voice AI Compatible
from duohub import Duohub
duohub = Duohub(api_key="your_api_key")
result = duohub.query(query="What is the capital of France?", memoryID="your_memory_id")
print(result)
VoiceAI Mode Results
In voice AI mode, you will get a string representation of a subgraph that is relevant to your query. You can pass this to your chat bot using a system message and user message template.
Assisted Mode
Assisted mode adds reasoning to your query and returns the answer as well as 3 facts instead of a subgraph.
This adds some latency to your query, so it is not recommended for real-time applications, but can offer an exceptional experience to text-based AI applications or agentic workflows.
from duohub import Duohub
duohub = Duohub(api_key="your_api_key")
result = duohub.query(query="What is the capital of France?", memoryID="your_memory_id", assisted=True)
print(result)
Assisted Mode Results
Assisted mode results will be a JSON object with the following structure:
{
"payload": "The capital of France is Paris.",
"facts": [
{
"content": "Paris is the capital of France.",
},
{
"content": "Paris is a city in France.",
},
{
"content": "France is a country in Europe.",
},
],
"tokens": 100,
}
Contributing
We welcome contributions to this client! Please feel free to submit a PR. If you encounter any issues, please open an issue.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file duohub-0.1.0.tar.gz
.
File metadata
- Download URL: duohub-0.1.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4951d13d57b88798286cf3e53040fe88d6a5ad5c3e4e9c17ef1d404a4400ec0 |
|
MD5 | 98bf7a54759f191f68503cb3aab4f172 |
|
BLAKE2b-256 | 7e0eb46deaa3cfe814a883735874a96a8a011c0b9794f7bd40a00a4a9350a6d6 |
File details
Details for the file duohub-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: duohub-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8afe0db62319e303d8002f4085d1850d5670c46e02a96198243c1e4ad8617f8c |
|
MD5 | 1e85f771cf31b2357fccdfd09f51d684 |
|
BLAKE2b-256 | 515a319eb8fa5e0a48f2a179afb24b335ff324ff2e91587b6134f4615f843549 |