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.12.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

duohub-0.12.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: duohub-0.12.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Darwin/23.6.0

File hashes

Hashes for duohub-0.12.0.tar.gz
Algorithm Hash digest
SHA256 a96be2bc28cdecb22e4fd22054abb9efda67b259b1136311bb5dd812ee96fce7
MD5 e0390c04e7c1e9fcf3d12112ad82cb84
BLAKE2b-256 01241fd5d2dff3937ef18081791d2986df6cb68f9600baac532ca8ab180621f4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: duohub-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Darwin/23.6.0

File hashes

Hashes for duohub-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9abd20ee2084e6266c7dbceaf081376b693ee271069300a14cf6a83775a4dd73
MD5 65ba70a2ac40b55e16668772ba34b937
BLAKE2b-256 f75f7659816f7d3ba4c00498dd9e75035ede23eb0446ee9e822660d56c903721

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