Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from swirlai:main #99

Merged
merged 20 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Real examples of what teams build with SWIRL:

**Try SWIRL Enterprise for free for 30 Days. Click on the banner to contact us.**

[![SWIRL Co-Pilot](docs/images/swirl_enterprise_demo.png)](https://swirlaiconnect.com/contact-us)
[![SWIRL Assistant](docs/images/swirl_enterprise_demo.png)](https://swirlaiconnect.com/contact-us)

### ⚡ Why Teams Choose SWIRL

Expand Down
124 changes: 59 additions & 65 deletions docs/AI-Co-Pilot.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: default
title: AI Co-Pilot Guide
title: AI Search Assistant Guide
nav_order: 10
---
<details markdown="block">
Expand All @@ -12,86 +12,80 @@ nav_order: 10
{:toc}
</details>

# AI Co-Pilot Guide - Enterprise Edition
<span class="big-text">AI Search Assistant Guide</span><br/><span class="med-text">Enterprise Edition</span>

{: .warning }
This document applies only to SWIRL AI Co-Pilot, Enterprise Edition.
Please [contact SWIRL](mailto:hello@swirlaiconnect.com) for access to SWIRL Enterprise.

# Configuring SWIRL AI Co-Pilot, Enterprise Edition
---

# Configuring SWIRL AI Search Assistant, Enterprise Edition

## Roles for Generative AI/Large Language Models
## Roles for Generative AI / Large Language Models

SWIRL AI Connect, included with Co-Pilot, defines four roles for GAI/LLMs, as noted below. SWIRL AI Co-Pilot adds a fifth role, "Chat". This can be assigned to any sufficiently capable LLM.
SWIRL AI Search defines four core roles for GAI/LLMs. SWIRL AI Search Assistant adds a **fifth role, "chat,"** which can be assigned to any sufficiently capable LLM.

| Role | Description | Default |
| ------- | ----------- | -------- |
| reader | Providing embeddings for SWIRL's Reader LLM to use when re-ranking search results | spaCy |
| query | Provide completions for query transformations | OpenAI GPT-3.5 Turbo |
| connector | Provide completions for direct questioning (not RAG) | OpenAI GPT-3.5 Turbo |
| rag | Provide completions for Retrieval Augmented Generation (RAG) using data retrieved by SWIRL | OpenAI GPT-4 |
| chat | Provide messaging support for SWIRL AI Co-Pilot | OpenAI GPT-4 |
| Role | Description | Default Provider |
| ------- | ----------- | ---------------- |
| `reader` | Generates embeddings for SWIRLs Reader LLM to re-rank search results | spaCy |
| `query` | Provides query completions for transformations | OpenAI GPT-3.5 Turbo |
| `connector` | Answers direct questions (not RAG) | OpenAI GPT-3.5 Turbo |
| `rag` | Generates responses using Retrieval-Augmented Generation (RAG) with retrieved data | OpenAI GPT-4 |
| `chat` | Powers SWIRL AI Search Assistant messaging | OpenAI GPT-4 |

## Adding Chat to an AI Provider

* Go to the `swirl/aiproviders` endpoint. For example, if using the default local install: [http://localhost:8000/swirl/aiproviders](http://localhost:8000/swirl/aiproviders)

![SWIRL AI Providers](https://docs.swirl.today/images/swirl_aiproviders.png)

* Edit any AI Provider by adding the `id` value to the end of the `swirl/aiproviders` URL. For example: `http://localhost:8000/swirl/aiproviders/4/`

![SWIRL AIProvider - Azure/OpenAI GPT-4](images/swirl_aiprovider_4.png)

* Review the provider definition to ensure that the `active` property is `true`.

* Review the `tags` and `default` lists in the definition. For an AI Provider to provide Co-Pilot services:

1. Make sure `active` is `true`
2. Verify that `api_key` has a valid API key
3. Ensure `model` and any items in `config` are filled in correctly
4. The provider has `chat` in the `tags` list
5. The provider has `chat` in the `defaults` list

For example, here is the preloaded OpenAI GPT-4 provider, set for chat as well as RAG:

``` json
{
"id": 16,
"name": "OpenAI GPT-4",
"owner": "admin",
"shared": true,
"date_created": "2024-03-04T15:15:16.940393-05:00",
"date_updated": "2024-03-04T15:15:16.940410-05:00",
"active": true,
"api_key": "<your-openai-api-key>",
"model": "gpt-4",
"config": {},
"tags": [
"query",
"connector",
"rag",
"chat"
],
"defaults": [
"rag",
"chat"
]
}
1. Open the **AI Providers** management page: [http://localhost:8000/swirl/aiproviders](http://localhost:8000/swirl/aiproviders) (default local installation).

![SWIRL AI Providers](https://docs.swirl.today/images/swirl_aiproviders.png)

2. Edit an AI provider by appending its `id` to the URL, e.g.: [http://localhost:8000/swirl/aiproviders/4/](http://localhost:8000/swirl/aiproviders/4/)

![SWIRL AIProvider - Azure/OpenAI GPT-4](images/swirl_aiprovider_4.png)

3. **Ensure the following in the provider’s configuration:**

- `active` is set to `true`
- `api_key` contains a valid API key
- `model` and `config` values are correctly filled
- `"chat"` is included in the `tags` list
- `"chat"` is included in the `defaults` list

Example: OpenAI GPT-4 Configured for Chat & RAG

```json
{
"id": 16,
"name": "OpenAI GPT-4",
"owner": "admin",
"shared": true,
"date_created": "2024-03-04T15:15:16.940393-05:00",
"date_updated": "2024-03-04T15:15:16.940410-05:00",
"active": true,
"api_key": "<your-openai-api-key>",
"model": "gpt-4",
"config": {},
"tags": ["query", "connector", "rag", "chat"],
"defaults": ["rag", "chat"]
}
```

Assuming the AI provider is correctly configured, you should be able to load the Co-Pilot using a browser. If using the default installation, this will be:
## Launching Assistant

[http://localhost:8000/galaxy/chat](http://localhost:8000/galaxy/chat)
Once the AI provider is configured correctly, **Assistant should be accessible via a browser**.

![SWIRL Co-Pilot discussion](images/swirl_40_chat_scop.png)
For a default installation, go to: [http://localhost:8000/galaxy/chat](http://localhost:8000/galaxy/chat)

Please refer to the AI Connect, Enterprise Edition, section on [Connecting to Enteprise AI](AI-Connect.html#connecting-to-enterprise-ai) for more information on configuring AI Providers.
![SWIRL Assistant discussion](images/swirl_40_chat_scop.png)

## GAI/LLM Requirements
For more details, see the **AI Search, Enterprise Edition** section: [Connecting to Enterprise GAI and LLMs](./AI-Connect#connecting-to-generative-ai-gai-and-large-language-models-llms).

SWIRL Co-Pilot expects the following from GAI/LLMs that provide chat functionality:
## GAI/LLM Requirements

* Support for receiving the chat history in each message, in reverse chronological order, i.e. the format used by the [OpenAI Chat Completions API](https://platform.openai.com/docs/guides/chat-completions/getting-started)
SWIRL AI Search Assistant expects AI providers to support:

* Prompt support of at least 3k tokens per message, with 6k+ preferred
- **Chat history in reverse chronological order**, following the format used by the [OpenAI Chat Completions API](https://platform.openai.com/docs/guides/chat-completions/getting-started).
- **Prompt size of at least 3K tokens per message**, with 6K+ preferred.
- **Recommended models:** OpenAI GPT-4 (`gpt-4`, `gpt-4o`), Anthropic Claude 3, or Google Gemini Pro/Ultra.

* Currently, we recommend OpenAI GPT-4 (all variants including 'o'), Anthropic Claude 3 or Google Gemini Pro/Ultra. But there are many incredible models, and any of them that support the chat history (noted above) may work. Please [let us know](#support) what works, and doesn't work!
Other LLMs may also work **if they support chat history as described above**. If you test alternative models, please **[let us know](#support)** what works (or doesn’t)!
Loading
Loading