docs: add Perplexica web search provider setup guide#525
docs: add Perplexica web search provider setup guide#525willtwilson wants to merge 2 commits intoLibreChat-AI:mainfrom
Conversation
Perplexica is an open-source AI-powered search engine (15k+ GitHub stars) that provides cited, context-aware answers. This adds a setup guide covering: - Docker Compose deployment with SearXNG backend - MCP integration via librechat.yaml - v1.12.1 API change: sources:["web"] replaces deprecated focusMode - NDJSON response parsing (updateBlock events) - Troubleshooting table Updates configuration/tools/meta.json to list Perplexica under Search. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@willtwilson is attempting to deploy a commit to the LibreChat's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
Adds a new documentation page describing how to use Perplexica as a web search backend for LibreChat (via MCP), and exposes it in the Tools sidebar under Search.
Changes:
- Adds a Perplexica setup guide (Docker Compose, MCP config, API notes, NDJSON parsing, troubleshooting).
- Adds
perplexicato the Tools → Search sidebar group.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| content/docs/configuration/tools/perplexica.mdx | New Perplexica integration/setup guide including API and NDJSON parsing notes |
| content/docs/configuration/tools/meta.json | Adds Perplexica to the Search section of the Tools docs sidebar |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| - ./searxng:/etc/searxng | ||
| ``` | ||
|
|
||
| After starting, visit the Perplexica settings UI (typically at `http://localhost:3000`) to configure your chat model and embedding model providers. |
There was a problem hiding this comment.
This guide points users to the Perplexica settings UI at http://localhost:3000, but the provided compose snippet only publishes port 3001:3001 (and defines only a backend service). Either add the missing frontend/UI service + port mapping, or update the URL/instructions so the documented UI address matches what is actually deployed.
| After starting, visit the Perplexica settings UI (typically at `http://localhost:3000`) to configure your chat model and embedding model providers. | |
| After starting, visit the Perplexica settings UI (typically at `http://localhost:3001`) to configure your chat model and embedding model providers. |
There was a problem hiding this comment.
Fixed in 0fbbfb6 — updated to port 3001 to match the backend-only compose snippet. Also added a note explaining that port 3000 is the Next.js frontend, which is a separate service not included in the minimal deployment snippet shown.
| const rawText = await response.text(); | ||
| const blockValues = new Map<string, string>(); | ||
|
|
||
| for (const line of rawText.split("\n")) { | ||
| const trimmed = line.trim(); |
There was a problem hiding this comment.
The docs say the NDJSON response is streamed and the answer is assembled incrementally, but this example uses await response.text() which buffers the entire response in memory and only then parses lines. Either update the description to reflect buffered parsing, or switch the example to reading from response.body (streaming) to match the stated behavior and avoid large-memory responses.
There was a problem hiding this comment.
Good observation — updated in 0fbbfb6. The description now accurately says the example buffers the full response before parsing, with a brief note that production-scale implementations may prefer streaming via response.body. The await response.text() approach is deliberately kept in the example for simplicity and readability.
| | Field | Description | | ||
| |-------|-------------| | ||
| | `message.content` | The search query | | ||
| | `chatModel` | LLM used to synthesize the answer | | ||
| | `embeddingModel` | Embedding model used for semantic ranking | |
There was a problem hiding this comment.
The request-body table markup uses leading double pipes (|| ... | ... |), which renders as an extra empty column in standard Markdown/MDX tables. Use single leading pipes (| Field | Description |) (and similarly for the separator and rows) so the table renders correctly.
There was a problem hiding this comment.
Fixed in 0fbbfb6 — double leading pipe removed from the request-body table.
| | Issue | Solution | | ||
| |-------|----------| | ||
| | `focusMode is not a valid field` | Upgrade to Perplexica v1.12.1+ and use `sources: ["web"]` | | ||
| | Empty response / no answer blocks | Verify SearXNG is running and reachable from the Perplexica container | |
There was a problem hiding this comment.
The troubleshooting table also uses leading double pipes (|| ... | ... |), which will render an extra empty column. Switch to standard Markdown table syntax with single leading pipes for the header/separator/rows.
There was a problem hiding this comment.
Fixed in 0fbbfb6 — same fix applied to the troubleshooting table.
| image: itzcrazykns1337/perplexica-backend:main | ||
| environment: | ||
| - SEARXNG_API_URL=http://searxng:8080 | ||
| - OPENAI_API_KEY=${OPENAI_API_KEY} | ||
| ports: | ||
| - "3001:3001" | ||
| depends_on: | ||
| - searxng | ||
|
|
||
| searxng: | ||
| image: searxng/searxng:latest |
There was a problem hiding this comment.
The Docker Compose example uses mutable image tags itzcrazykns1337/perplexica-backend:main and searxng/searxng:latest, which creates a supply-chain risk: future pulls may silently run altered or compromised images that have access to OPENAI_API_KEY and other data. An attacker who compromises or hijacks these tags could exfiltrate secrets or tamper with search results. Pin these images to specific versions or immutable digests so updates happen only when you explicitly review and change the reference.
There was a problem hiding this comment.
Added a warning callout in 0fbbfb6 flagging the supply-chain risk of mutable tags, particularly since both containers have access to API keys via environment variables. The note recommends pinning to specific version digests for production deployments. The mutable tags are kept in the example for readability but the risk is now clearly surfaced.
Address review feedback: - Correct port reference from 3000 to 3001 (backend API) - Add note clarifying buffered vs streaming NDJSON parsing - Add security warning about mutable Docker image tags Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Perplexica is an open-source AI-powered search engine with 15k+ GitHub stars that provides cited, context-aware answers by combining web search with LLM reasoning. LibreChat currently has no documentation for using Perplexica as a search backend, and it is a popular self-hosted alternative for users who prefer a fully open-source stack.
Changes
content/docs/configuration/tools/perplexica.mdx- New setup guide covering:librechat.yamlsources: [web]replaces the deprecatedfocusModeparametercontent/docs/configuration/tools/meta.json- Addsperplexicaentry under the Search section of the sidebarWhy this matters
Checklist