diff --git a/content/docs/user_guides/ai_overview.mdx b/content/docs/user_guides/ai_overview.mdx index 3106f26a0..823d4e372 100644 --- a/content/docs/user_guides/ai_overview.mdx +++ b/content/docs/user_guides/ai_overview.mdx @@ -27,3 +27,15 @@ LibreChat allows you to configure and integrate various AI providers, APIs, and 4. **Set Default Endpoint and Preset**: Specify a default endpoint and preset to streamline the process of starting new conversations. Here's a video to demonstrate: **[Setting a Default Preset](https://github.com/danny-avila/LibreChat/assets/110412045/bbde830f-18d9-4884-88e5-1bd8f7ac585d)** 5. **Customize Configurations**: Explore advanced configuration options, such as adding custom endpoints like Ollama, Mistral AI or Openrouter. + +## Searching + +LibreChat has separate search features for the web, your files, and your conversations: + +- **Search the web**: Let the AI look up current information. In a regular chat, open the **+** palette in the [message composer](/docs/features/composer) and select **Web Search**. For an agent, enable the **Web Search** capability in the Agent Builder instead. Web search needs both a search provider and a scraper, configured by your admin or with your own API keys when prompted. See [Web Search](/docs/features/web_search). + +- **Search your files**: Ask questions about documents you upload. In a regular chat, select **File Search** from the **+** palette. For an agent, enable the **File Search** capability in the Agent Builder. File Search finds passages by meaning using the RAG API, which your admin deploys. See [RAG API (Chat with Files)](/docs/features/rag_api). + +- **Search your conversations**: Use the search box in the sidebar to find past messages. It appears only when the admin has enabled Meilisearch. See [Message Search](/docs/features/search). + +Web Search and File Search are optional. They show up only when your deployment enables them, which includes turning on the `web_search` or `file_search` agent capability and giving your role the matching permission. If one is missing, ask your admin, or see [Web Search option is not visible](/docs/features/web_search#web-search-option-is-not-visible) and the [`fileSearch` interface setting](/docs/configuration/librechat_yaml/object_structure/interface#filesearch). diff --git a/e2e/ai-overview-search-verify.spec.ts b/e2e/ai-overview-search-verify.spec.ts new file mode 100644 index 000000000..446593d25 --- /dev/null +++ b/e2e/ai-overview-search-verify.spec.ts @@ -0,0 +1,86 @@ +import { test, expect } from '@playwright/test' + +const PAGE = '/docs/user_guides/ai_overview' + +test.describe('AI Overview search guidance', () => { + test('@scenario:ai-overview-web-search-explained web search names the composer, agents and both required services', async ({ + page, + }) => { + await page.goto(PAGE) + const main = page.locator('main') + const heading = main.locator('h2[id="searching"]') + await expect(heading).toBeVisible() + await expect(heading).toHaveText('Searching') + await expect(main).toContainText('open the + palette in the message composer') + await expect(main).toContainText('enable the Web Search capability in the Agent Builder') + await expect(main).toContainText('needs both a search provider and a scraper') + }) + + test('@scenario:ai-overview-search-links-resolve the composer, missing-option and message search links reach their targets', async ({ + page, + }) => { + await page.goto(PAGE) + const composer = page + .locator('main') + .getByRole('link', { name: 'message composer', exact: true }) + await expect(composer).toHaveAttribute('href', /\/docs\/features\/composer$/) + + const missing = page + .locator('main') + .getByRole('link', { name: 'Web Search option is not visible', exact: true }) + await expect(missing).toHaveAttribute( + 'href', + /\/docs\/features\/web_search#web-search-option-is-not-visible$/, + ) + await missing.click() + await expect(page.locator('[id="web-search-option-is-not-visible"]')).toHaveCount(1) + + await page.goto(PAGE) + const messageSearch = page + .locator('main') + .getByRole('link', { name: 'Message Search', exact: true }) + await expect(messageSearch).toHaveAttribute('href', /\/docs\/features\/search$/) + await messageSearch.click() + await expect(page.getByRole('heading', { level: 1, name: 'Message Search' })).toBeVisible() + }) + + test('@scenario:ai-overview-file-search-explained file search names the composer, agents and the RAG API it relies on', async ({ + page, + }) => { + await page.goto(PAGE) + const main = page.locator('main') + await expect(main).toContainText('In a regular chat, select File Search from the + palette') + await expect(main).toContainText('enable the File Search capability in the Agent Builder') + await expect(main).toContainText('using the RAG API, which your admin deploys') + const rag = main.getByRole('link', { name: 'RAG API (Chat with Files)', exact: true }) + await expect(rag).toHaveAttribute('href', /\/docs\/features\/rag_api$/) + await rag.click() + await expect(page).toHaveURL(/\/docs\/features\/rag_api$/) + }) + + test('@scenario:ai-overview-missing-search-option-explained a reader missing Web Search or File Search learns the capability and role gates and where to look', async ({ + page, + }) => { + await page.goto(PAGE) + const main = page.locator('main') + await expect(main).toContainText( + 'which includes turning on the web_search or file_search agent capability and giving your role the matching permission', + ) + const setting = main.getByRole('link', { name: 'fileSearch interface setting', exact: true }) + await expect(setting).toHaveAttribute( + 'href', + /\/docs\/configuration\/librechat_yaml\/object_structure\/interface#filesearch$/, + ) + await setting.click() + await expect(page.locator('[id="filesearch"]')).toHaveCount(1) + }) + + test('@scenario:ai-overview-conversation-search-explained conversation search points to the sidebar and its Meilisearch condition', async ({ + page, + }) => { + await page.goto(PAGE) + const main = page.locator('main') + await expect(main).toContainText('Use the search box in the sidebar to find past messages') + await expect(main).toContainText('It appears only when the admin has enabled Meilisearch') + }) +})