Skip to main content

Python client library for developers to integrate Cleanlab Codex into RAG systems

Project description

Cleanlab Codex - Closing the AI Knowledge Gap

Build Status PyPI - Version PyPI - Python Version Docs

Codex enables you to seamlessly leverage knowledge from Subject Matter Experts (SMEs) to improve your RAG/Agentic applications.

The cleanlab-codex library provides a simple interface to integrate Codex's capabilities into your RAG application. See immediate impact with just a few lines of code!

Demo

Install the package:

pip install cleanlab-codex

Integrating Codex into your RAG application is as simple as:

from cleanlab_codex import Validator
validator = Validator(codex_access_key=...) # optional configurations can improve accuracy/latency

# Your existing RAG code:
context = rag_retrieve_context(user_query)
prompt = rag_form_prompt(user_query, retrieved_context)
response = rag_generate_response(prompt)

# Detect bad responses and remediate with Cleanlab
results = validator.validate(query=query, context=context, response=response,
    form_prompt=rag_form_prompt)

final_response = (
    results["expert_answer"] # Codex's answer
    if results["is_bad_response"] and results["expert_answer"]
    else response # Your RAG system's initial response
)

Why Codex?

  • Detect Knowledge Gaps and Hallucinations: Codex identifies knowledge gaps and incorrect/untrustworthy responses in your AI application, to help you know which questions require expert input.
  • Save SME time: Codex ensures that SMEs see the most critical knowledge gaps first.
  • Easy Integration: Integrate Codex into any RAG/Agentic application with just a few lines of code.
  • Immediate Impact: SME answers instantly improve your AI, without any additional Engineering/technical work.

Documentation

Comprehensive documentation along with tutorials and examples can be found here.

License

cleanlab-codex is distributed under the terms of the MIT license.

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

cleanlab_codex-1.0.27.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

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

cleanlab_codex-1.0.27-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file cleanlab_codex-1.0.27.tar.gz.

File metadata

  • Download URL: cleanlab_codex-1.0.27.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for cleanlab_codex-1.0.27.tar.gz
Algorithm Hash digest
SHA256 2643a7b4d2f6a36c99743131f9e5ff3f30551e3a5c5f6b5a9c8cd50887db38a1
MD5 7bcc7e6f82f2e738faacaea2989e45f5
BLAKE2b-256 1c0ed3de21a59585347bfd6b23f6eee994e5384d2f5b252bc8a115d09498c90d

See more details on using hashes here.

Provenance

The following attestation bundles were made for cleanlab_codex-1.0.27.tar.gz:

Publisher: release.yml on cleanlab/cleanlab-codex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cleanlab_codex-1.0.27-py3-none-any.whl.

File metadata

File hashes

Hashes for cleanlab_codex-1.0.27-py3-none-any.whl
Algorithm Hash digest
SHA256 5e97b8419d797be22139a1247984022d5187d6fa042175cb5e45a57ea255a884
MD5 4dc125eea4e07ab9dac3951e4ba5d59d
BLAKE2b-256 ce6b38df0b74a92c596bc19a3793c20c129a337c2848e96e23f4493bf4023da3

See more details on using hashes here.

Provenance

The following attestation bundles were made for cleanlab_codex-1.0.27-py3-none-any.whl:

Publisher: release.yml on cleanlab/cleanlab-codex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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