diff --git a/docs/AI-Co-Pilot.md b/docs/AI-Co-Pilot.md index 43fc38472..8a7b03a44 100644 --- a/docs/AI-Co-Pilot.md +++ b/docs/AI-Co-Pilot.md @@ -39,7 +39,7 @@ SWIRL AI Connect, included with Co-Pilot, defines four roles for GAI/LLMs, as no * 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) +![SWIRL AIProvider - Azure/OpenAI GPT-4](images/swirl_aiprovider_4.png) * Review the provider definition to ensure that the `active` property is `true`. @@ -78,11 +78,11 @@ For example, here is the preloaded OpenAI GPT-4 provider, set for chat as well a } ``` -Assuming the AI provider is correctly configured, you should be able to load the Co-Pilot using a browser. If you are using the default installation, this will be: +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: [http://localhost:8000/galaxy/chat](http://localhost:8000/galaxy/chat) -![SWIRL Co-Pilot](images/swirl_copilot_chat_rag.png) +![SWIRL Co-Pilot discussion](images/swirl_40_chat_scop.png) 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. diff --git a/docs/AI-Connect.md b/docs/AI-Connect.md index 744afc4dc..6dfebb07f 100644 --- a/docs/AI-Connect.md +++ b/docs/AI-Connect.md @@ -192,7 +192,7 @@ The following links present the models available through LiteLLM: 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) +![SWIRL AIProvider - Azure/OpenAI GPT-4](images/swirl_aiprovider_4.png) From here, use the form at the bottom of the page to: @@ -343,21 +343,7 @@ This will ensure you see messages from the `celery-beats` log. However, most of ## Default Prompt -By default, the SWIRL system prompt is as follows: - -``` -{ - "name": "default", - "shared": false, - "prompt": "Answer this query '{query}' given the following recent search results as background information. Do not mention that you are using the provided background information. Please list the sources at the end of your response. Ignore information that is off-topic or obviously conflicting, without warning about it. The results may include information for different entities with identical names, try to disambiguate them in your response. If you discover possible familiar relationships in the content, mention it as a possibility.", - "data": [], - "note": "Important: Text between {RAG_IMPORTANT_START_TAG} and {RAG_IMPORTANT_END_TAG} is most pertinent to the query.\n", - "footer": "\n\n\n\n--- Final Instructions ---\nIn your response do not assume people with vastly different work histories are the same person. If the query appears to be a proper name, focus on answering the question, 'Who is?' or 'What is?', as appropriate. If the query appears to be a question, then try to answer it. For the list of sources, use the HTML tags and format in the example below:\n\n

\n
Sources:\n
example description 1     example website or source name 1\n
example description 2     example website or source name 2\n

\n\nEnclose your response in HTML tags

and insert a
HTML tag every two sentences.", - "tags": [] -} -``` - -This is designed to operate on search queries by providing summarization of the provided data and/or answering simple questions from it. +You can view the default prompts from the SWIRL AI Connect page: ## Creating New Saved Prompts @@ -370,8 +356,7 @@ For example, to modify the default prompt so that the response is in pirate-spea ``` { "name": "pirate", - "prompt": "Answer this query '{query}' given the following recent search results as background information. Do not mention that you are using the provided background information. Please list the sources at the end of your response. Ignore information that is off-topic or obviously conflicting, without warning about it. The results may include information for different entities with identical names, try to disambiguate them in your response. If you discover possible familiar relationships in the content, mention it as a possibility.", - "note": "Important: Text between {RAG_IMPORTANT_START_TAG} and {RAG_IMPORTANT_END_TAG} is most pertinent to the query.", + ... etc ... "footer": "--- Final Instructions ---\nIn your response, pretend you are a pirate comedian, but keep it clean!", "tags": [] } @@ -379,7 +364,7 @@ For example, to modify the default prompt so that the response is in pirate-spea This should produce the following: -![SWIRL Prompt Object](./images/swirl_prompt_form.png) +![SWIRL Prompt Object](images/swirl_prompt_form.png) ## Specifying a Saved Prompt in a Query @@ -391,7 +376,7 @@ swirl ai connect prompt:pirate The response should be in pirate-speak: -![SWIRL RAG response in pirate speak](./images/swirl_prompt_pirate.png) +![SWIRL RAG response in pirate speak](images/swirl_prompt_pirate.png) ## Understanding Saved Prompts diff --git a/docs/Admin-Guide.md b/docs/Admin-Guide.md index b451a081f..b19fc137e 100644 --- a/docs/Admin-Guide.md +++ b/docs/Admin-Guide.md @@ -179,6 +179,14 @@ python swirl.py restart {: .highlight } Consult the [release notes](https://github.com/swirlai/swirl-search/releases) for more information on each release. +## Resetting Prompts + +To reset AI prompts to their default state, run the following command: + +`python swirl.py reload_ai_prompts` + +This will restore the system prompts to the "factory" settings. New prompts are not impacted. + # Configuring SWIRL SWIRL uses the following configuration items, defined in the [`swirl_server/settings.py`](https://github.com/swirlai/swirl-search/blob/main/swirl_server/settings.py): diff --git a/docs/Developer-Guide.md b/docs/Developer-Guide.md index 31893a464..c3ab00433 100644 --- a/docs/Developer-Guide.md +++ b/docs/Developer-Guide.md @@ -34,8 +34,16 @@ This document applies to all SWIRL Editions. # Architecture -![SWIRL Federated Search Architecture -1](images/swirl_architecture-1.png) -![SWIRL Federated Search Architecture -2](images/swirl_architecture-2.png) +## SWIRL AI Connect +![SWIRL AI Connect Architecture](images/swirl_architecture_1.png) + +![SWIRL AI Connect Architecture Part 2](images/swirl_architecture_2.png) + +## SWIRL RAG Architecture +![SWIRL RAG Architecture](images/swirl_architecture_3.png) + +## SWIRL AI Co-Pilot +![SWIRL AI Co-Pilot Architecture](images/swirl_architecture_4.png) # Workflow @@ -191,11 +199,11 @@ SWIRL AI Connect, Community Edition, supports this using the ChatGPTQueryProcess ## Adjusting the swirl_score that causes Galaxy UI to star results -The `swirl_score` configuration is available in `theminimumSwirlScore` entry of `static/api/config/default`. +For SWIRL Community, this configuration is the `theminimumSwirlScore` entry of `static/api/config/default`. The default value is `100`. Higher values will produce fewer starred results. -The default value is `100`. Higher values will produce fewer starred results. +For SWIRL Enterprise, the configuration is the `minimumConfidenceScore` entry of the `static/api/config/default`. The default value is .7. Higher values will produce fewer starred results. -![Galaxy UI with stars](https://raw.githubusercontent.com/swirlai/swirl-search/main/docs/images/3_2_0-Galaxy-star.png) +![SWIRL AI Connect 4.0 Results](images/swirl_40_results.png) ## Handle NOTted queries @@ -391,7 +399,29 @@ It is intended for SearchProviders that would otherwise have few (or no) good re Specify `DATASET` in the `result_mappings` to have SWIRL organize a columnar response into a single result, with the columns in the payload. -![Galaxy UI with Chart Generated from Thoughtspot Dataset Result](images/3_5_0-Chart_UI.png) +![Galaxy UI with charts displayed](images/swirl_40_chart_display.png) + +`DATASET` is fully compatible with `result_mappings`, including `NO_PAYLOAD`. + +SWIRL uses `chart.js` to visualize data sets. The following list explains how it selects the type of chart: + +* Field Analysis via checkSupported(): +This method examines the first row of the extracted data: +It counts how many fields are numeric versus non‑numeric. + +* No Numeric Fields: +A pseudo-count field `count` is added to simulate numeric data. Depending on how many fields are present, it will default to a bar or a stacked bar chart. + +* One Numeric Field: +If there’s only one numeric field (and at least one string/discrete field), the component chooses a bar chart. + +* Two Numeric Fields: +If exactly two numeric fields are present, the component checks the range (difference between maximum and minimum values) of each field. If both ranges are positive, a scatter chart is used; otherwise, it defaults to a bar chart. + +* Three or More Numeric Fields: +With three or more numeric fields, the third field is used to size the bubbles. If the third field’s range is positive, the component chooses a bubble chart; if not, it defaults to a bar chart. + +Please [contact support](mailto:support@swirlaiconnect.com) if you need help with this feature. ## Expire Search Objects diff --git a/docs/Developer-Reference.md b/docs/Developer-Reference.md index 9b652aebf..3f97469e5 100644 --- a/docs/Developer-Reference.md +++ b/docs/Developer-Reference.md @@ -946,7 +946,7 @@ Note: Putting a fixed SQL query in the `query_template` is perfectly acceptable. # Processing Pipelines -![SWIRL Processing Pipelines](images/processing_pipielines.png) +![SWIRL Processing Pipelines](images/swirl_architecture_1.png) Processors are intended to be single purpose and executed in a sequence called a "pipeline". Pipelines are specified as JSON lists in their respective properties. There are four processing pipelines in SWIRL: * `Search.pre_query_processors` diff --git a/docs/M365-Guide.md b/docs/M365-Guide.md index fe3a2e7ad..61d3b2887 100644 --- a/docs/M365-Guide.md +++ b/docs/M365-Guide.md @@ -240,22 +240,17 @@ To: } ``` -# Authenticate to Microsoft - -{: .highlight } -As of SWIRL 3.2.0, when signing in to SWIRL via Microsoft OIDC, users are now automatically authorized to any active M365 SearchProviders. +# Authenticating with Microsoft To verify that the SWIRL-M365 integration is working, open the Galaxy UI: (or ) -Click on the profile icon at the top right and then click the Microsoft toggle to activate it. Depending on how the above configuration was done, M365 may require authentication and/or granting of access. After that, the toggle next to the Microsoft logo will light up, indicating a successful connection. - -![SWIRL Search box Auth](images/swirl_searchbox_auth-galaxy_dark.png) +Click on the profile icon at the top right and then click the Microsoft toggle to activate it. Depending on how the above configuration was done, M365 may require authentication and/or granting of access. -Now, enter a search in the UI: `metasearch` +SSO Provider Login Page -Assuming any document in your M365 contains the word `metasearch`, results should appear in just a few seconds: +After that, the toggle next to the Microsoft logo will light up, indicating a successful connection. You can then query any of the Microsoft sources: -![SWIRL Results Auth](images/swirl_results_auth-galaxy_dark.png) +![SWIRL Co-Pilot discussion](images/swirl_40_search_msft.png) {: .warning } If the toggle does not light up after authenticating with Microsoft, please [contact support](#support). The [related documentation](#related-documentation) below may also be useful. diff --git a/docs/Quick-Start-Enterprise.md b/docs/Quick-Start-Enterprise.md index 54bc8ac9b..99222cdfd 100644 --- a/docs/Quick-Start-Enterprise.md +++ b/docs/Quick-Start-Enterprise.md @@ -73,13 +73,13 @@ The output should look like this, or similar: If the search page appears, click `Log Out` at the top, right. The SWIRL login page will appear: -![SWIRL Login](images/swirl_login-galaxy_dark.png) +![SWIRL Login](images/swirl_40_login.png) * Enter the username `admin` and password `password`, then click `Login`. * Enter a search in the search box and press the `Search` button. Ranked results appear in just a few seconds: -![SWIRL Results No M365](images/swirl_results_no_m365-galaxy_dark.png) +![SWIRL Results No M365](images/swirl_40_results.png) If they don’t appear, or an error occurs, please [contact support](#support). @@ -108,7 +108,7 @@ To use different AI providers for RAG and AI Co-Pilot, set the “defaults” li * When there is at least one active, default provider for RAG, you may click the “Generate AI Insights” button at the top of the AI Connect form. For example: -![SWIRL Results with RAG](images/swirl_rag_pulmonary_1.png) +![SWIRL Results with RAG](images/swirl_40_community_rag.png) * To try the SWIRL AI Co-Pilot, navigate to: [http://localhost:8000/galaxy/chat](http://localhost:8000/galaxy/chat) @@ -118,7 +118,7 @@ Be sure to verify that RAG is working before attempting to use Co-Pilot. * Direct the co-pilot to search for something of interest, and you should get a RAG result as part of the conversation, including citations: -![SWIRL Co-Pilot Conversation with RAG Result](images/swirl_copilot_chat_rag.png) +![SWIRL Co-Pilot Conversation with RAG Result](images/swirl_40_enterprise_assistant_rag.png) * SWIRL ships with admin/password pre-configured as noted. This may cause a warning to appear if using Galaxy with the Google Chrome browser. diff --git a/docs/Quick-Start.md b/docs/Quick-Start.md index 2de052ae9..db90fb15d 100644 --- a/docs/Quick-Start.md +++ b/docs/Quick-Start.md @@ -64,71 +64,42 @@ docker compose up After a few minutes, the following or similar should appear: ``` shell -redis-1 | 1:C 05 Feb 2024 22:03:51.503 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo -redis-1 | 1:C 05 Feb 2024 22:03:51.503 * Redis version=7.2.4, bits=64, commit=00000000, modified=0, pid=1, just started -redis-1 | 1:C 05 Feb 2024 22:03:51.503 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf -redis-1 | 1:M 05 Feb 2024 22:03:51.504 * monotonic clock: POSIX clock_gettime -redis-1 | 1:M 05 Feb 2024 22:03:51.504 * Running mode=standalone, port=6379. -redis-1 | 1:M 05 Feb 2024 22:03:51.505 * Server initialized -redis-1 | 1:M 05 Feb 2024 22:03:51.505 * Ready to accept connections tcp -app-1 | __S_W_I_R_L__3_._2_._0__________________________________________________________ -app-1 | -app-1 | Setting Up Swirl: -app-1 | Checking Migrations: -app-1 | -app-1 | Migrating: -app-1 | -app-1 | Operations to perform: -app-1 | Apply all migrations: admin, auth, authtoken, contenttypes, django_celery_beat, sessions, swirl -app-1 | Running migrations: -app-1 | No migrations to apply. -app-1 | -app-1 | -app-1 | Collecting Statics: -app-1 | -app-1 | -app-1 | 246 static files copied to '/app/static'. -app-1 | -app-1 | Ok -app-1 | Command successful! -app-1 | __S_W_I_R_L__3_._2_._0__________________________________________________________ -app-1 | -app-1 | Warning: logs directory does not exist, creating it -app-1 | ParseResult(scheme='redis', netloc='redis:6379', path='/0', params='', query='', fragment='') checked. -app-1 | ParseResult(scheme='redis', netloc='redis:6379', path='/0', params='', query='', fragment='') checked. -app-1 | Start: celery-worker -> celery -A swirl_server worker --loglevel INFO ... Ok, pid: 50 -app-1 | Start: celery-beats -> celery -A swirl_server beat --scheduler django_celery_beat.schedulers:DatabaseScheduler ... Ok, pid: 72 +app-1 | Start: celery-worker -> celery -A swirl_server worker ... Ok, pid: 55 +app-1 | Start: celery-beats -> celery -A swirl_server beat --scheduler django_celery_beat.schedulers:DatabaseScheduler ... Ok, pid: 81 app-1 | Updating .swirl... Ok app-1 | app-1 | PID TTY TIME CMD -app-1 | 50 ? 00:00:03 celery +app-1 | 55 ? 00:00:05 celery +app-1 | 81 ? 00:00:04 celery app-1 | -app-1 | You're using version 3.2.0 of Swirl, the current version. +app-1 | setting up logging... +app-1 | setting up logging DONE +app-1 | You're using version 4.0.0.0 of Swirl, the current version. app-1 | Command successful! -app-1 | 2024-02-05 17:04:14,131 INFO Starting server at tcp:port=8000:interface=0.0.0.0 -app-1 | 2024-02-05 17:04:14,131 INFO HTTP/2 support not enabled (install the http2 and tls Twisted extras) -app-1 | 2024-02-05 17:04:14,131 INFO Configuring endpoint tcp:port=8000:interface=0.0.0.0 -app-1 | 2024-02-05 17:04:14,132 INFO Listening on TCP address 0.0.0.0:8000 +app-1 | INFO 2025-02-17 15:45:00 cli Starting server at tcp:port=8000:interface=0.0.0.0 +app-1 | INFO 2025-02-17 15:45:00 server HTTP/2 support not enabled (install the http2 and tls Twisted extras) +app-1 | INFO 2025-02-17 15:45:00 server Configuring endpoint tcp:port=8000:interface=0.0.0.0 +app-1 | INFO 2025-02-17 15:45:00 server Listening on TCP address 0.0.0.0:8000 ``` * Open this URL with a browser: (or ) If the search page appears, click `Log Out` at the top, right. The SWIRL login page will appear: -![SWIRL Login](images/swirl_login-galaxy_dark.png) +SWIRL 4.0 Login * Enter the username `admin` and password `password`, then click `Login`. * Enter a search in the search box and press the `Search` button. Ranked results appear in just a few seconds: -![SWIRL Results No M365](images/swirl_results_no_m365-galaxy_dark.png) +![SWIRL AI Connect 4.0 Results](images/swirl_40_results.png) * Click the `Generate AI Insight` button to RAG using the most relevant results. {: .warning } -As noted above, you must have setup OpenAI or Azure/OpenAI prior to executing this step. +As noted above, if using the Community Edition, you *must* setup OpenAI or Azure/OpenAI prior to executing this step. -![SWIRL Results with RAG](images/swirl_rag_pulmonary_1.png) +![SWIRL AI Connect 4.0 Results with RAG](images/swirl_40_community_rag.png) * Click the profile avatar in the upper right corner of the Galaxy UI. Then click [Manage SWIRL](http://localhost:8000/swirl/) to explore the rest of SWIRL's features. diff --git a/docs/RAG-Guide.md b/docs/RAG-Guide.md index 2e563ac7a..0366076a3 100644 --- a/docs/RAG-Guide.md +++ b/docs/RAG-Guide.md @@ -71,10 +71,7 @@ SWIRL AI Connect Community Edition supports RAG only against OpenAI and Azure/Op Adjust the `timeout` value if necessary. Change the `User-Agent` string as needed, and/or authorize it to fetch pages from internal applications. -You can also override the default timeout value with a URL parameter in the Galaxy UI. For example: `http://localhost:8000/galaxy/?q=gig%20economics&rag=true&rag_timeout=90` - -{: .highlight } -Starting with SWIRL 3.7.0, we specify `rag_timeout`in seconds +You can also override the default timeout value with a URL parameter in the Galaxy UI. For example, to set a timeout of 90 seconds: `http://localhost:8000/galaxy/?q=gig%20economics&rag=true&rag_timeout=90` * Restart SWIRL: @@ -82,25 +79,21 @@ Starting with SWIRL 3.7.0, we specify `rag_timeout`in seconds python swirl.py restart ``` -* Go to the Galaxy UI ([http://localhost:8000/galaxy/](http://localhost:8000/galaxy/)). The "Generate AI Response" switch should be "off" as shown: -![Galaxy with RAG Generate AI Response switch off](images/swirl_rag_switch_off.png) - -* Run a search. Results appear quickly after you press the "Search" button ([http://localhost:8000/galaxy/?q=epmc:future+of+ai+care](http://localhost:8000/galaxy/?q=epmc:future+of+ai+care)): -![Galaxy with RAG results ready for selection](images/swirl_rag_pulmonary_1.png) +* Go to the Galaxy UI ([http://localhost:8000/galaxy/](http://localhost:8000/galaxy/)). The "Generate AI Response" switch should be "off". -* If you wish to manually select the results to RAG with, click the "Select Items" switch to make the shopping cart appear. Results that SWIRL thinks should be used in RAG will be pre-checked. Check or uncheck results, and optionally sort and/or filter them. -![Galaxy with RAG results selected](images/swirl_rag_pulmonary_2.png) +* Run a search. Results appear quickly after you press the "Search" button ([http://localhost:8000/galaxy/?q=epmc:future+of+ai+care](http://localhost:8000/galaxy/?q=SWIRL+AI+Connect)): +![Galaxy with RAG results ready for selection](images/swirl_40_community_rag.png) -* Click the "Generate AI Response" switch. A spinner will appear. The RAG response will appear several seconds later depending on a variety of factors. :slightly_smiling_face: -![Galaxy with human directed RAG AI insight](images/swirl_rag_pulmonary_3.png) +* If you wish to manually select the results to RAG with, click the "Select Items" switch to make the shopping cart appear. Results that SWIRL thinks should be used in RAG will be pre-checked. Check or uncheck results, and optionally sort and/or filter them. When ready, click the "Generate AI Response" switch. A spinner will appear. The RAG response will appear several seconds later depending on a variety of factors. :slightly_smiling_face: +![Galaxy with RAG results selected](images/swirl_40_rag_select.png) -* Verify the RAG insight you received by reviewing the citations at the end RAG response. +* Verify the RAG insight you received by reviewing the citations below the RAG response. {: .highlight } To cancel a RAG process, click the "Generate AI Summary" toggle off. {: .warning } -SWIRL's RAG processing utilizes only the *first 10 results* that are selected either automatically or manually using the "Select Items" option. +By default, SWIRL's RAG processing utilizes the *first 10 results* that are selected either automatically or manually using the "Select Items" option. To change the number, specify `SWIRL_RAG_MAX_TO_CONSIDER` in the .env file as noted in the [AI Connect Guide](./AI-Connect.md#configuration-options). ## Notes diff --git a/docs/Tutorials.md b/docs/Tutorials.md index 67bdedffb..a1661629d 100644 --- a/docs/Tutorials.md +++ b/docs/Tutorials.md @@ -14,27 +14,15 @@ nav_order: 20 # Tutorial: Extending SWIRL -## Background: The SWIRL Search Workflow +## Before You Start... -In a nutshell: +We recommend reviewing the following documents prior to pursuing the tutorial. -* User creates a query - example: [http://localhost:8000/swirl/search/?q=ai](http://localhost:8000/swirl/search/?q=ai) -* Pre-query processing - example: [SpellcheckQueryProcessor](https://github.com/swirlai/swirl-search/blob/main/swirl/processors/spellcheck_query.py) - -{: .highlight } -Each Search Provider executes in parallel - -* Query processing - example: [AdaptiveQueryProcessor](https://github.com/swirlai/swirl-search/blob/main/swirl/processors/adaptive.py) -* Connector - example: [RequestsGet](https://github.com/swirlai/swirl-search/blob/main/swirl/connectors/requestsget.py) -* Result processing - example: [MappingResultsProcessor](https://github.com/swirlai/swirl-search/blob/main/swirl/processors/mapping.py) - -{: .highlight } -Parallel processing ends here - -* Post-result processing - example: [CosineRelevancyPostResultProcessor](https://github.com/swirlai/swirl-search/blob/main/swirl/processors/relevancy.py) -* Ranked-results available via mixer - example: [http://localhost:8000/swirl/results/?search_id=1](http://localhost:8000/swirl/results/?search_id=1) - -For more information, consult the [Developer Guide, Workflow Overview](Developer-Guide.html#workflow). +* [What is SWIRL?](index.md#what-is-swirl-ai-connect) +* [SWIRL Workflow](Developer-Guide.html#workflow) +* [How do I connect SWIRL to some new source?](index.md#how-do-i-connect-swirl-to-some-new-source) +* [Response Mappings](https://docs.swirlaiconnect.com/SP-Guide.html#response-mappings) +* [Result Mappings](https://docs.swirlaiconnect.com/SP-Guide.html#result-mappings) # Creating a SearchProvider @@ -53,10 +41,13 @@ For example, if trying to query a website using a URL like `https://host.com/?q= ``` To learn more about query and URL parameters, refer to the [SearchProvider Guide](SP-Guide.html). -* If the website offers the ability to page through results, or sort results by date (as well as relevancy), use the `PAGE=` and `DATE_SORT=` query mappings to add support for these features through SWIRL. For example: +* If the website offers the ability to page through results, or sort results by date (as well as relevancy), use the `PAGE=` and `DATE_SORT=` query mappings to add support for these features through SWIRL. + +For example: ``` -TO DO +"query_mappings": "DATE_SORT=sort=date,PAGE=start=RESULT_INDEX" ``` + For more information, refer to the [SearchProvider Guide, Query Mappings](SP-Guide.html#query-mappings) section. * Open the query URL in a browser and look through the JSON response. @@ -125,12 +116,15 @@ class MyConnector(Connector): * In the `__init__` class, load and persist anything that will be needed when connecting and querying the service. -* Import the Python package(s) to connect to the service. The ChatGPT connector uses the `openai` package, for example: +* Import the Python package(s) to connect to the service. + ``` -import openai +import your-connector-package ``` -* Modify the `execute_search` method to connect to the service. As you can see from the ChatGPT Connector, it first loads the OpenAI credentials, then constructs a prompt, sends the prompt via `openai.ChatCompletion.create()`, then stores the response. +* Modify the `execute_search` method to connect to the service. + +As you can see from the ChatGPT Connector, it first loads the OpenAI credentials, then constructs a prompt, sends the prompt via `openai.ChatCompletion.create()`, then stores the response. ``` def execute_search(self, session=None): @@ -185,7 +179,10 @@ import openai ``` -* ChatGPT depends on the OpenAI API key, which is provided to SWIRL via the `.env` file. To follow this pattern, create new values in `.env` then modify `swirl_server/settings.py` to load them as Django settings, and set a reasonable default. +* ChatGPT depends on the OpenAI API key, which is provided to SWIRL Community via the `.env` file. To follow this pattern, create new values in `.env` then modify `swirl_server/settings.py` to load them as Django settings, and set a reasonable default. + +{: .highlight } +In SWIRL Enterprise, use [AIProviders to configure LLMs and RAG](AI-Connect.md#activating-ai-providers) instead of the `.env` file. * Modify the `normalize_response()` method to store the raw response. This is literally no more (or less) than writing the result objects out as a Python list and storing that in `self.results`: ``` diff --git a/docs/User-Guide-Enterprise.md b/docs/User-Guide-Enterprise.md index 555364427..76467b632 100644 --- a/docs/User-Guide-Enterprise.md +++ b/docs/User-Guide-Enterprise.md @@ -21,88 +21,171 @@ This version applies to the Enterprise Edition of SWIRL! The following new terms are used when referring to SWIRL Enterprise products. -| Word | Explanation | +| Term | Explanation | | ---------- | ---------- | | AIProvider | A configuration of a Generative AI or LLM. It includes metadata identifying the type of model used, API key, and more. (Enterprise Edition only) | -| Chat | A SWIRL object that stores message objects, for AI Co-Pilot | +| Chat | A SWIRL object that stores message objects, for the AI Co-Pilot | +| Confidence | A prediction as to the relevancy of a given SWIRL result, from 0 to 1 | | Message | A SWIRL object that contains some message either to or from a GAI/LLM | | Prompt | A SWIRL object that configures a GAI or LLM for use in various AI roles such as RAG or chat. (Enterprise Edition only) | -TBD: link to the Overview about Co-Pilot - -# Accessing your AI Co-Pilot +# Accessing AI Co-Pilot * Open this URL with a browser: +![SWIRL AI Co-Pilot](images/swirl_40_assistant_start.png) + +* Click the user profile (upper/right) icon on the [SWIRL Search page](http://localhost:8000/galaxy/search/), and then click "SWIRL AI Co-Pilot". + +![SWIRL AI Connect link to SWIRL AI Co-Pilot](images/swirl_40_assistant_link.png) + ## SWIRL Login *If the SWIRL login page appears*: -![SWIRL Login](images/swirl_login-galaxy_dark.png) +SWIRL Login with SSO Enter username `admin` and password `password`, then click `Login`. {: .warning } -If you receive a warning about the password being compromised or in a recent data breach, you [Change the super user password](Admin-Guide.html#changing-a-super-user-password). +If you receive a warning about the password being compromised or in a recent data breach, you [Change the super user password](Admin-Guide.html#changing-a-super-user-password)! ## SSO Login -*If your organizations SSO page appears*: +*If your organizations uses SSO*: + +The SWIRL login page will appear, with a button to login with SSO. + +SWIRL Login with SSO -![SSO page]() +Click the SSO login button. You may have to authenticate: -Login as you normally would. Regardless of the method you use, if you are successful at logging in, you should be redirected to the AI Co-Pilot: +SSO Provider Login Page -![Co-Pilot page](images/swirl_copilot_start.png) +Login to be redirected to the AI Co-Pilot: + +![SWIRL Co-Pilot with user logged in via SSO](images/swirl_40_chat_start.png) If you encounter an error message, [contact support](mailto:support@swirl.today) or your local system administrator. +# Verifying Login + +Click the profile icon at top/right to verify login. Use the switch to connect or disconnect as needed. + +![SWIRL Co-Pilot with user logged in to Microsoft, not to Box](images/swirl_40_chat_profile.png) + # Starting a Conversation -* Use the input box to send a message to the Co-Pilot. +Use the input box to send a message to the Co-Pilot. It will converse you with the goal of helping you find the information you need. +When you and the co-pilot agree, it will run a search against one or more sources, and summarize the results or answer your question! + +![SWIRL Co-Pilot discussion](images/swirl_40_chat_1.png) + +# Follow-up Questions + +The Co-Pilot will frequently (but not always) suggest follow-up questions. Click one to view the answer! + +![SWIRL Co-Pilot follow-up question and response](images/swirl_40_chat_2.png) + +# Generating Complex Queries + +Co-Pilot can generate queries in any query language supported by the underlying model. For example, OpenAI's latest models can generate queries using most dialects of SQL: + +![SWIRL Co-Pilot querying Google BigQuery using SQL](images/swirl_40_chat_SQL.png) + +Many other query languages, including MongoDB MQL, Elastic ES|QL, OpenSearch Query DSL, Solr syntax, etc. + +Contact SWIRL for assistance with any of these! + +# Human Language Support + +Co-Pilot can converse and query in any language supported by the underlying model. For example, OpenAI's latest models can converse in 100+ languages: + +![Querying SWIRL Co-Pilot in Japanese](images/swirl_40_chat_query_in_japanese.png) -A good first question is `What sources do I have access to?` +![Asking Co-Pilot to translate an English response to Japanese](images/swirl_40_chat_translate_response_to_japanese.png) -![Co-Pilot sources question]() +# Other Model Capabilities -The Co-Pilot should reply within 5 seconds: +SWIRL Co-Pilot won't prevent you from using any LLM capabilities, including: -![Co-Pilot sources]() +* Summarizing the contents of a Co-Pilot chat in various formats (bullet points, narrative iambic pentameter), so long as you ask in the same chat window/session (and not a new one) -If it doesn't, consult the [NEW TBD Troubleshooting Guide](). +* Translating Co-Pilot responses into other languages -If the sources it lists don't look correct, check with your system administrator. TBD: link to the solution (how to change description in SP etc) +* Reformatting, revising and otherwise re-trying responses -* From there, converse with the Co-Pilot with the goal of finding some information. It will assist you as much as it can with the knowledge it has; most importantly, it will ask clarifying questions to help you identify the right source(s) to search, and what to search for. +* Using memory to retain information across chat sessions -For example: +# Handling Errors -![Co-Pilot conversation about SWIRL cyber insurance coverage](images/swirl_copilot_cyberinsurance.png) +Sometimes, Co-Pilot won't find anything. Don't be alarmed! Tell Co-Pilot what to do, such as: + +* Correct the query +* Remove term(s) from the query +* Try a simpler search +* Try a different source +* Try again + +![SWIRL Co-Pilot correcting a spelling error](images/swirl_40_chat_try_different_query.png) + +* If you get this error while querying in SQL or other complex queries, you may need to correct the query: + +![SWIRL Co-Pilot having SQL corrected by user](images/swirl_40_chat_correct_query.png) # Ending a Conversation -To end a conversation, hit the SWIRL logo at the top of the page. This will start a new conversation. Co-Pilot will not remember or be able to access previous chat sessions UNLESS it has built-in memory of it's own. +To end a conversation, hit the SWIRL logo at the top of the page. This will start a new conversation. + +Co-Pilot will not remember or be able to access previous chat sessions *UNLESS* it has built-in memory of it's own. # Resuming an Old Conversation To resume a conversation, construct the URL to the chat session by adding the chat_id: [http://localhost:8000/galaxy/chat/?chat_id=1](http://localhost:8000/galaxy/chat/?chat_id=1) -As of 3.6, neither Co-Pilot or Galaxy will offer a summary of the conversation so far. It is on the calling application to review the history. Direct access to all previous chats is planned for a future release. +Future versions of Galaxy will offer the ability to access previous chats directly from the UI. + +# Using AI Search + +To access the Search interface, open the following URL: + +Or, from the Co-Pilot page, click on the profile button and click the `SWIRL AI Search` link: + +![SWIRL AI Search](images/swirl_40_searchlink.png) + +The login and authentication mechanisms are the same. If you are already logged to Co-Pilot, you should remain logged in when using search. + +![SWIRL AI Search with results and RAG](images/swirl_40_enterprise_search.png) + +## Confidence Scores + +SWIRL Enterprise version 4.0 (and later) features a new, confidence based relevancy ranking model. This confidence score ranges from 0 (not relevant) to 1.0 (extremely relevant) and is comparable across queries. When generating AI Insights, SWIRL Enterprise will take only results with a confidence score above a configurable minimium. + +The confidence score includes an evaluation of the number of query terms matched, and their importance, along with their contextual relevancy and many other factors. + +Relevancy is still available as an option from the `VIEW BY:` pull-down option. + +For more information consult the [Developer Guide](./Developer-Guide.md#adjusting-the-swirl_score-that-causes-galaxy-ui-to-star-results) + +## Customizing Prompts + +SWIRL AI Connect, Enterprise Edition, allows authorized users to select a specific prompt when generating an AI insight. + +![SWIRL AI Search with results and RAG](images/swirl_40_search_prompts.png) + +To select a specific prompt, the select it using the drop-down list below the search box prior to clicking the `Generate AI Insight` button. + +To view or edit a prompt, go to the endpoint, or the [Admin UI prompts management UI](http://localhost:8000/admin/swirl/prompt/). Use the HTML form, or raw data modes, at the bottom of the page to make changes or create new ones. -# Restrictions on GAI/LLM +![SWIRL AI Search prompts HTML form](images/swirl_40_prompt_endpoint.png) -SWIRL AI Co-Pilot imposes no significant restrictions on the capability of the LLM used. While chatting with Co-Pilot you can do anything the LLM supports. +SWIRL recommends not modifying the system prompts that are included with SWIRL. Should you need to reset them, consult the [Admin Guide section on resetting prompts](Admin-Guide.md#resetting-prompts). -For example: -* Chatting in one language and querying sources in others - any languages supported by the model -![Co-Pilot chatting in Japanese, querying in English]() -* Translating RAG responses into other languages -![Co-Pilot RAG response in Japanese]() diff --git a/docs/User-Guide.md b/docs/User-Guide.md index bd124d180..1ea9a8b9c 100644 --- a/docs/User-Guide.md +++ b/docs/User-Guide.md @@ -37,7 +37,7 @@ Please refer to the [SWIRL AI Connect Overview](index.html) for more information The SWIRL login page will appear: -![SWIRL Login](images/swirl_login-galaxy_dark.png) +SWIRL 4.0 Login * Enter username `admin` and password `password`, then click `Login`. @@ -46,17 +46,15 @@ If you receive a warning about the password being compromised or in a recent dat * Enter some search terms in the search box and press the `Search` button. Re-ranked results will appear in just a few seconds: -![SWIRL Results](images/swirl_results_no_m365-galaxy_dark.png) +![SWIRL AI Connect 4.0 Results](images/swirl_40_results.png) Note that SWIRL Community will only retrieve a single set of results as configured in each SearchProvider. Fetching additional pages, on demand, is planned for a future release. -The Galaxy UI highlghts results with a `swirl_score` above a configurable minimum score with a star in the results list. - -![Galaxy UI with stars](https://raw.githubusercontent.com/swirlai/swirl-search/main/docs/images/3_2_0-Galaxy-star.png) +The Galaxy UI stars results with a `swirl_score` above a configurable minimum. ## Filtering Results by Source -![SWIRL Results Source Facet](images/swirl_results_source-galaxy_dark.png) +![SWIRL AI Connect 4.0 Results w/Facet Selected](images/swirl_40_results_facet.png) SWIRL returns the best results from all available sources by default. To filter results by one or more sources, check one or more of the `Source` boxes as shown above. Results are instantly filtered to just those sources. @@ -64,11 +62,11 @@ Click `Clear All` to return to viewing all results. ## Sorting Results -![SWIRL Results View By](images/swirl_results_view_by-galaxy_dark.png) +![SWIRL Results View By](images/swirl_40_results_sorted.png) -SWIRL presents results sorted by relevancy by default. To sort by `Date` or to see the `Top Picks` from each silo, click on the `VIEW BY` dropdown and select your preference. +By default, SWIRL Community presents results sorted by relevancy score. To sort by `Date` or to see the `Top Picks` from each silo, click on the `VIEW BY` dropdown and select your preference. -SWIRL hides results that don't have a `date_published` value when sorting by `Date`. +SWIRL hides results that don't have a `date_published` value when sorting by `Date`. Switch back to `Relevancy` to see all results. ## Starting a New Search @@ -187,7 +185,9 @@ For more details, refer to the [Organizing SearchProviders with Active, Default SWIRL returns a unified result set consisting of results from all responding SearchProviders, matched by stemmed word form, and re-ranked using a cosine vector similarity relevancy model based on [spaCy](https://spacy.io/) and normalized by query and token length. It also incorporates the original `searchprovider_rank`. -For more details please consult the Developer Guide [Configure Relevancy Field Weights](Developer-Guide.html#configure-relevancy-field-weights) and [Understand the Explain Structure](Developer-Guide.html#understand-the-explain-structure) sections. +The Galaxy UI puts a star next to items that are over a configurable relevancy threshold. + +For more information consult the [Developer Guide Adjusting The SWIRL Score](./Developer-Guide.md#adjusting-the-swirl_score-that-causes-galaxy-ui-to-star-results), [Configure Relevancy Field Weights](Developer-Guide.html#configure-relevancy-field-weights) and [Understand the Explain Structure](Developer-Guide.html#understand-the-explain-structure) sections. ## Hit Highlighting diff --git a/docs/images/swirl_40_assistant_link.png b/docs/images/swirl_40_assistant_link.png new file mode 100644 index 000000000..ac352d9c9 Binary files /dev/null and b/docs/images/swirl_40_assistant_link.png differ diff --git a/docs/images/swirl_40_assistant_start.png b/docs/images/swirl_40_assistant_start.png new file mode 100644 index 000000000..28b2f9bac Binary files /dev/null and b/docs/images/swirl_40_assistant_start.png differ diff --git a/docs/images/swirl_40_chart_display.png b/docs/images/swirl_40_chart_display.png new file mode 100644 index 000000000..a0bd0193b Binary files /dev/null and b/docs/images/swirl_40_chart_display.png differ diff --git a/docs/images/swirl_40_chat_1.png b/docs/images/swirl_40_chat_1.png new file mode 100644 index 000000000..a7528fac0 Binary files /dev/null and b/docs/images/swirl_40_chat_1.png differ diff --git a/docs/images/swirl_40_chat_2.png b/docs/images/swirl_40_chat_2.png new file mode 100644 index 000000000..fae108450 Binary files /dev/null and b/docs/images/swirl_40_chat_2.png differ diff --git a/docs/images/swirl_40_chat_SQL.png b/docs/images/swirl_40_chat_SQL.png new file mode 100644 index 000000000..a89f353f8 Binary files /dev/null and b/docs/images/swirl_40_chat_SQL.png differ diff --git a/docs/images/swirl_40_chat_correct_query.png b/docs/images/swirl_40_chat_correct_query.png new file mode 100644 index 000000000..a631f62d1 Binary files /dev/null and b/docs/images/swirl_40_chat_correct_query.png differ diff --git a/docs/images/swirl_40_chat_profile.png b/docs/images/swirl_40_chat_profile.png new file mode 100644 index 000000000..f20836545 Binary files /dev/null and b/docs/images/swirl_40_chat_profile.png differ diff --git a/docs/images/swirl_40_chat_query_in_japanese.png b/docs/images/swirl_40_chat_query_in_japanese.png new file mode 100644 index 000000000..ad7e4bf31 Binary files /dev/null and b/docs/images/swirl_40_chat_query_in_japanese.png differ diff --git a/docs/images/swirl_40_chat_saic.png b/docs/images/swirl_40_chat_saic.png new file mode 100644 index 000000000..75de828c5 Binary files /dev/null and b/docs/images/swirl_40_chat_saic.png differ diff --git a/docs/images/swirl_40_chat_scop.png b/docs/images/swirl_40_chat_scop.png new file mode 100644 index 000000000..adc2465e8 Binary files /dev/null and b/docs/images/swirl_40_chat_scop.png differ diff --git a/docs/images/swirl_40_chat_start.png b/docs/images/swirl_40_chat_start.png new file mode 100644 index 000000000..28b2f9bac Binary files /dev/null and b/docs/images/swirl_40_chat_start.png differ diff --git a/docs/images/swirl_40_chat_translate_response_to_japanese.png b/docs/images/swirl_40_chat_translate_response_to_japanese.png new file mode 100644 index 000000000..0944f4e06 Binary files /dev/null and b/docs/images/swirl_40_chat_translate_response_to_japanese.png differ diff --git a/docs/images/swirl_40_chat_try_different_query.png b/docs/images/swirl_40_chat_try_different_query.png new file mode 100644 index 000000000..64cb26ef6 Binary files /dev/null and b/docs/images/swirl_40_chat_try_different_query.png differ diff --git a/docs/images/swirl_40_community_rag.png b/docs/images/swirl_40_community_rag.png new file mode 100644 index 000000000..d63d8f737 Binary files /dev/null and b/docs/images/swirl_40_community_rag.png differ diff --git a/docs/images/swirl_40_enterprise_assistant_rag.png b/docs/images/swirl_40_enterprise_assistant_rag.png new file mode 100644 index 000000000..843f91c64 Binary files /dev/null and b/docs/images/swirl_40_enterprise_assistant_rag.png differ diff --git a/docs/images/swirl_40_enterprise_search.png b/docs/images/swirl_40_enterprise_search.png new file mode 100644 index 000000000..4d78e2696 Binary files /dev/null and b/docs/images/swirl_40_enterprise_search.png differ diff --git a/docs/images/swirl_40_login.png b/docs/images/swirl_40_login.png new file mode 100644 index 000000000..31d2de39c Binary files /dev/null and b/docs/images/swirl_40_login.png differ diff --git a/docs/images/swirl_40_ms_login.png b/docs/images/swirl_40_ms_login.png new file mode 100644 index 000000000..af3e3e10e Binary files /dev/null and b/docs/images/swirl_40_ms_login.png differ diff --git a/docs/images/swirl_40_prompt_endpoint.png b/docs/images/swirl_40_prompt_endpoint.png new file mode 100644 index 000000000..e419ca29f Binary files /dev/null and b/docs/images/swirl_40_prompt_endpoint.png differ diff --git a/docs/images/swirl_40_rag_select.png b/docs/images/swirl_40_rag_select.png new file mode 100644 index 000000000..e0b4c79d1 Binary files /dev/null and b/docs/images/swirl_40_rag_select.png differ diff --git a/docs/images/swirl_40_results.png b/docs/images/swirl_40_results.png new file mode 100644 index 000000000..f6aa1a5e5 Binary files /dev/null and b/docs/images/swirl_40_results.png differ diff --git a/docs/images/swirl_40_results_facet.png b/docs/images/swirl_40_results_facet.png new file mode 100644 index 000000000..ae51bed54 Binary files /dev/null and b/docs/images/swirl_40_results_facet.png differ diff --git a/docs/images/swirl_40_results_sorted.png b/docs/images/swirl_40_results_sorted.png new file mode 100644 index 000000000..c92d27dd4 Binary files /dev/null and b/docs/images/swirl_40_results_sorted.png differ diff --git a/docs/images/swirl_40_search_msft.png b/docs/images/swirl_40_search_msft.png new file mode 100644 index 000000000..7b7926cd6 Binary files /dev/null and b/docs/images/swirl_40_search_msft.png differ diff --git a/docs/images/swirl_40_search_prompts.png b/docs/images/swirl_40_search_prompts.png new file mode 100644 index 000000000..f92511133 Binary files /dev/null and b/docs/images/swirl_40_search_prompts.png differ diff --git a/docs/images/swirl_40_searchlink.png b/docs/images/swirl_40_searchlink.png new file mode 100644 index 000000000..3adcd597b Binary files /dev/null and b/docs/images/swirl_40_searchlink.png differ diff --git a/docs/images/swirl_40_swirl_login.png b/docs/images/swirl_40_swirl_login.png new file mode 100644 index 000000000..30184acf8 Binary files /dev/null and b/docs/images/swirl_40_swirl_login.png differ diff --git a/docs/images/swirl_architecture_1.png b/docs/images/swirl_architecture_1.png new file mode 100644 index 000000000..e4293b439 Binary files /dev/null and b/docs/images/swirl_architecture_1.png differ diff --git a/docs/images/swirl_architecture_2.png b/docs/images/swirl_architecture_2.png new file mode 100644 index 000000000..f6ada09c5 Binary files /dev/null and b/docs/images/swirl_architecture_2.png differ diff --git a/docs/images/swirl_architecture_3.png b/docs/images/swirl_architecture_3.png new file mode 100644 index 000000000..36ecfd9a9 Binary files /dev/null and b/docs/images/swirl_architecture_3.png differ diff --git a/docs/images/swirl_architecture_4.png b/docs/images/swirl_architecture_4.png new file mode 100644 index 000000000..dda2340e2 Binary files /dev/null and b/docs/images/swirl_architecture_4.png differ diff --git a/docs/images/swirl_prompt_pirate.png b/docs/images/swirl_prompt_pirate.png index 35994cd74..66f1e1898 100644 Binary files a/docs/images/swirl_prompt_pirate.png and b/docs/images/swirl_prompt_pirate.png differ diff --git a/docs/index.md b/docs/index.md index 18d2825ce..1de26304e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -17,15 +17,27 @@ permalink: "/" ## What is SWIRL AI Connect? -SWIRL AI Connect is infrastructure software that connects most any Generative AI/LLM to enterprise data platforms, applications and information services *without copying*, indexing and/or ingesting data. +SWIRL AI Connect is an AI-powered [metasearch engine](https://en.wikipedia.org/wiki/Metasearch_engine) engine that connects most any Generative AI/LLM to enterprise data platforms, applications and information services *without copying*, ingesting data and/or indexing *anything*. -Installed in your own environment, or optionally hosted by SWIRL, our no-code, no-copying approach requires minimal IT involvement, generating personalized, AI insight from existing systems and applications. +SWIRL is installed in your own environment - anywhere Docker/Kubernetes runs. Configure it in minutes by filling out forms and users can be generating personalized, secure AI insights from the information they're already authorized to see - in minutes, without developers, signing a complicated legal agreement, or executing a complex data transfer / ETL project. -## How does SWIRL AI Connect Provide Insight without Copying and Ingesting and Indexing Data? +![SWIRL RAG AI Insight with results](images/swirl_40_community_rag.png) -SWIRL AI Connect is an AI-powered [metasearch engine](https://en.wikipedia.org/wiki/Metasearch_engine) that sends user requests to all the endpoints, APIs and other interfaces they're authorized to see - asynchronously, in a few seconds. SWIRL's unique Reader LLM re-ranks results from responding sources so the user doesn't have to. The Reader LLM can use the embeddings from most any model. +## What is SWIRL AI Co-Pilot? + +SWIRL AI Co-Pilot is an AI-powered Search Assistant that converses with users to determine what they are looking for and where they are most likely to find it. It can run searches on the user's behalf and provide in-line RAG results whenever the conversation demands. + +SWIRL 4.0 can write queries in SQL, Sparql and other dialects. Any knowledge available to the model can be used for this purpose. + +![SWIRL RAG AI Insight with results](images/swirl_40_enterprise_assistant_rag.png) + +## How does SWIRL Provide Insight without Copying and Ingesting and Indexing Data? + +SWIRL AI Connect sends user queries to the configured, specific endpoints - APIs and other interfaces they're authorized to see - asynchronously. The response time will be driven by the slowest responding source. -The re-ranking process is roughly the following: +SWIRL then re-ranks the results from responding sources so the user doesn't have to, using embeddings from the configured LLM. + +The re-ranking process is as follows: * Vectorize the user's query (or parts of it) * Send the text of the user's query and/or the vector, to each source requested (or default) * Asynchronously gather the results from each source @@ -33,7 +45,7 @@ The re-ranking process is roughly the following: * Vectorize each result snippet (or parts of it) * Re-rank the results by aggregating the similarity, frequency and position, and adjusting for other factors like length variation, freshness, etc -The [Xethub study](https://xethub.com/blog/you-dont-need-a-vector-database) as [explained by Simson Garfinkel](https://www.linkedin.com/pulse/vector-databases-rag-simson-garfinkel-hzule/) showed that re-ranking so-called "naive" search engines like those that use the BM25 algorithm for retrieval, outperforms moving the data into a vector database for many common NLP tasks such as question answering. +The [Xethub study](https://xethub.com/blog/you-dont-need-a-vector-database) as [explained by Simson Garfinkel](https://www.linkedin.com/pulse/vector-databases-rag-simson-garfinkel-hzule/) showed that re-ranking "naive" keyword search engines outperforms re-indexing the data using a vector database for tasks like question answering. SWIRL AI Connect also includes state-of-the-art cross-silo [Retrieval Augmented Generation (RAG)](https://en.wikipedia.org/wiki/Retrieval-augmented_generation) for generating AI insights like summarization, question answering and visualization of relevant result sets. @@ -52,46 +64,29 @@ When a user requests an AI insight, SWIRL: SWIRL AI Connect includes the Galaxy UI, but includes fully Swagger'd APIs and is easy to integrate with most any front-end or system. -SWIRL AI Connect ENTERPRISE includes flexible, generic OAUTH2 and SSO, with auto-provisioning via OpenID Connect. - -## What do SWIRL AI Connect insights look like? +SWIRL AI Connect, Enterprise Edition, includes flexible, generic OAUTH2 and SSO, with auto-provisioning via OpenID Connect. -Here is an example: +## How does SWIRL AI Co-Pilot work? -![SWIRL RAG AI Insight with results](images/swirl_rag_pulmonary_3.png) +SWIRL AI Co-Pilot educates the configured GAI/LLM about the user and what they have access to via the integration with SWIRL AI Connect. -For more information please refer to the [AI Connect Guide](AI-Connect.html). +SWIRL manages the context and history for each chat, initiating RAG through AI Connect as directed by the user and Co-Pilot. The user can only see insight from data they are already authorized to see, and the Co-Pilot is privy only to each user's conversations and history when conversing with them. All access is controlled and provisioned via the existing sign on (SSO) system. -## What systems can SWIRL AI Connect integrate with? +For more information please refer to the [AI Co-Pilot Guide](AI-Co-Pilot.html). +## What systems can SWIRL integrate with? The full list is here: [https://swirlaiconnect.com/connectors](https://swirlaiconnect.com/connectors) -## How do I connect SWIRL AI Connect to some new source? +## How do I connect SWIRL to some new source? To connect SWIRL with an internal data source, you [create a SearchProvider record](./SP-Guide.html#using-searchproviders). To integrate SWIRL Enterprise with a generative AI, you create an AIProvider record, as described [in the AI Connect Guide](AI-Connect.html#connecting-to-generative-ai-gai-and-large-language-models-llms). -## What is SWIRL AI Co-Pilot? - -SWIRL AI Co-Pilot turns any sufficiently capable Generative AI/LLM into an AI assistant that converses with users to determine what they are looking for and where they are most likely to find it. The Co-Pilot can search on the user's behalf and provide in-line RAG results whenever the conversation demands it. - -## How does SWIRL AI Co-Pilot work? - -SWIRL AI Co-Pilot educates the designated GAI/LLM about the user and what they have access to via the integration with AI Connect. SWIRL manages the context and history for each chat, initiating RAG through AI Connect as directed by the user and Co-Pilot. The user can only see insight from data they are already authorized to see, and the Co-Pilot is privy only to each user's conversations and history when conversing with them. All access is controlled and provisioned via the existing sign on (SSO) system. - -## What does a conversation with your data via SWIRL AI Co-Pilot look like? - -Here is an example: - -![SWIRL Co-Pilot image](images/swirl_copilot_chat_rag.png) - -For more information please refer to the [AI Co-Pilot Guide](AI-Co-Pilot.html). - ## What is included in SWIRL Enterprise Products? -SWIRL AI Connect Enterprise includes: +SWIRL Enterprise Edition includes: * Configurable support for many enterprise AI providers (e.g. Anthropic and Cohere), including support for multiple GAI/LLMs in different roles - chat, query rewriting, direct answer, RAG and embeddings (for re-ranking/passage detection by the Reader LLM) @@ -103,7 +98,7 @@ SWIRL AI Connect Enterprise includes: * Configurable prompts, including role, user, group and on-the-fly selection -SWIRL AI Co-Pilot is only available in Enterprise edition, and is not open source. Co-Pilot requires SWIRL AI Connect. +* SWIRL AI Co-Pilot as noted above ## How much do SWIRL Enterprise Products cost? @@ -115,28 +110,31 @@ Use SWIRL AI Connect, Community Edition, if you have one or more repositories th Note that you may freely re-distribute solutions that incorporate SWIRL AI Connect, Community Edition, under the [Apache 2.0 License](https://github.com/swirlai/swirl-search/blob/main/LICENSE). -## When should I use SWIRL AI Connect, Enterprise Edition? +## When should I use SWIRL Enterprise Edition? -Use the Enterprise Edition of SWIRL AI Connect when you have: +Use SWIRL Enterprise Edition when you have: * Repositories that require Single Sign On (SSO) and/or OAUTH2 * Content that requires text extraction, and/or authenticated page fetching * The need to RAG from long documents, complex tables, or text from images * Need to use GAI/LLMs other than OpenAI/Azure OpenAI +* Want to have a conversation with your data, via the Co-Pilot ## Why don't you use GitHub Issues? -We prefer to use [our free Slack channel](https://join.slack.com/t/swirlmetasearch/shared_invite/zt-2sfwvhwwg-mMn9tcKhAbqXbrV~9~Y1eA) for support. +We prefer to use [our free Slack channel](https://join.slack.com/t/swirlmetasearch/shared_invite/zt-2sfwvhwwg-mMn9tcKhAbqXbrV~9~Y1eA) for support. + +Enterprise customers get access to our helpdesk. ## What is the SWIRL Architecture & Technology Stack SWIRL products use the Python/Django/Celery/Redis stack, with PostgreSQL recommended for production deployments. -![SWIRL AI Connect Architecture diagram](images/swirl_arch_diagram.jpg) +Consult the [Developer Guide](./Developer-Guide.md#architecture) for more information! ## How is SWIRL usually deployed? -SWIRL is usually deployed via Docker. SWIRL Enterprise products are delivered as Kubernetes images. +SWIRL is usually deployed via Docker. SWIRL Enterprise products are also available as Kubernetes images. ## Does SWIRL offer hosting? How can I learn more?