Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

chg(ai): Improve AI prompt to use tools and personalize responses (#1108)

Eric Hayes78a9d93ee752
diff --git a/js/app/packages/core/component/AI/constant/prompts.ts b/js/app/packages/core/component/AI/constant/prompts.ts
index 022c8d1c84..b4692b9d25 100644
--- a/js/app/packages/core/component/AI/constant/prompts.ts
+++ b/js/app/packages/core/component/AI/constant/prompts.ts
@@ -1,3 +1,4 @@
+import { useUserContext } from '@core/context/user';
import { useInstructionsMdTextQuery } from '@service-storage/instructionsMd';
import { createMemo } from 'solid-js';
@@ -26,8 +27,13 @@ Internal terminology and knowledge
export function useAdditionalInstructions() {
const userInstructionsQuery = useInstructionsMdTextQuery();
+ const { userInfo } = useUserContext();
return createMemo(() => {
let prompt = ABOUT_MACRO;
+ const name = userInfo()?.name;
+ if (name) {
+ prompt += `\nYou are talking to ${name}.`;
+ }
const userInstructions = userInstructionsQuery.data;
if (userInstructions) {
prompt +=
diff --git a/rust/cloud-storage/ai_tools/src/prompts/all_tools.md b/rust/cloud-storage/ai_tools/src/prompts/all_tools.md
index 7b46a3040e..8a5b954573 100644
--- a/rust/cloud-storage/ai_tools/src/prompts/all_tools.md
+++ b/rust/cloud-storage/ai_tools/src/prompts/all_tools.md
@@ -112,6 +112,7 @@ If no inline or node ids are present:
- Use tools often and specifically.
- Prefer precise filters (domain names, IDs) over generic queries.
- Web tool expects natural language queries.
+- NEVER respond with "I don't have enough context", "I don't have access to", or similar. If you lack information to answer a question, USE TOOLS to find it. Search documents, list emails, read resources - gather what you need instead of asking the user to provide more context.
- IMPORTANT After finding relavent results with any tool cite the most relavent findings
using mentions. Use the above mention format. Always use a mention if the tool