Skip to main content

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 Project
project = Project.from_access_key(...)

# 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 = project.validate(query=query, context=context, response=response,
    messages=[..., prompt])

final_response = (
    results["expert_answer"] # Codex's answer
    if results["expert_answer"] is not None
    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.

Release files for cleanlab-codex 1.0.35

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

Source distribution (sdist)

Source distribution for cleanlab-codex 1.0.35
File Size Uploaded
cleanlab_codex-1.0.35.tar.gz 35.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cleanlab-codex 1.0.35
File Interpreter ABI Platform
cleanlab_codex-1.0.35-py3-none-any.whl Python 3 none any Details

Total release size: 68.1 kB

Release files / cleanlab_codex-1.0.35.tar.gz

Download URL cleanlab_codex-1.0.35.tar.gz
Size 35.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c8d7163def118c5d8c0fd0006cc04d79d8f9aa2f44e41f6013671a4fcba0f7e6
BLAKE2b-256 checksum
How to use checksums
acf57ef66b6f2c91994cad824622ec000a7d5f467dfac49a875eded0da5f6809
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2025.

Transparency log

Release files / cleanlab_codex-1.0.35-py3-none-any.whl

Download URL cleanlab_codex-1.0.35-py3-none-any.whl
Size 32.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ccc6e623711b7a9a22d88c3dda6de6c5011146035f2da96121903c214a46ea7
BLAKE2b-256 checksum
How to use checksums
7018ce602b63157c947663e79203af88534e7736d3ba7d23b8e6dddc83223eb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.35 This release

2 release files

1.0.34

2 release files

1.0.32

2 release files

1.0.29

2 release files

1.0.27

2 release files

1.0.26

2 release files

1.0.25

2 release files

1.0.24

2 release files

1.0.23

2 release files

1.0.22

2 release files

1.0.21

2 release files

1.0.20

2 release files

1.0.16

2 release files

1.0.14

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.11

2 release files

1.0.10

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.1

2 release files

1.0.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