Python client library for developers to integrate Cleanlab Codex into RAG systems
Project description
Cleanlab Codex - Closing the AI Knowledge Gap
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 as a tool is as simple as:
from cleanlab_codex import CodexTool
def rag(question, system_prompt, tools) -> str:
"""Your RAG/Agentic code here"""
...
# Initialize the Codex tool
codex_tool = CodexTool.from_access_key("your-access-key")
# Update your system prompt to include information on how to use the Codex tool
system_prompt = f"""Answer the user's Question based on the following Context. If the Context doesn't adequately address the Question, use the {codex_tool.tool_name} tool to ask an outside expert."""
# Convert the Codex tool to a framework-specific tool
framework_specific_codex_tool = codex_tool.to_<framework_name>_tool() # i.e. codex_tool.to_llamaindex_tool(), codex_tool.to_openai_tool(), etc.
# Pass the Codex tool to your RAG/Agentic framework
response = rag(question, system_prompt, [framework_specific_codex_tool])
(Note: Exact code will depend on the RAG/Agentic framework you are using. Other integrations are available if you prefer to avoid Tool Calls.)
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cleanlab_codex-1.0.10.tar.gz.
File metadata
- Download URL: cleanlab_codex-1.0.10.tar.gz
- Upload date:
- Size: 28.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f04625a3e64f23f72093b035ef8534b11e161b936b7eb3f75c1cfb40c7566e8
|
|
| MD5 |
cebd06e17b4c83464415940fe25f05fb
|
|
| BLAKE2b-256 |
efe7233e6a3d1843641b31ddd6b09a967a7493c201a52ac4c0a98f904512f8db
|
Provenance
The following attestation bundles were made for cleanlab_codex-1.0.10.tar.gz:
Publisher:
release.yml on cleanlab/cleanlab-codex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cleanlab_codex-1.0.10.tar.gz -
Subject digest:
0f04625a3e64f23f72093b035ef8534b11e161b936b7eb3f75c1cfb40c7566e8 - Sigstore transparency entry: 196901013
- Sigstore integration time:
-
Permalink:
cleanlab/cleanlab-codex@4e92233a73f50342b3cc0bb5320a430e0cee04c8 -
Branch / Tag:
refs/tags/v1.0.10 - Owner: https://github.com/cleanlab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4e92233a73f50342b3cc0bb5320a430e0cee04c8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cleanlab_codex-1.0.10-py3-none-any.whl.
File metadata
- Download URL: cleanlab_codex-1.0.10-py3-none-any.whl
- Upload date:
- Size: 24.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b00008edb1b8dab4e967732a17b04996bdee120b64ef7fdf4f2418b9b477e0f
|
|
| MD5 |
4fe0e14b092687b46a27bd37b9aa2cda
|
|
| BLAKE2b-256 |
a9efbb492e414a1c43f9f7cfbbc4e5dbe8129a961766bb8962c758b9591d7222
|
Provenance
The following attestation bundles were made for cleanlab_codex-1.0.10-py3-none-any.whl:
Publisher:
release.yml on cleanlab/cleanlab-codex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cleanlab_codex-1.0.10-py3-none-any.whl -
Subject digest:
8b00008edb1b8dab4e967732a17b04996bdee120b64ef7fdf4f2418b9b477e0f - Sigstore transparency entry: 196901017
- Sigstore integration time:
-
Permalink:
cleanlab/cleanlab-codex@4e92233a73f50342b3cc0bb5320a430e0cee04c8 -
Branch / Tag:
refs/tags/v1.0.10 - Owner: https://github.com/cleanlab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4e92233a73f50342b3cc0bb5320a430e0cee04c8 -
Trigger Event:
push
-
Statement type: