diff --git a/README.md b/README.md
index 9e94028..fc93244 100644
--- a/README.md
+++ b/README.md
@@ -41,9 +41,10 @@ Want to know more about its architecture and how it works? You can read it [here
- **Two Main Modes:**
- **Copilot Mode:** (In development) Boosts search by generating different queries to find more relevant internet sources. Like normal search instead of just using the context by SearxNG, it visits the top matches and tries to find relevant sources to the user's query directly from the page.
- **Normal Mode:** Processes your query and performs a web search.
-- **Focus Modes:** Special modes to better answer specific types of questions. Perplexica currently has 6 focus modes:
+- **Focus Modes:** Special modes to better answer specific types of questions. Perplexica currently has 7 focus modes:
- **All Mode:** Searches the entire web to find the best results.
- - **Writing Assistant Mode:** Helpful for writing tasks that do not require searching the web.
+ - **Local Research Mode:** Research and interact with local files with citations.
+ - **Chat Mode:** Have a truly creative conversation without web search.
- **Academic Search Mode:** Finds articles and papers, ideal for academic research.
- **YouTube Search Mode:** Finds YouTube videos based on the search query.
- **Wolfram Alpha Search Mode:** Answers queries that need calculations or data analysis using Wolfram Alpha.
diff --git a/docs/API/SEARCH.md b/docs/API/SEARCH.md
index b67b62b..e7e55b2 100644
--- a/docs/API/SEARCH.md
+++ b/docs/API/SEARCH.md
@@ -55,7 +55,7 @@ The API accepts a JSON object in the request body, where you define the focus mo
- **`focusMode`** (string, required): Specifies which focus mode to use. Available modes:
- - `webSearch`, `academicSearch`, `writingAssistant`, `wolframAlphaSearch`, `youtubeSearch`, `redditSearch`.
+ - `webSearch`, `academicSearch`, `localResearch`, `chat`, `wolframAlphaSearch`, `youtubeSearch`, `redditSearch`.
- **`optimizationMode`** (string, optional): Specifies the optimization mode to control the balance between performance and quality. Available modes:
diff --git a/src/components/MessageInputActions/Focus.tsx b/src/components/MessageInputActions/Focus.tsx
index 875dbf7..09d97ac 100644
--- a/src/components/MessageInputActions/Focus.tsx
+++ b/src/components/MessageInputActions/Focus.tsx
@@ -2,6 +2,7 @@ import {
BadgePercent,
ChevronDown,
Globe,
+ MessageCircle,
Pencil,
ScanEye,
SwatchBook,
@@ -30,11 +31,23 @@ const focusModes = [
icon: ,
},
{
- key: 'writingAssistant',
- title: 'Writing',
- description: 'Chat without searching the web',
+ key: 'chat',
+ title: 'Chat',
+ description: 'Have a creative conversation',
+ icon: ,
+ },
+ {
+ key: 'localResearch',
+ title: 'Local Research',
+ description: 'Research and interact with local files with citations',
icon: ,
},
+ {
+ key: 'redditSearch',
+ title: 'Reddit',
+ description: 'Search for discussions and opinions',
+ icon: ,
+ },
{
key: 'wolframAlphaSearch',
title: 'Wolfram Alpha',
@@ -47,12 +60,6 @@ const focusModes = [
description: 'Search and watch videos',
icon: ,
},
- {
- key: 'redditSearch',
- title: 'Reddit',
- description: 'Search for discussions and opinions',
- icon: ,
- },
];
const Focus = ({
diff --git a/src/lib/prompts/chat.ts b/src/lib/prompts/chat.ts
new file mode 100644
index 0000000..fd818b6
--- /dev/null
+++ b/src/lib/prompts/chat.ts
@@ -0,0 +1,19 @@
+export const chatPrompt = `
+You are Perplexica, an AI model who is expert at having creative conversations with users. You are currently set on focus mode 'Chat', which means you will engage in a truly creative conversation without searching the web or citing sources.
+
+In Chat mode, you should be:
+- Creative and engaging in your responses
+- Helpful and informative based on your internal knowledge
+- Conversational and natural in your tone
+- Willing to explore ideas, hypothetical scenarios, and creative topics
+
+Since you are in Chat mode, you would not perform web searches or cite sources. If the user asks a question that would benefit from web search or specific data, you can suggest they switch to a different focus mode like 'All Mode' for general web search or another specialized mode.
+
+### User instructions
+These instructions are shared to you by the user and not by the system. You will have to follow them but give them less priority than the above instructions. If the user has provided specific instructions or preferences, incorporate them into your response while adhering to the overall guidelines.
+{systemInstructions}
+
+
+{context}
+
+`;
diff --git a/src/lib/prompts/index.ts b/src/lib/prompts/index.ts
index f479185..eff5737 100644
--- a/src/lib/prompts/index.ts
+++ b/src/lib/prompts/index.ts
@@ -11,7 +11,8 @@ import {
wolframAlphaSearchResponsePrompt,
wolframAlphaSearchRetrieverPrompt,
} from './wolframAlpha';
-import { writingAssistantPrompt } from './writingAssistant';
+import { localResearchPrompt } from './localResearch';
+import { chatPrompt } from './chat';
import {
youtubeSearchResponsePrompt,
youtubeSearchRetrieverPrompt,
@@ -26,7 +27,8 @@ export default {
redditSearchRetrieverPrompt,
wolframAlphaSearchResponsePrompt,
wolframAlphaSearchRetrieverPrompt,
- writingAssistantPrompt,
+ localResearchPrompt,
+ chatPrompt,
youtubeSearchResponsePrompt,
youtubeSearchRetrieverPrompt,
};
diff --git a/src/lib/prompts/writingAssistant.ts b/src/lib/prompts/localResearch.ts
similarity index 77%
rename from src/lib/prompts/writingAssistant.ts
rename to src/lib/prompts/localResearch.ts
index 565827a..be40e82 100644
--- a/src/lib/prompts/writingAssistant.ts
+++ b/src/lib/prompts/localResearch.ts
@@ -1,6 +1,6 @@
-export const writingAssistantPrompt = `
-You are Perplexica, an AI model who is expert at searching the web and answering user's queries. You are currently set on focus mode 'Writing Assistant', this means you will be helping the user write a response to a given query.
-Since you are a writing assistant, you would not perform web searches. If you think you lack information to answer the query, you can ask the user for more information or suggest them to switch to a different focus mode.
+export const localResearchPrompt = `
+You are Perplexica, an AI model who is expert at searching the web and answering user's queries. You are currently set on focus mode 'Local Research', this means you will be helping the user research and interact with local files with citations.
+Since you are in local research mode, you would not perform web searches. If you think you lack information to answer the query, you can ask the user for more information or suggest them to switch to a different focus mode.
You will be shared a context that can contain information from files user has uploaded to get answers from. You will have to generate answers upon that.
You have to cite the answer using [number] notation. You must cite the sentences with their relevent context number. You must cite each and every part of the answer so the user can know where the information is coming from.
diff --git a/src/lib/search/index.ts b/src/lib/search/index.ts
index 01fb87f..b334962 100644
--- a/src/lib/search/index.ts
+++ b/src/lib/search/index.ts
@@ -20,15 +20,24 @@ export const searchHandlers: Record = {
searchWeb: true,
summarizer: false,
}),
- writingAssistant: new MetaSearchAgent({
+ localResearch: new MetaSearchAgent({
activeEngines: [],
queryGeneratorPrompt: '',
- responsePrompt: prompts.writingAssistantPrompt,
+ responsePrompt: prompts.localResearchPrompt,
rerank: true,
rerankThreshold: 0,
searchWeb: false,
summarizer: false,
}),
+ chat: new MetaSearchAgent({
+ activeEngines: [],
+ queryGeneratorPrompt: '',
+ responsePrompt: prompts.chatPrompt,
+ rerank: false,
+ rerankThreshold: 0,
+ searchWeb: false,
+ summarizer: false,
+ }),
wolframAlphaSearch: new MetaSearchAgent({
activeEngines: ['wolframalpha'],
queryGeneratorPrompt: prompts.wolframAlphaSearchRetrieverPrompt,