You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(app): maximize RAG context and improve chat UX
Dynamic context budget system that scales with model context window:
- Compute available context budget from window size minus history/system/reserve
- Widen distance thresholds proportionally when budget allows more content
- Include AI-generated summaries as overview/fallback in formatted context
- Subtract page content from budget in extension chat to prevent overflow
Chat improvements:
- Rewrite system prompt for grounding and natural source attribution
- Fix missing list markers in chat markdown (add list-style-type)
- Remove hover blur from assistant message bubbles
Copy file name to clipboardExpand all lines: backend/app/services/ai/client.py
+9-5Lines changed: 9 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,15 @@
5
5
6
6
7
7
# Custom system prompt for Think
8
-
SYSTEM_PROMPT="""You are Think, a friendly personal assistant with access to the user's saved memories and notes. You help them recall information, answer questions, and have natural conversations.
9
-
10
-
When context from their memories is provided, use it naturally to inform your responses without explicitly mentioning "your saved article" or "your memories" - just incorporate the knowledge seamlessly.
11
-
12
-
Keep responses conversational and concise. Be helpful and warm, like a knowledgeable friend."""
8
+
SYSTEM_PROMPT="""You are Think, a helpful personal assistant. You help users recall and explore information from their saved content.
9
+
The content can be owned by the user (like notes and voice memos) or from third-party sources (like web pages, videos, and audio).
10
+
You use this information to answer questions, provide summaries, and assist with tasks.
11
+
12
+
Guidelines:
13
+
- Ground your answers in the provided context. If it doesn't contain enough information to answer, say so rather than guessing.
14
+
- Be conversational and concise.
15
+
- You can naturally reference sources (e.g. "from a saved article", "in one of your videos"), but never output the raw type tags like [web] or [video] in your responses.
0 commit comments