Skip to main content

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.

Join the community:

Join us on Slack

🚀 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/core-sanity/rag.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

Release files for ninebit-ciq 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ninebit-ciq 1.1.2
File Size Uploaded
ninebit_ciq-1.1.2.tar.gz 11.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ninebit-ciq 1.1.2
File Interpreter ABI Platform
ninebit_ciq-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 22.8 kB

Release files / ninebit_ciq-1.1.2.tar.gz

Download URL ninebit_ciq-1.1.2.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
139256cada6b567120fac55a3c43b1da0cade35b6b8f018bcb2eaacc890d6659
BLAKE2b-256 checksum
How to use checksums
7d11804b17d7ebb555eb45d82ef67ab1757fb1fd69a9d0f5f3700e3cee9bd69d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.9

Release files / ninebit_ciq-1.1.2-py3-none-any.whl

Download URL ninebit_ciq-1.1.2-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f710ed37cfbc9574882c3068e5b6e0c1d0250296ba27b7cd716ba7c39f12f5b6
BLAKE2b-256 checksum
How to use checksums
79b2ed3386dc40ee8199f30a5073a1fc9fcac015868242334326b7a40ed82c17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

1.1.2 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page