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 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)

Why Codex?

  • Identify Knowledge Gaps: Codex captures knowledge gaps in your application so that you can easily identify which questions require expert input.
  • Efficiently Leverage SMEs: Codex ensures the SMEs see the most critical knowledge gaps first.
  • Easy Integration: Integrate Codex into your RAG/Agentic application with just a few lines of code.
  • Immediate Impact: SME responses instantly enhance your AI applications.

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.1.tar.gz (25.8 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.1-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cleanlab_codex-1.0.1.tar.gz
  • Upload date:
  • Size: 25.8 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.1.tar.gz
Algorithm Hash digest
SHA256 3e7b7b7462a02191284b540b9e39de4d684c88c822f7a8f0a55098b92ba74147
MD5 63430b627df84c7a4c1a69741c0d2da1
BLAKE2b-256 10721bec31f21c6c410fd8fb998d8c129ac1433a08fe619e1dd4161d4ad10eda

See more details on using hashes here.

Provenance

The following attestation bundles were made for cleanlab_codex-1.0.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: cleanlab_codex-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for cleanlab_codex-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 735beffe72cf7ce2bccd8d371442e85e3c5eb1dc94c977e0c69641a8d3691953
MD5 1923bff55aaadf47e6b960ca8b2873d4
BLAKE2b-256 fca0132296daec7c542fd92158551a2b87fff677031b7179feabb3a1a16e0d87

See more details on using hashes here.

Provenance

The following attestation bundles were made for cleanlab_codex-1.0.1-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