This guide walks you through creating a simple pipe from scratch, then building progressively more complex examples.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/screenpipe/screenpipe/llms.txt
Use this file to discover all available pages before exploring further.
Quick start
A pipe is just a markdown file in~/.screenpipe/pipes/{pipe_name}/pipe.md.
Write pipe.md
Create GET http://localhost:3030/search?content_type=ocr&start_time=ISO8601_TIMESTAMP&end_time=ISO8601_TIMESTAMP&limit=100
pipe.md with YAML frontmatter and a prompt:Test manually
Open the screenpipe app and run your pipe manually:
- Go to Pipes tab
- Find
my-first-pipein the list - Click Run now
- Watch the logs in real-time
- Check
~/.screenpipe/pipes/my-first-pipe/output/summary.txt
Pipe anatomy
Every pipe has two parts:1. YAML frontmatter
Defines scheduling, AI model, and data permissions:2. Prompt body
Instructions for the AI agent:Schedules
Manual
Interval
Cron
AI models
Pipes support any LLM:Using presets
Instead of hardcoding model + provider, reference a saved preset:Querying screenpipe
Your prompt has access to the screenpipe REST API onhttp://localhost:3030.
Search endpoint
The main endpoint pipes use:content_type:ocr,audio,input,accessibility, orallstart_time,end_time: ISO 8601 timestamps (e.g.,2026-03-08T10:00:00Z)limit: Max results (default 50, max 1000)offset: Pagination offsetq: Keyword search (optional)app_name: Filter by app (optional)window_name: Filter by window title (optional)min_length: Skip short OCR fragments (recommended: 50)
Example response
Example response
Query strategies
Time chunking (recommended)
Time chunking (recommended)
For pipes covering long time ranges, query in chunks to avoid overwhelming context:This prevents context overflow and gives richer results.
Pagination for large results
Pagination for large results
If a single query returns
total > limit, paginate:Multi-modal queries
Multi-modal queries
Query each content type separately for richer context:Combining results gives a fuller picture than
content_type=all.Writing output
Pipes should write results to the./output/ directory:
~/.screenpipe/pipes/{pipe_name}/, so ./output/ resolves to that pipe’s output folder.
Each pipe execution should write to a unique file (e.g., timestamped) to avoid overwriting previous runs:
External actions
Pipes can do more than read screenpipe data:Call external APIs
Run shell commands
Best practices
1. Start simple
Test with a short time range (last 30 minutes) before running on 24 hours of data.2. Use min_length for OCR
Addmin_length=50 to OCR queries to skip noisy fragments:
3. Respect time zones
Always display times in the user’s local timezone:4. Handle empty results gracefully
If the API returns no data, don’t fail — write a note:5. Redact sensitive data
Never dump raw OCR or transcripts — synthesize into summaries:6. Deduplicate for incremental updates
For hourly pipes that append to a daily log:7. Test with manual runs first
Always test a pipe manually before enabling the schedule. Check:- Does it produce the expected output?
- Does it handle empty data?
- Does it run within the 5-minute timeout?
Debugging
View logs
Every execution is logged to:- Stdout and stderr from the AI agent
- Start/end timestamps
- Exit code
- Error messages
Common issues
Pipe times out after 5 minutes
Pipe times out after 5 minutes
Your pipe is doing too much. Solutions:
- Query in smaller time chunks
- Reduce the time range
- Simplify the task
- Use a faster model (haiku instead of sonnet)
No data returned from API
No data returned from API
Check:
- Is screenpipe capturing? (Timeline should show activity)
- Is your time range correct? (Use ISO 8601 format)
- Are data permissions blocking access? (Check frontmatter)
AI agent makes mistakes
AI agent makes mistakes
- Add more specific instructions to your prompt
- Include example output format
- Use a more capable model (sonnet instead of haiku)
Pipe doesn't run on schedule
Pipe doesn't run on schedule
Check:
enabled: truein frontmatter?- Valid schedule format? (
every 30m, not30m) - screenpipe app running?
- Logs show any errors?
Permission denied errors
Permission denied errors
The pipe’s data permissions are blocking API calls. Either:
- Relax permissions in frontmatter (remove
allow-apps, etc.) - Or adjust the prompt to work within the restrictions
Examples
See Pipe Examples for complete, working pipes you can copy and customize.Next steps
Data Permissions
Configure fine-grained access control
Examples
Real pipe examples (Obsidian sync, reminders, etc.)
API Reference
Complete screenpipe API docs