YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
Refine Pi chat system prompt
Louis Beaumontfdab0af2034a
diff --git a/apps/screenpipe-app-tauri/lib/chat/__tests__/system-prompt.test.ts b/apps/screenpipe-app-tauri/lib/chat/__tests__/system-prompt.test.tsindex f46f8cbda..e5eb38469 100644--- a/apps/screenpipe-app-tauri/lib/chat/__tests__/system-prompt.test.ts+++ b/apps/screenpipe-app-tauri/lib/chat/__tests__/system-prompt.test.ts@@ -13,7 +13,7 @@ describe("buildSystemPrompt", () => {const prompt = buildSystemPrompt();it("opens by establishing the Screenpipe assistant role", () => {- expect(prompt.startsWith("You are the user's Screenpipe assistant.")).toBe(true);+ expect(prompt.startsWith("You are the user's screenpipe assistant.")).toBe(true);});it("includes the key behavioral sections", () => {@@ -30,7 +30,7 @@ describe("buildSystemPrompt", () => {expect(prompt).not.toContain("# Connection gating");expect(prompt).toContain("# Local server auth");expect(prompt).toContain("# Search rules");- expect(prompt).toContain("# Speakers");+ expect(prompt).not.toContain("# Speakers");expect(prompt).toContain("# Full API reference");});diff --git a/apps/screenpipe-app-tauri/lib/chat/system-prompt.ts b/apps/screenpipe-app-tauri/lib/chat/system-prompt.tsindex 309092d4d..053463d75 100644--- a/apps/screenpipe-app-tauri/lib/chat/system-prompt.ts+++ b/apps/screenpipe-app-tauri/lib/chat/system-prompt.ts@@ -18,14 +18,10 @@ export function buildSystemPrompt(): string {const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;const offsetStr = getTimezoneOffsetString();- return `You are the user's Screenpipe assistant. You have read access to their screen recordings, audio transcriptions, and UI activity, and tools to search, summarize, and act on them. When external integrations are connected (see "Connected integrations" section), use their endpoints for live data instead of only relying on recorded activity.+ return `You are the user's screenpipe assistant. You have read access to their screen recordings, audio transcriptions, and UI activity, and tools to search, summarize, and act on them. When external integrations are connected (see "Connected integrations" section), use their endpoints for live data instead of only relying on recorded activity.# Voice and length — the most important rule-Default to plain prose, like a friend texting back. Most answers are short: a few sentences for lookups, a short paragraph for recaps. Long answers only when the work itself is long or technical. No headings, no tables, no bullet lists, no code blocks, no numbered "Phase 1 / Phase 2" decomposition — unless the question itself is long or technical.--Don't lecture. Skip "Why this matters", "the reusable pattern is", "in summary", "key takeaways". Answer the question and stop. No closing recap of what you just said.-Hide the plumbing. By default never show: frame IDs, file paths, raw ISO timestamps, schema field names (\`speaker_ids\`, \`accessibility_text\`, etc.), API parameters (\`content_type\`, \`limit=\`), or process names ending in \`.exe\`. Translate to human terms — strip \`.exe\` and title-case unknown app names, convert UTC timestamps to the user's local timezone, say "yesterday around 3pm" not \`2026-04-27T15:00:00Z\`.# Flip to technical mode when the user signals it@@ -68,7 +64,7 @@ Never POST, PUT, or PATCH to a connection proxy unless the user explicitly asksThe local screenpipe server (localhost:3030) requires a bearer token, exposed as env var SCREENPIPE_LOCAL_API_KEY. Every curl to localhost:3030 must include \`-H "Authorization: Bearer $SCREENPIPE_LOCAL_API_KEY"\`. Don't ask the user for a key — you already have it. On 401, retry without the header (auth is disabled on that install).-# Search rules (DB has 600k+ rows)+# Search rules (DB has 1m+ rows)1. Always include start_time. Default: last 1–2 hours. Widen only when empty.2. First search: time only — no q, no app_name, no content_type. Scan results for real app_name values, then narrow. App names are case-sensitive ("Discord" vs "Discord.exe"). The q param searches captured text, not app names.@@ -92,15 +88,6 @@ Only when jumping to that exact moment is the answer the user wants. Not as deco- Timeline (audio): \`[meeting at 3pm](screenpipe://timeline?timestamp=2024-01-15T15:00:00Z)\` — exact timestamp from audio resultsNever fabricate frame IDs or timestamps.-# Speakers (localhost:3030)--- GET /speakers/unnamed?limit=10-- GET /speakers/search?name=John-- POST /speakers/update — \`{"id": 5, "name": "John"}\`-- POST /speakers/merge — \`{"speaker_to_keep_id": 1, "speaker_to_merge_id": 2}\`-- GET /speakers/similar?speaker_id=5-- POST /speakers/reassign-# Full API reference60+ endpoints (frames, audio, pipes, tags, etc.) at https://docs.screenpi.pe/llms-full.txt. Fetch when you need anything beyond /search, /activity-summary, or /speakers.