Skip to content

๐Ÿ•Š๏ธ Build and embed open-source AI Copilots into your product with ease

License

Notifications You must be signed in to change notification settings

isysoftware/opencopilot

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

OpenCopilot

๐Ÿ•Š๏ธ OpenCopilot: Build and embed open-source AI Copilots into your product with ease

Unit tests E2E tests Package version Package version Package version

Documentation: docs.opencopilot.dev

๐Ÿ•Š๏ธ OpenCopilot Overview

Copilots are becoming the new paradigm how to build successful LLM-based applications, as seen by Github, Shopify, Brex, Hubspot, etc Copilots. Yet, building a Copilot that goes beyond a Twitter demo is time-consuming, unreliable and overly complex. Moreover, existing solutions such as Microsoft Copilot Stack are closed-source. Today, building an LLM-app feels like:

Author: Soham Chatterjee

OpenCopilot solves this problem so building your own Copilot becomes intuitive, fast and reliable - all so you can build your copilot in a single day. For example, you can build Copilots such as:

๐Ÿ› ๏ธ Developer tooling Copilot

๐Ÿ’พ SaaS Copilot

๐Ÿ’ณ E-commerce Copilot

See more use cases in docs.

โšก Quickstart

As prerequisites, you need to have Python 3.8+ and pip installed.

1. Install the OpenCopilot Python package

pip install opencopilot-ai

2. Create a new python file to set up a minimal Copilot

For example, you can create an AWS CLI Copilot using the following code by adding it to a copilot.py file. Make sure to replace openai_api_key with your ๐Ÿ”‘ own OpenAI API key.

from opencopilot import OpenCopilot

PROMPT = """
You are an Amazon Web Services (AWS) CLI copilot. You are an interactive version of AWS CLI documentation and chat with developers who need help using it.
Your mission is to be a reliable companion throughout the developer journey - always ready to answer questions and share insights.

=========
{context}
=========

{history}
User: {question}
AWS CLI Copilot answer in Markdown:
"""

copilot = OpenCopilot(
    copilot_name="AWS CLI Copilot",
    openai_api_key="your-openai-api-key",
    llm_model_name="gpt-3.5-turbo-16k", # You can also use gpt-4 for improved accuracy
    prompt=PROMPT
)

# Download and embed the knowledge base from given URL
copilot.add_data_urls([
    "https://awsdocs.s3.amazonaws.com/cli/latest/aws-cli.pdf",
])

# Run the copilot
copilot()

3. Run the Copilot

python copilot.py

4. Chat with the Copilot

You can chat with your copilot in the UI at localhost:3000/ui or using the CLI:

opencopilot chat "Hello, who are you?"

5. Create your own copilot

After seeing how easy it is to set up a copilot, you can now create your own and level it up step by step. For this, see docs.opencopilot.dev, or check a more detailed example of the AWS copilot in the examples directory.

๐Ÿ” Stack Overview

OpenCopilot provides one coherent end-to-end stack which is purposely designed for building a variety of copilots. From LLM selection (OSS LLMs upcoming), knowledge base, monitoring, evaluation, etc - it covers all the needs to build a useful copilot.

opencopilot_stack

See our docs on Stack Overview to learn more about each part of the OpenCopilot stack.

Analytics

OpenCopilot collects library usage data to improve the product and your experience. We collect events regarding errors and your usage of copilot features, and never collect your code, prompts, knowledge base documents, or LLM outputs. To understand what is tracked, check out the tracking code.

You can opt out of tracking by setting the environment variable OPENCOPILOT_DO_NOT_TRACK=True:

export OPENCOPILOT_DO_NOT_TRACK=True

Getting help

If you have any questions about OpenCopilot, feel free to do any of the following:

  • Join our Discord and ask.
  • Report bugs or feature requests in GitHub issues.
  • Directly email Taivo, Co-founder & CTO of OpenCopilot: taivo@opencopilot.dev.

About

๐Ÿ•Š๏ธ Build and embed open-source AI Copilots into your product with ease

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.8%
  • HTML 0.2%