Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
208 commits
Select commit Hold shift + click to select a range
046daf4
feat(docker): update searxng build script
ItzCrazyKns Oct 23, 2025
2e73661
Merge branch 'master' into canary
ItzCrazyKns Oct 27, 2025
1a8889c
feat(app): add new agents directory
ItzCrazyKns Nov 10, 2025
41fe009
feat(app): migrate suggestion chain
ItzCrazyKns Nov 13, 2025
5e1746f
Merge pull request #928 from ItzCrazyKns/master
ItzCrazyKns Nov 13, 2025
33b736e
feat(app): migrate image search chain
ItzCrazyKns Nov 13, 2025
e499c0b
feat(app): migrate video search chain
ItzCrazyKns Nov 13, 2025
3bcf646
feat(search-route): handle history processing after llm validation
ItzCrazyKns Nov 13, 2025
07a1792
feat(media-search): supply full history
ItzCrazyKns Nov 13, 2025
3d5d04e
Merge branch 'canary' into feat/improve-search-architecture
ItzCrazyKns Nov 13, 2025
bd5628b
feat(package): bump langchain package
ItzCrazyKns Nov 14, 2025
2edef88
Merge branch 'master' into canary
ItzCrazyKns Nov 14, 2025
1da9b76
Merge branch 'canary' into feat/improve-search-architecture
ItzCrazyKns Nov 14, 2025
a00f223
feat(chat-window): remove loading state
ItzCrazyKns Nov 14, 2025
f6dac43
feat(types): add message & chunk type
ItzCrazyKns Nov 17, 2025
657a577
feat(app): enhance UI
ItzCrazyKns Nov 18, 2025
5272c7f
feat(models): add new base classes
ItzCrazyKns Nov 18, 2025
4bcbdad
feat(providers): implement custom classes
ItzCrazyKns Nov 18, 2025
f44ad97
feat(types): add llm types
ItzCrazyKns Nov 18, 2025
c383079
feat(app): add new session manager
ItzCrazyKns Nov 20, 2025
3cc8882
feat(prompts): add classifier prompt
ItzCrazyKns Nov 20, 2025
afc68ca
feat(ollamaLLM): disable thinking in obj mode
ItzCrazyKns Nov 20, 2025
cbcb03c
feat(llm): update return type to partial
ItzCrazyKns Nov 20, 2025
8b51520
feat(app): add search types
ItzCrazyKns Nov 20, 2025
036b446
feat(search): add classifier
ItzCrazyKns Nov 20, 2025
1614cfa
feat(app): add widgets
ItzCrazyKns Nov 20, 2025
9b85c63
feat(db): migrate schema
ItzCrazyKns Nov 21, 2025
a494d4c
feat(app): fix migration errors
ItzCrazyKns Nov 21, 2025
2568088
feat(db): add new migration files
ItzCrazyKns Nov 21, 2025
70bcd8c
feat(types): add artifact to block, add more blocks
ItzCrazyKns Nov 21, 2025
f7a43b3
feat(session): use blocks, use rfc6902 for stream with patching
ItzCrazyKns Nov 21, 2025
4016b21
Update formatHistory.ts
ItzCrazyKns Nov 21, 2025
0df0114
feat(prompts): add researcher prompt
ItzCrazyKns Nov 21, 2025
08feb18
feat(search-agent): add researcher, research actions
ItzCrazyKns Nov 21, 2025
c4acc83
feat(agents): add search agent
ItzCrazyKns Nov 21, 2025
55cf888
feat(package): add modules
ItzCrazyKns Nov 21, 2025
9ac2da3
feat(app): remove old search agent
ItzCrazyKns Nov 22, 2025
8d04f63
Delete index.ts
ItzCrazyKns Nov 22, 2025
d6c364f
feat(models): remove old providers
ItzCrazyKns Nov 22, 2025
6d35d60
Remove unused output parsers and document utility
ItzCrazyKns Nov 23, 2025
d7dd17c
feat(app): fix type resolving issues
ItzCrazyKns Nov 23, 2025
74bc08d
Refactor types and imports for consistency
ItzCrazyKns Nov 23, 2025
0ac8569
feat(agents): update suggestion generator
ItzCrazyKns Nov 23, 2025
6da6acb
feat(agents): update media agents
ItzCrazyKns Nov 23, 2025
e22a39f
feat(routes): update routes to handle new llm types
ItzCrazyKns Nov 23, 2025
b7b2806
feat(providers): update ollama context window, temp
ItzCrazyKns Nov 23, 2025
d5f62f2
feat(chat): prevent auto-scroll unless message sent
ItzCrazyKns Nov 23, 2025
4e7143c
feat(app): add initial widgets
ItzCrazyKns Nov 23, 2025
7c9258c
feat(intents): update intent prompt
ItzCrazyKns Nov 23, 2025
730ee0f
feat(intents): add private search
ItzCrazyKns Nov 23, 2025
8dec689
feat(prompts): update classifier prompt
ItzCrazyKns Nov 23, 2025
f15802b
feat(prompts): update research prompt
ItzCrazyKns Nov 23, 2025
1b4e883
feat(prompts): add writer prompt
ItzCrazyKns Nov 23, 2025
ec06a2b
feat(researcher): use patching, streaming
ItzCrazyKns Nov 23, 2025
cba3f43
feat(search-agent): add search agent flow
ItzCrazyKns Nov 23, 2025
e0ba476
feat(optimization): enable quality
ItzCrazyKns Nov 23, 2025
956a768
feat(app): handle new architecture
ItzCrazyKns Nov 23, 2025
0a62c60
feat(widgets): add LLM context to prevent context overflow
ItzCrazyKns Nov 24, 2025
7544bba
feat(weather-widget): prevent [object Object] from being sent by stri…
ItzCrazyKns Nov 27, 2025
f83bd06
feat(ollama-llm): remove explicit think parameter setting
ItzCrazyKns Nov 27, 2025
e2a3719
feat(stock-widget): use names and ticker
ItzCrazyKns Nov 29, 2025
7757bbd
feat(ollama-llm): explicitly disable think for reasoning models
ItzCrazyKns Nov 29, 2025
610d06b
refac(llm): LLM option handling for per request overrides
ItzCrazyKns Dec 1, 2025
9b3833f
feat(classifier): switch to a fixed approach
ItzCrazyKns Dec 1, 2025
41c879c
feat(llm): use zod inferences at return type
ItzCrazyKns Dec 1, 2025
3e90305
Merge pull request #939 from ItzCrazyKns/master
ItzCrazyKns Dec 1, 2025
33c8f45
feat(weather-widget): do not round temperature
ItzCrazyKns Dec 2, 2025
b8a7fb9
feat(classifier): add `showCalculationWidget`
ItzCrazyKns Dec 2, 2025
1ea348d
feat(classifier-prompt): update and add `showCalculationWidget`
ItzCrazyKns Dec 2, 2025
dbc2137
Revise writer prompt for warmer, conversational tone
ItzCrazyKns Dec 2, 2025
6899b49
Merge branch 'feat/improve-search-architecture' of https://github.com…
ItzCrazyKns Dec 2, 2025
046f159
feat(widgets): use new classifier, implement new widget executor, del…
ItzCrazyKns Dec 2, 2025
c35b684
feat(types): add ToolMessage, Message
ItzCrazyKns Dec 5, 2025
ee5d917
feat(models): add tool, tool call
ItzCrazyKns Dec 5, 2025
1c0e90c
feat(ollama-llm): implement function calling
ItzCrazyKns Dec 5, 2025
2c61f47
feat(openai-llm): implement function calling
ItzCrazyKns Dec 5, 2025
a548fd6
feat(utils): compute cosine similarity, remove package
ItzCrazyKns Dec 5, 2025
4fc810d
feat(calculation-widget): enhance UI
ItzCrazyKns Dec 5, 2025
65ef299
feat(settings): display app version, link
ItzCrazyKns Dec 6, 2025
f2f2af9
feat(message-input): hide content after input
ItzCrazyKns Dec 6, 2025
574b3d5
feat(types): separate user, assistant & system message
ItzCrazyKns Dec 6, 2025
e99c8bd
feat(models-types): update to use `Message`
ItzCrazyKns Dec 6, 2025
3c524b0
feat(openai-llm): process assistant message with tool calls
ItzCrazyKns Dec 6, 2025
4c4c1d1
feat(ollama-llm): process ollama messages with tool calls
ItzCrazyKns Dec 6, 2025
5e30017
feat(search-types0: add reasoning action
ItzCrazyKns Dec 6, 2025
8ab675b
feat(action-registry): use tool types, add tool methods
ItzCrazyKns Dec 6, 2025
97838fd
feat(actions): add plan, update done & web search
ItzCrazyKns Dec 6, 2025
2d82cd6
feat(registry): register plan action
ItzCrazyKns Dec 6, 2025
9afea48
feat(search-agent): use function calling
ItzCrazyKns Dec 6, 2025
a14f3e9
feat(prompts): update researcher prompt
ItzCrazyKns Dec 6, 2025
d0124b9
feat(actions): add scrape URL action
ItzCrazyKns Dec 6, 2025
1c3a5fe
feat(actions): limit urls & queries to 3
ItzCrazyKns Dec 7, 2025
5174820
feat(package): bump next version
ItzCrazyKns Dec 7, 2025
e329820
feat(package): update lucide-react, framer-motion
ItzCrazyKns Dec 8, 2025
d0e71e6
feat(types): add search_results research block
ItzCrazyKns Dec 8, 2025
331387e
feat(search): add better context handling
ItzCrazyKns Dec 8, 2025
96001a9
feat(assistant-steps): handle reading, search_results
ItzCrazyKns Dec 8, 2025
85f6c3b
feat(client-registry): add `getMeasurementUnit`
ItzCrazyKns Dec 8, 2025
2df6250
feat(weather): respect unit preference
ItzCrazyKns Dec 8, 2025
8aed951
feat(researcher): pass research block id
ItzCrazyKns Dec 8, 2025
6016090
feat(actions): stream results internally
ItzCrazyKns Dec 8, 2025
3bffc72
feat(types): update research action type
ItzCrazyKns Dec 9, 2025
01b537a
feat(actions): add tool description, description
ItzCrazyKns Dec 9, 2025
fc0c444
feat(researcher-prompt): add mode based prompts
ItzCrazyKns Dec 9, 2025
0cfa014
Create fileSearch.ts
ItzCrazyKns Dec 12, 2025
13ae0b9
feat(package): remove langchain, other unused packages
ItzCrazyKns Dec 13, 2025
ff4cf98
feat(media-search): fix type errors
ItzCrazyKns Dec 13, 2025
8d1b04e
feat(search-agent): use `index + 1` to fix zero errors
ItzCrazyKns Dec 13, 2025
0b9e193
feat(actions): rename plan to reasoning
ItzCrazyKns Dec 13, 2025
0688630
feat(actions): update web search action to use reasoning
ItzCrazyKns Dec 13, 2025
c7c327a
feat(utils): add token based text splitting
ItzCrazyKns Dec 13, 2025
6473e51
feat(uploads): add uploads manager
ItzCrazyKns Dec 13, 2025
aeb90cb
feat(uploads): add uploads store with reciprocal rerank fusion
ItzCrazyKns Dec 13, 2025
86ea3cd
feat(types): add upload research blocks
ItzCrazyKns Dec 13, 2025
fd74557
feat(writer-prompt): revert to old prompt to fix length issues
ItzCrazyKns Dec 13, 2025
56e47d6
feat(ollama-llm): use hash to generate id
ItzCrazyKns Dec 13, 2025
3949748
feat(suggestions-agent): fix type errors
ItzCrazyKns Dec 13, 2025
40b25a4
feat(uploads): update to use new manager
ItzCrazyKns Dec 13, 2025
8d471ac
feat(registry): update to send fileIds
ItzCrazyKns Dec 13, 2025
1f3bf8d
feat(researcher): use reasoning
ItzCrazyKns Dec 13, 2025
748ee4d
feat(actions): add uploads search action
ItzCrazyKns Dec 13, 2025
a6ff94d
feat(api): update to use fileIds
ItzCrazyKns Dec 13, 2025
6067595
feat(researcher-prompt): add user uploaded files
ItzCrazyKns Dec 13, 2025
a99702d
feat(app): update UI to handle uploads
ItzCrazyKns Dec 13, 2025
3d1d164
feat(app): lint & beautify
ItzCrazyKns Dec 13, 2025
ca4809f
Update manager.ts
ItzCrazyKns Dec 14, 2025
a3065d5
feat(package): add motion, react tooltip, phosphor icons
ItzCrazyKns Dec 15, 2025
b90b920
feat(chat-route): accept sources
ItzCrazyKns Dec 15, 2025
e6c8a0a
Add antialiased class to body element
ItzCrazyKns Dec 15, 2025
bd3c5f8
feat(message-input-actions): remove copilot, focus selector
ItzCrazyKns Dec 15, 2025
9dd670f
feat(chat-hook): handle sources
ItzCrazyKns Dec 15, 2025
f9cc97f
feat(message-input-actions): add sources
ItzCrazyKns Dec 15, 2025
4bdb90e
feat(message-input-actions): update to use motion, improve animations
ItzCrazyKns Dec 15, 2025
9b2c229
feat(message-input): remove copilot toggle
ItzCrazyKns Dec 15, 2025
249889f
feat(actions-registry): add sources, update web search to become acti…
ItzCrazyKns Dec 15, 2025
1961e4e
feat(empty-chat-message-input): use sources
ItzCrazyKns Dec 15, 2025
6e08695
feat(agents): add academic and social search
ItzCrazyKns Dec 17, 2025
4911368
feat(app): lint & beautify
ItzCrazyKns Dec 17, 2025
473a04b
feat(suggestions): prevent icon from shrinking
ItzCrazyKns Dec 18, 2025
5511a27
Update Sources.tsx
ItzCrazyKns Dec 18, 2025
ac183a9
feat(academic-search): add academic search
ItzCrazyKns Dec 18, 2025
604774e
feat(social-search): add social search
ItzCrazyKns Dec 18, 2025
64683e3
feat(assistant-steps): improve style
ItzCrazyKns Dec 19, 2025
a82b605
feat(citation): move to message renderer
ItzCrazyKns Dec 19, 2025
21cb0f5
feat(app): add syntax highlighter
ItzCrazyKns Dec 19, 2025
fdee29c
feat(renderers): add code block
ItzCrazyKns Dec 19, 2025
6e2345b
feat(message-box): update `markdown2jsx` overrides to render codeblock
ItzCrazyKns Dec 19, 2025
8527349
feat(copy): fix type mismatch
ItzCrazyKns Dec 19, 2025
300cfa3
Update Optimization.tsx
ItzCrazyKns Dec 19, 2025
94a24d4
feat(message-input): add overflow to prevent blocked popovers
ItzCrazyKns Dec 21, 2025
13d6bcf
Update Optimization.tsx
ItzCrazyKns Dec 22, 2025
68a9e04
feat(schema): change focusMode to sources
ItzCrazyKns Dec 23, 2025
216332f
feat(session): add subscribe method, getAllBlocks
ItzCrazyKns Dec 23, 2025
8ba64be
feat(session): fix sessions getting disregarded due to reload
ItzCrazyKns Dec 23, 2025
0e176e0
feat(chat-route): add history saving, disconnect on abort, use subscr…
ItzCrazyKns Dec 23, 2025
f278eb8
feat(routes): add reconnect route
ItzCrazyKns Dec 23, 2025
a6d4f47
feat(search-agent): save history
ItzCrazyKns Dec 23, 2025
8520ea6
feat(researcher): emit sources as block
ItzCrazyKns Dec 23, 2025
5847379
Update types.ts
ItzCrazyKns Dec 23, 2025
5f04034
feat(chat-hook): handle reconnect
ItzCrazyKns Dec 23, 2025
c3b74a3
feat(assistant-steps): only open last comp
ItzCrazyKns Dec 23, 2025
2c65bd9
feat(chat-hook): set ready before reconnecting
ItzCrazyKns Dec 23, 2025
b706434
feat(chat-window): display only when ready
ItzCrazyKns Dec 23, 2025
ea18c13
feat(app): remove uploads
ItzCrazyKns Dec 23, 2025
b47f522
feat(app): update guide for run command
ItzCrazyKns Dec 23, 2025
24c32ed
feat(app): enhance attach transition
ItzCrazyKns Dec 23, 2025
cf95ea0
feat(app): lint & beautify
ItzCrazyKns Dec 23, 2025
eca66f0
feat(writer): add system instructions, send response block on response
ItzCrazyKns Dec 24, 2025
53697bb
feat(classifier-prompt): add calculation widget
ItzCrazyKns Dec 24, 2025
dc74e71
feat(researcher): rename `0_reasoning` to `__reasoning_preamble` to c…
ItzCrazyKns Dec 24, 2025
6ae885e
feat(steps): display after loading animation
ItzCrazyKns Dec 24, 2025
d4c276a
Update types.ts
ItzCrazyKns Dec 24, 2025
c4349f3
feat(providers): add gemini
ItzCrazyKns Dec 24, 2025
9ce17ed
feat(providers): add groq
ItzCrazyKns Dec 24, 2025
86a4308
feat(providers): add transformers
ItzCrazyKns Dec 24, 2025
d40fcd5
feat(ollama): add nemotron to thinking list
ItzCrazyKns Dec 24, 2025
fe2c1b8
feat(providers): update index map
ItzCrazyKns Dec 24, 2025
e1afcbb
feat(package): add google genai & bump transformers
ItzCrazyKns Dec 24, 2025
a2f2e17
feat(providers): add lemonade
ItzCrazyKns Dec 24, 2025
0a9641a
feat(providers): add anthropic
ItzCrazyKns Dec 24, 2025
4521803
feat(library): enhance ui & ux
ItzCrazyKns Dec 24, 2025
f5e054f
feat(chat): fix hidden input
ItzCrazyKns Dec 24, 2025
60dd7a8
feat(ui): fix theming issues
ItzCrazyKns Dec 24, 2025
ae132eb
feat(app): lint & beautify
ItzCrazyKns Dec 25, 2025
edba47a
feat(db): add migration scripts
ItzCrazyKns Dec 26, 2025
a31a4ab
feat(agents): add api search agent
ItzCrazyKns Dec 27, 2025
50ca7ac
feat(api): update search api & related documentation
ItzCrazyKns Dec 27, 2025
cc183cd
feat(readme): update features & upcoming features
ItzCrazyKns Dec 27, 2025
5a44319
feat(guides): update contributing guides
ItzCrazyKns Dec 27, 2025
65fdecb
feat(docs): update architecture docs
ItzCrazyKns Dec 27, 2025
b5ba8c4
Update src/components/WeatherWidget.tsx
ItzCrazyKns Dec 27, 2025
6919ad1
feat(app): address review
ItzCrazyKns Dec 27, 2025
0ace778
Merge branch 'feat/improve-search-architecture' of https://github.com…
ItzCrazyKns Dec 27, 2025
ec5ff6f
Update plan.ts
ItzCrazyKns Dec 27, 2025
9620e63
Update src/components/MessageActions/Copy.tsx
ItzCrazyKns Dec 27, 2025
7f3f881
Update src/components/Navbar.tsx
ItzCrazyKns Dec 27, 2025
53e39cd
Merge pull request #950 from ItzCrazyKns/feat/improve-search-architec…
ItzCrazyKns Dec 27, 2025
53e9859
Update README.md
ItzCrazyKns Dec 27, 2025
c9f6893
feat(pdf-parse): fix DOMMatrix issues
ItzCrazyKns Dec 27, 2025
19dde42
feat(app): fix build errors, use webpack
ItzCrazyKns Dec 27, 2025
fdef718
feat(transformer-provider): specify dtype
ItzCrazyKns Dec 27, 2025
d872cf5
feat(chat-hook): prevent duplicate blocks
ItzCrazyKns Dec 27, 2025
f1c9fa0
feat(package): bump version
ItzCrazyKns Dec 27, 2025
a691f3b
feat(chat-hook): fix history saving delay (async state), add delay be…
ItzCrazyKns Dec 27, 2025
be7bd62
feat(prompts): update media
ItzCrazyKns Dec 27, 2025
bb7b717
feat(media, suggestions): handle chat history correctly
ItzCrazyKns Dec 27, 2025
d1bd227
Update package.json
ItzCrazyKns Dec 27, 2025
0987ee4
Update next.config.mjs
ItzCrazyKns Dec 27, 2025
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
62 changes: 46 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,63 @@ Perplexica's codebase is organized as follows:
- **UI Components and Pages**:
- **Components (`src/components`)**: Reusable UI components.
- **Pages and Routes (`src/app`)**: Next.js app directory structure with page components.
- Main app routes include: home (`/`), chat (`/c`), discover (`/discover`), library (`/library`), and settings (`/settings`).
- **API Routes (`src/app/api`)**: API endpoints implemented with Next.js API routes.
- `/api/chat`: Handles chat interactions.
- `/api/search`: Provides direct access to Perplexica's search capabilities.
- Other endpoints for models, files, and suggestions.
- Main app routes include: home (`/`), chat (`/c`), discover (`/discover`), and library (`/library`).
- **API Routes (`src/app/api`)**: Server endpoints implemented with Next.js route handlers.
- **Backend Logic (`src/lib`)**: Contains all the backend functionality including search, database, and API logic.
- The search functionality is present inside `src/lib/search` directory.
- All of the focus modes are implemented using the Meta Search Agent class in `src/lib/search/metaSearchAgent.ts`.
- The search system lives in `src/lib/agents/search`.
- The search pipeline is split into classification, research, widgets, and writing.
- Database functionality is in `src/lib/db`.
- Chat model and embedding model providers are managed in `src/lib/providers`.
- Prompt templates and LLM chain definitions are in `src/lib/prompts` and `src/lib/chains` respectively.
- Chat model and embedding model providers are in `src/lib/models/providers`, and models are loaded via `src/lib/models/registry.ts`.
- Prompt templates are in `src/lib/prompts`.
- SearXNG integration is in `src/lib/searxng.ts`.
- Upload search lives in `src/lib/uploads`.

### Where to make changes

If you are not sure where to start, use this section as a map.

- **Search behavior and reasoning**

- `src/lib/agents/search` contains the core chat and search pipeline.
- `classifier.ts` decides whether research is needed and what should run.
- `researcher/` gathers information in the background.

- **Add or change a search capability**

- Research tools (web, academic, discussions, uploads, scraping) live in `src/lib/agents/search/researcher/actions`.
- Tools are registered in `src/lib/agents/search/researcher/actions/index.ts`.

- **Add or change widgets**

- Widgets live in `src/lib/agents/search/widgets`.
- Widgets run in parallel with research and show structured results in the UI.

- **Model integrations**

- Providers live in `src/lib/models/providers`.
- Add new providers there and wire them into the model registry so they show up in the app.

- **Architecture docs**
- High level overview: `docs/architecture/README.md`
- High level flow: `docs/architecture/WORKING.md`

## API Documentation

Perplexica exposes several API endpoints for programmatic access, including:
Perplexica includes API documentation for programmatic access.

- **Search API**: Access Perplexica's advanced search capabilities directly via the `/api/search` endpoint. For detailed documentation, see `docs/api/search.md`.
- **Search API**: For detailed documentation, see `docs/API/SEARCH.md`.

## Setting Up Your Environment

Before diving into coding, setting up your local environment is key. Here's what you need to do:

1. In the root directory, locate the `sample.config.toml` file.
2. Rename it to `config.toml` and fill in the necessary configuration fields.
3. Run `npm install` to install all dependencies.
4. Run `npm run db:migrate` to set up the local sqlite database.
5. Use `npm run dev` to start the application in development mode.
1. Run `npm install` to install all dependencies.
2. Use `npm run dev` to start the application in development mode.
3. Open http://localhost:3000 and complete the setup in the UI (API keys, models, search backend URL, etc.).

Database migrations are applied automatically on startup.

For full installation options (Docker and non Docker), see the installation guide in the repository README.

**Please note**: Docker configurations are present for setting up production environments, whereas `npm run dev` is used for development purposes.

Expand Down
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ Want to know more about its architecture and how it works? You can read it [here

🤖 **Support for all major AI providers** - Use local LLMs through Ollama or connect to OpenAI, Anthropic Claude, Google Gemini, Groq, and more. Mix and match models based on your needs.

⚡ **Smart search modes** - Choose Balanced Mode for everyday searches, Fast Mode when you need quick answers, or wait for Quality Mode (coming soon) for deep research.
⚡ **Smart search modes** - Choose Speed Mode when you need quick answers, Balanced Mode for everyday searches, or Quality Mode for deep research.

🎯 **Six specialized focus modes** - Get better results with modes designed for specific tasks: Academic papers, YouTube videos, Reddit discussions, Wolfram Alpha calculations, writing assistance, or general web search.
🧭 **Pick your sources** - Search the web, discussions, or academic papers. More sources and integrations are in progress.

🧩 **Widgets** - Helpful UI cards that show up when relevant, like weather, calculations, stock prices, and other quick lookups.

🔍 **Web search powered by SearxNG** - Access multiple search engines while keeping your identity private. Support for Tavily and Exa coming soon for even better results.

Expand Down Expand Up @@ -81,7 +83,7 @@ There are mainly 2 ways of installing Perplexica - With Docker, Without Docker.
Perplexica can be easily run using Docker. Simply run the following command:

```bash
docker run -d -p 3000:3000 -v perplexica-data:/home/perplexica/data -v perplexica-uploads:/home/perplexica/uploads --name perplexica itzcrazykns1337/perplexica:latest
docker run -d -p 3000:3000 -v perplexica-data:/home/perplexica/data --name perplexica itzcrazykns1337/perplexica:latest
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Dec 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Documentation inconsistency: The note below this command still references "The -v flags" (plural) and "your data and uploaded files", but the uploads volume was removed. If uploads are now stored in the data directory, consider updating the note to say "The -v flag creates a persistent volume for your data" for consistency.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At README.md, line 86:

<comment>Documentation inconsistency: The note below this command still references &quot;The `-v` flags&quot; (plural) and &quot;your data and uploaded files&quot;, but the uploads volume was removed. If uploads are now stored in the data directory, consider updating the note to say &quot;The `-v` flag creates a persistent volume for your data&quot; for consistency.</comment>

<file context>
@@ -81,7 +83,7 @@ There are mainly 2 ways of installing Perplexica - With Docker, Without Docker.
 
 ```bash
-docker run -d -p 3000:3000 -v perplexica-data:/home/perplexica/data -v perplexica-uploads:/home/perplexica/uploads --name perplexica itzcrazykns1337/perplexica:latest
+docker run -d -p 3000:3000 -v perplexica-data:/home/perplexica/data --name perplexica itzcrazykns1337/perplexica:latest

</file context>


</details>

<a href="https://www.cubic.dev/action/fix/violation/af30a050-ef3c-408b-906c-eb50066fcd24" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://cubic.dev/buttons/fix-with-cubic-dark.svg">
    <source media="(prefers-color-scheme: light)" srcset="https://cubic.dev/buttons/fix-with-cubic-light.svg">
    <img alt="Fix with Cubic" src="https://cubic.dev/buttons/fix-with-cubic-dark.svg">
  </picture>
</a>

```

This will pull and start the Perplexica container with the bundled SearxNG search engine. Once running, open your browser and navigate to http://localhost:3000. You can then configure your settings (API keys, models, etc.) directly in the setup screen.
Expand All @@ -93,7 +95,7 @@ This will pull and start the Perplexica container with the bundled SearxNG searc
If you already have SearxNG running, you can use the slim version of Perplexica:

```bash
docker run -d -p 3000:3000 -e SEARXNG_API_URL=http://your-searxng-url:8080 -v perplexica-data:/home/perplexica/data -v perplexica-uploads:/home/perplexica/uploads --name perplexica itzcrazykns1337/perplexica:slim-latest
docker run -d -p 3000:3000 -e SEARXNG_API_URL=http://your-searxng-url:8080 -v perplexica-data:/home/perplexica/data --name perplexica itzcrazykns1337/perplexica:slim-latest
```

**Important**: Make sure your SearxNG instance has:
Expand All @@ -120,7 +122,7 @@ If you prefer to build from source or need more control:

```bash
docker build -t perplexica .
docker run -d -p 3000:3000 -v perplexica-data:/home/perplexica/data -v perplexica-uploads:/home/perplexica/uploads --name perplexica perplexica
docker run -d -p 3000:3000 -v perplexica-data:/home/perplexica/data --name perplexica perplexica
```

5. Access Perplexica at http://localhost:3000 and configure your settings in the setup screen.
Expand Down Expand Up @@ -237,13 +239,8 @@ Perplexica runs on Next.js and handles all API requests. It works right away on

## Upcoming Features

- [x] Add settings page
- [x] Adding support for local LLMs
- [x] History Saving features
- [x] Introducing various Focus Modes
- [x] Adding API support
- [x] Adding Discover
- [ ] Finalizing Copilot Mode
- [ ] Adding more widgets, integrations, search sources
- [ ] Adding authentication

## Support Us

Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
services:
perplexica:
image: itzcrazykns1337/perplexica:latest
build:
context: .
ports:
- '3000:3000'
volumes:
Expand Down
25 changes: 13 additions & 12 deletions docs/API/SEARCH.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Use the `id` field as the `providerId` and the `key` field from the models array

### Request

The API accepts a JSON object in the request body, where you define the focus mode, chat models, embedding models, and your query.
The API accepts a JSON object in the request body, where you define the enabled search `sources`, chat models, embedding models, and your query.

#### Request Body Structure

Expand All @@ -72,7 +72,7 @@ The API accepts a JSON object in the request body, where you define the focus mo
"key": "text-embedding-3-large"
},
"optimizationMode": "speed",
"focusMode": "webSearch",
"sources": ["web"],
"query": "What is Perplexica",
"history": [
["human", "Hi, how are you?"],
Expand All @@ -87,24 +87,25 @@ The API accepts a JSON object in the request body, where you define the focus mo

### Request Parameters

- **`chatModel`** (object, optional): Defines the chat model to be used for the query. To get available providers and models, send a GET request to `http://localhost:3000/api/providers`.
- **`chatModel`** (object, required): Defines the chat model to be used for the query. To get available providers and models, send a GET request to `http://localhost:3000/api/providers`.

- `providerId` (string): The UUID of the provider. You can get this from the `/api/providers` endpoint response.
- `key` (string): The model key/identifier (e.g., `gpt-4o-mini`, `llama3.1:latest`). Use the `key` value from the provider's `chatModels` array, not the display name.

- **`embeddingModel`** (object, optional): Defines the embedding model for similarity-based searching. To get available providers and models, send a GET request to `http://localhost:3000/api/providers`.
- **`embeddingModel`** (object, required): Defines the embedding model for similarity-based searching. To get available providers and models, send a GET request to `http://localhost:3000/api/providers`.

- `providerId` (string): The UUID of the embedding provider. You can get this from the `/api/providers` endpoint response.
- `key` (string): The embedding model key (e.g., `text-embedding-3-large`, `nomic-embed-text`). Use the `key` value from the provider's `embeddingModels` array, not the display name.

- **`focusMode`** (string, required): Specifies which focus mode to use. Available modes:
- **`sources`** (array, required): Which search sources to enable. Available values:

- `webSearch`, `academicSearch`, `writingAssistant`, `wolframAlphaSearch`, `youtubeSearch`, `redditSearch`.
- `web`, `academic`, `discussions`.

- **`optimizationMode`** (string, optional): Specifies the optimization mode to control the balance between performance and quality. Available modes:

- `speed`: Prioritize speed and return the fastest answer.
- `balanced`: Provide a balanced answer with good speed and reasonable quality.
- `quality`: Prioritize answer quality (may be slower).

- **`query`** (string, required): The search query or question.

Expand Down Expand Up @@ -132,14 +133,14 @@ The response from the API includes both the final message and the sources used t
"message": "Perplexica is an innovative, open-source AI-powered search engine designed to enhance the way users search for information online. Here are some key features and characteristics of Perplexica:\n\n- **AI-Powered Technology**: It utilizes advanced machine learning algorithms to not only retrieve information but also to understand the context and intent behind user queries, providing more relevant results [1][5].\n\n- **Open-Source**: Being open-source, Perplexica offers flexibility and transparency, allowing users to explore its functionalities without the constraints of proprietary software [3][10].",
"sources": [
{
"pageContent": "Perplexica is an innovative, open-source AI-powered search engine designed to enhance the way users search for information online.",
"content": "Perplexica is an innovative, open-source AI-powered search engine designed to enhance the way users search for information online.",
"metadata": {
"title": "What is Perplexica, and how does it function as an AI-powered search ...",
"url": "https://askai.glarity.app/search/What-is-Perplexica--and-how-does-it-function-as-an-AI-powered-search-engine"
}
},
{
"pageContent": "Perplexica is an open-source AI-powered search tool that dives deep into the internet to find precise answers.",
"content": "Perplexica is an open-source AI-powered search tool that dives deep into the internet to find precise answers.",
"metadata": {
"title": "Sahar Mor's Post",
"url": "https://www.linkedin.com/posts/sahar-mor_a-new-open-source-project-called-perplexica-activity-7204489745668694016-ncja"
Expand All @@ -158,7 +159,7 @@ Example of streamed response objects:

```
{"type":"init","data":"Stream connected"}
{"type":"sources","data":[{"pageContent":"...","metadata":{"title":"...","url":"..."}},...]}
{"type":"sources","data":[{"content":"...","metadata":{"title":"...","url":"..."}},...]}
{"type":"response","data":"Perplexica is an "}
{"type":"response","data":"innovative, open-source "}
{"type":"response","data":"AI-powered search engine..."}
Expand All @@ -174,9 +175,9 @@ Clients should process each line as a separate JSON object. The different messag

### Fields in the Response

- **`message`** (string): The search result, generated based on the query and focus mode.
- **`message`** (string): The search result, generated based on the query and enabled `sources`.
- **`sources`** (array): A list of sources that were used to generate the search result. Each source includes:
- `pageContent`: A snippet of the relevant content from the source.
- `content`: A snippet of the relevant content from the source.
- `metadata`: Metadata about the source, including:
- `title`: The title of the webpage.
- `url`: The URL of the webpage.
Expand All @@ -185,5 +186,5 @@ Clients should process each line as a separate JSON object. The different messag

If an error occurs during the search process, the API will return an appropriate error message with an HTTP status code.

- **400**: If the request is malformed or missing required fields (e.g., no focus mode or query).
- **400**: If the request is malformed or missing required fields (e.g., no `sources` or `query`).
- **500**: If an internal server error occurs during the search.
43 changes: 35 additions & 8 deletions docs/architecture/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,38 @@
# Perplexica's Architecture
# Perplexica Architecture

Perplexica's architecture consists of the following key components:
Perplexica is a Next.js application that combines an AI chat experience with search.

1. **User Interface**: A web-based interface that allows users to interact with Perplexica for searching images, videos, and much more.
2. **Agent/Chains**: These components predict Perplexica's next actions, understand user queries, and decide whether a web search is necessary.
3. **SearXNG**: A metadata search engine used by Perplexica to search the web for sources.
4. **LLMs (Large Language Models)**: Utilized by agents and chains for tasks like understanding content, writing responses, and citing sources. Examples include Claude, GPTs, etc.
5. **Embedding Models**: To improve the accuracy of search results, embedding models re-rank the results using similarity search algorithms such as cosine similarity and dot product distance.
For a high level flow, see [WORKING.md](WORKING.md). For deeper implementation details, see [CONTRIBUTING.md](../../CONTRIBUTING.md).

For a more detailed explanation of how these components work together, see [WORKING.md](https://github.com/ItzCrazyKns/Perplexica/tree/master/docs/architecture/WORKING.md).
## Key components

1. **User Interface**

- A web based UI that lets users chat, search, and view citations.

2. **API Routes**

- `POST /api/chat` powers the chat UI.
- `POST /api/search` provides a programmatic search endpoint.
- `GET /api/providers` lists available providers and model keys.

3. **Agents and Orchestration**

- The system classifies the question first.
- It can run research and widgets in parallel.
- It generates the final answer and includes citations.

4. **Search Backend**

- A meta search backend is used to fetch relevant web results when research is enabled.

5. **LLMs (Large Language Models)**

- Used for classification, writing answers, and producing citations.

6. **Embedding Models**

- Used for semantic search over user uploaded files.

7. **Storage**
- Chats and messages are stored so conversations can be reloaded.
Loading