Home

Awesome

directus-extension-copilot

A Directus extension that provides an Insights panel and API endpoint allowing you to chat with your data using OpenAI.

Requirements

Details

Demo Video

https://github.com/programmarchy/directus-extension-copilot/assets/622192/312a6b30-063f-4d16-84f3-0d7989a4680c

Screenshots

<img width="1241" alt="screenshot-1" src="https://github.com/programmarchy/directus-extension-copilot/assets/622192/de911a27-7ffb-4d7a-9f1e-3129489308f7"> <img width="1241" alt="screenshot-2" src="https://github.com/programmarchy/directus-extension-copilot/assets/622192/828fae64-4eea-4065-b4bf-4f965d7d2ffb"> <img width="1241" alt="screenshot-3" src="https://github.com/programmarchy/directus-extension-copilot/assets/622192/c015086f-3db0-4055-9895-0f8a3aaa1934">

Build

Building this extension is a bit wonky because of issues I had with langchain.js. I made some hacks, and copied the package locally to reference as a local package. To build this extension:

pnpm build:langchain
pnpm i
pnpm build

To spare you any trouble, I included the dist folder so you can skip having to build the extension yourself.

Installation

The easiest way to install this extension is to clone it directly into your Directus project's extensions path. Directus should then load it as a bundle extension.

Configuration

Provide your OpenAI API key either by setting OPENAI_API_KEY in your Directus configuration (e.g. your .env), or by pasting your key into the field when configuring the Copilot panel on your Insights dashboard.

Collaborators