Skip to main content

duohub retriever package for querying memories

Project description

duohub GraphRAG python client

PyPI version

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

duohub-0.6.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

duohub-0.6.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file duohub-0.6.0.tar.gz.

File metadata

  • Download URL: duohub-0.6.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for duohub-0.6.0.tar.gz
Algorithm Hash digest
SHA256 f1cea0cd9ddca58271cb2f1a447c382a4a7b81e6a6acf11b16e2c433e7a60651
MD5 592077b7f9681b2a3f9b1374b0a762a8
BLAKE2b-256 0cd2807a474e072db673bb5b1d4fc4148058aef74a187003494e7afc23ec0eb2

See more details on using hashes here.

File details

Details for the file duohub-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: duohub-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for duohub-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46b33b3259b0a9aaa613bfef6e0f43a1e80c212528f1ea617ad22133dbd7f541
MD5 5411342845ec31bef3ac26dabb0936e0
BLAKE2b-256 667e970a85850c6e1bb268bd62a4f32c6aa0c486f1c032388179c008caec10a7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page