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

Uploaded Source

Built Distribution

duohub-0.3.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for duohub-0.3.0.tar.gz
Algorithm Hash digest
SHA256 2eeaeece395a18d0c1af3c5db40829a109bd284d8e277f6574303f20121e1088
MD5 a7881878f1f8686850e457ae8c7943b9
BLAKE2b-256 b5a0a6277bd0839f7ca10dade440bef26c6d44d37e5132e9dea87a74e463f0ff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: duohub-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 45a88eda9937e7508deeb782fdd339ef882f0ec0b33f64db5083029e72f07d52
MD5 e34b1ee381c640bc9674cd2a1388cff4
BLAKE2b-256 53e165bd2eeac9d80cab0025e1e095ef073ed14ad20e8da6981647bf04f04fb8

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