Code Monkey home page Code Monkey logo

dcarpintero / quick-start-connectors Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cohere-ai/quick-start-connectors

0.0 1.0 0.0 8.04 MB

This open-source repository offers reference code for integrating workplace datastores with Cohere's LLMs, enabling developers and businesses to perform seamless retrieval-augmented generation (RAG) on their own data.

Home Page: https://docs.cohere.com/docs/connectors

License: MIT License

Shell 0.07% Python 99.39% Perl 0.10% Dockerfile 0.43%

quick-start-connectors's Introduction

Quick Start Connectors

License: MIT


Table of Contents

Overview

Cohere's Build-Your-Own-Connector framework allows you to integrate Cohere's Command LLM via the Chat api endpoint to any datastore/software that holds text information and has a corresponding search endpoint exposed in its API. This allows the Command model to generated responses to user queries that are grounded in proprietary information.

Some examples of the use-cases you can enable with this framework:

  • Generic question/answering around broad internal company docs
  • Knowledge working with specific sub-set of internal knowledge
  • Internal comms summary and search
  • Research using external providers of information, allowing researchers and writers to explore to information from 3rd parties

This open-source repository contains code that will allow you to get started integrating with some of the most popular datastores. There is also an empty template connector which you can expand to use any datasource. Note that different datastores may have different requirements or limitations that need to be addressed in order to to get good quality responses. While some of the quickstart code has been enhanced to address some of these limitations, others only provide the basics of the integration, and you will need to develop them further to fit your specific use-case and the underlying datastore limitations.

Please read more about our connectors framework here: https://docs.cohere.com/docs/connectors

Getting Started

This project requires Python 3.11+ and Poetry at a minimum. Each connector uses poetry to create a virtual environment specific to that connector, and to install all the required dependencies to run a local server.

For production releases, you can optionally build and deploy using Docker. When building a Docker image, you can use the Dockerfile in the root project directory and specify the app build argument. For example:

docker build . -t gdrive:1 --build-arg app=gdrive

Development

For development, refer to a connector's README. Generally, there is an .env file that needs to be created in that subdirectory, based off of a .env-template. The environment variables here most commonly set authorization values such as API keys, credentials, and also modify the way the search for that connector behaves.

After configuring the .env, you will be able to use poetry's CLI to start a local server.

Integrating With Cohere

All of the connectors in this repository have been tailored to integrate with Cohere's Chat API to make creating a grounded chatbot quick and easy.

Cohere's API requires that connectors return documents as an array of JSON objects. Each document should be an object with string keys and string values containing all the relevant information about the document (e.g. title, url, etc.). For best results the largest text content should be stored in the text key.

For example, a connector that returns documents about company expensing policy might return the following:

[
  {
    "title": "Company Travel Policy",
    "text": "Flights, Hotels and Meals can be expensed using this new tool...",
    "url": "https://drive.google.com/file/d/id1",
    "created_at": "2023-11-25T20:09:31Z"
  },
  {
    "title": "2024 Expenses Policy",
    "text": "The list of recommended hotels are...",
    "url": "https://drive.google.com/file/d/id2",
    "created_at": "2023-12-04T16:52:12Z"
  }
]

Cohere's Chat API will query the connector and use these documents to generated answers with direct citations.

Contributing

Contributions are what drive an open source community, any contributions made are greatly appreciated. For specific. To get started, check out our documentation.

quick-start-connectors's People

Contributors

dependabot[bot] avatar eugenelightson avatar tianjing-li avatar walterbm-cohere avatar tomtobac avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.