cx-copilot
🤖 Empower your CX team with open-source AI-powered response auto-drafting. 🤖
🤔 What is cx-copilot?
An open source project that lets you leverage LLMs and latest advancements in AI to automate customer support interactions. By connecting a Large Language Model (LLM) to your knowledge base and historical support tickets via embeddings & vector searching, you can accurately auto-draft responses to all customer requests.
🖥 Where can it be used?
You can use cx-copilot to auto-draft responses in support tools like Helpscout, Intercom, Zendesk and anywhere else you store & respond to customer requests.
⚡️ Installation
- Go to extension directory.
$ cd ./client/chrome-extension/
- Download dependencies and perform initial project setup.
$ yarn
- Edit configuration inside
src/utils/config.js.
const config = {};
config.API_URL = 'http://localhost:9000';
export default config;
- Run the project.
$ yarn start
- Load your extension on Chrome by doing the following:
- Go to
chrome://extensions/ - Enable
developer mode - Click on
load unpacked extension - Select the
buildfolder
- Go to
🚀 Live Demo
📖 How does it work?
The basis of cx-copilot is embedding, vector storing and vector searching. Vector embeddings are a way to represent text as a series of numbers in such a way that you can perform mathematical operations, such as similarity comparison. By first embedding all previous historical customer request tickets using an embedding model (like text-embedding-ada-002 from OpenAI) and storing the embeddings & the paired response from your company in a vector database, you can then perform a vector search for incoming support tickets, returning the closest-matching tickets based on cosine similarity. The final step is to prompt a Large Language Model (LLM) with your team's responses to the closest-matching historical tickets, generating an auto-drafted response which will answer your customer’s query while conforming to your tone & formatting tendencies.
🔌 Integrations
| Integrations | |
|---|---|
| Helpscout | |
| Gmail | |
| Intercom (coming soon) | |
| Zendesk (coming soon) | |
| Discord (coming soon) |
📱 Community
Join the Discord community for cx-copilot for support & project updates.
👩💻 Contributing
Local Installation
To install this package, simply run the following command:
pip install cx_copilot
To install for local development use:
flit install [--symlink] [--python path/to/python]
Development
This package is built on top of abstract classes that can be implemented for different customer support ticket providers. This ensures interoperability and allows for easy development. There are examples of how to use each of these classes in the examples directory. The source code for the package is located in the src directory.
Please always create base classes and implement them for specific use cases.
For example:
The cache class is an abstract class with the following definition:
class Cache:
def put(self, key: str, value: str):
pass
def get(self, key: str, default_value: Optional[str] = None) -> str:
pass
And the redis class implements that abstract class with the following definition
class RedisCache(Cache):
instance: redis.Redis = None
def __init__(self, host: str, port: int, db: int):
self.instance = redis.Redis(host=host, port=port, db=db)
def put(self, key: str, value: str):
self.instance.set(key, value)
pass
def get(self, key: str, default_value: Optional[str] = None) -> str:
result = self.instance.get(key)
return result or default_value
so our compound block can be agnostic on which provider to use. It's set during initialization.
def get_ticket_response(self, ticket_id: str, use_cached=True, cache_response=True, max_tokens=2000):
content = self.ticket_repo.get_conversation_by_id(conversation_id=ticket_id)
if use_cached:
try:
value = self.cache_block.get(ticket_id)
if value is not None:
return value
except Exception:
pass
Whenever introducing a new block either follow the abstract classes already defined or introduce a new one.
Usages
The examples and client directory has some rich examples of how to use this library. For instance under the examples/client/discord_example_client.py you can see an example of a discord bot that you can deploy to answer support queries.
@bot.slash_command(name="autofill")
async def autofill(ctx):
reply = cx.get_ticket_response(ctx.channel_id, cache_response=True, use_cached=True)
await ctx.respond(reply, ephemeral=True)
Please create a PR with your changes. Once merged, a GitHub action will bump up the minor version. For major version changes, please contact the contributors(eng@caesarhq.com).
🚀 Deployment
If you are having issues self hosting, we offer a deployed version. Please contact us at eng@caesarhq.com.
Metadata
Release files for cx-copilot 0.0.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cx-copilot-0.0.12.tar.gz | 687.4 kB | Without provenance | Details for cx-copilot-0.0.12.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cx_copilot-0.0.12-py3-none-any.whl | Python 3 | none | any | Details for cx_copilot-0.0.12-py3-none-any.whl |
Total release size: 700.6 kB
Release files / cx-copilot-0.0.12.tar.gz
| Download URL | cx-copilot-0.0.12.tar.gz |
|---|---|
| Size | 687.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4ec7c30287754ae2d76749469e9d7af205b0fed0b72217a2513308505b6a1bc
|
|
BLAKE2b-256 checksum How to use checksums |
8b0c15042cb7386cdaf5045af29c5c8b01f73f2209a8352c9534fbfcb447e494
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.2
|
Release files / cx_copilot-0.0.12-py3-none-any.whl
| Download URL | cx_copilot-0.0.12-py3-none-any.whl |
|---|---|
| Size | 13.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2a77a9bae555de51c70d9c4e4fee2ffa7ac1ed1a31e305dceb3bf619a01dac38
|
|
BLAKE2b-256 checksum How to use checksums |
70943fe413459d0291bd88a753f00590aa44546a084d6563729ff794e1e92044
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.2
|
Security for cx-copilot 0.0.12
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.