Skip to main content

Thin client for interacting with NineBit CIQ backend

Project description

Python SDK for RAG (Retrieval Augmented Generation)

Version License build Code style: black Linting: flake8 pre-commit Open In Colab

🔗 ninebit-ciq

Official Python SDK client for interacting with NineBit CIQ, a Retrieval-Augmented Generation (RAG) workflow orchestration platform for secure, private, rapid prototyping of AI/ML ideas using enterprise data and open-source models.

🚀 Try It Out Interactively

We provide an interactive Jupyter notebook demo to quickly explore NineBit CIQ’s features like ingestion, summarization, taxonomy extraction, and more.

🧪 Run the notebook in Google Colab

Click below to launch the demo with zero setup:

Open In Colab


🌐 Explore Our Hugging Face Space

Try the live demo running on Hugging Face Spaces — no installation needed, just open and run:

https://huggingface.co/spaces/ninebit/ciq-rag


For more details, see examples/ciq_rag_demo.ipynb.

🚀 Features

  • Retrieval-Augmented Generation (RAG) Perform semantic search and intelligent query answering using hybrid retrieval techniques.
  • Flexible Query Interface Send queries with configurable similarity thresholds and top_k result tuning.
  • Callback Support for Asynchronous Workflows Pass in callbacks to handle results or errors once workflows complete — ideal for event-driven applications.
  • Workflow Polling with Timeout Control Monitor long-running workflows with built-in polling, status checking, and customizable timeouts.
  • Simple, Extensible API Clean, Pythonic interfaces with support for both synchronous returns and optional callbacks.
  • Error-Handled Execution Flow Graceful handling of task failures, timeouts, and unexpected states with descriptive exceptions.
  • Logging Support Integrated logging for easy debugging and transparency during polling or querying.

📦 Installation

pip install ninebit-ciq

Or clone and install locally:

git clone https://github.com/NineBit-Computing/ciq-py-client.git
cd ciq-py-client
pip install .

🧪 Quickstart (Python)

from ninebit_ciq import NineBitCIQClient

client = NineBitCIQClient(
    api_key="YOUR_API_KEY"
)

def on_done(error, data):
    if error:
        print(f"Ingest_file failed: {error}")
    else:
        print(f"Ingest_file succeeded: {str(data)}")

# 1. Ingest file as datasource for performing RAG
client.ingest_file(file="files/my_file.pdf", callback=on_done)

# 2. Ask your query
query = "What are land breeze?"
response = client.rag_query(query=query)
print(f"Query response is {response}")

🔐 Authentication - You’ll Need an API Key

If you’re using the Freemium CIQ setup, you’ll just need to register at our web app and grab your API key. It’s quick, and no credit card is required.

You can sign up here NineBit CIQ

📚 SDK Reference

Method Description
ingest_file() Reads and uploads a PDF or DOCX file to the backend for processing.
rag_query() Performs a Retrieval-Augmented Generation (RAG) query using the provided input.

🛠️ Logging

You can control logging verbosity:

from ninebit_ciq import NineBitCIQClient
import logging

client = NineBitCIQClient(api_key, log_level=logging.INFO)

📁 Project Structure

ciq-py-client/
├── src/ninebit_ciq/
│ ├── client.py # Core SDK logic
│ ├── logger.py # Logger setup
│ ├── cli.py # CLI interface
│ └── **init**.py # Version info
├── examples/usage.py
├── examples/usage_with_thread.py
├── README.md
├── setup.py
└── version.txt

📄 License

MIT License © NineBit Computing

🤝 Contributing

Pull requests are welcome! Please check DEVELOPER.md and ensure:

  • Tests pass
  • Lint/format clean
  • Coverage is not broken

📬 Questions?

Email us at support@ninebit.in or visit NineBit Computing or raise an issue in the GitHub repo.

© NineBit Computing, 2025

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

ninebit_ciq-1.1.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ninebit_ciq-1.1.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file ninebit_ciq-1.1.0.tar.gz.

File metadata

  • Download URL: ninebit_ciq-1.1.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for ninebit_ciq-1.1.0.tar.gz
Algorithm Hash digest
SHA256 3a7bcea19e2b7da5016917848e58657dfa02b86a517b8680033f497d176fd78a
MD5 dad61ae2ca4cf0d0daa53fba4350bf87
BLAKE2b-256 99e271a7504e0587e65e327be3296f134d1fa25c36357da88da846a3b11e0ebe

See more details on using hashes here.

File details

Details for the file ninebit_ciq-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: ninebit_ciq-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for ninebit_ciq-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ceddc4b57ff0a1861f67d92a8719ca0f5c215f78199f80d38fd51b34a42e31c
MD5 e3dac3380a00dd4355694f0099a58603
BLAKE2b-256 38498bea5725f903248257ad77af2b16f5ba9e1670acbc32fef1e68b116ed84e

See more details on using hashes here.

Supported by

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