| name | obsidian |
| description | Obsidian Vault Integration — Automatically save session logs to your Obsidian vault. Enables persistent AI agent memory across pi sessions. |
Obsidian Integration Skill
This skill provides Obsidian vault integration for the pi agent, enabling persistent context and automatic session log saving.
Vault Configuration
The Obsidian vault path is configured as:
VAULT="/Users/ldangelo/Library/Mobile Documents/iCloud~md~obsidian/Documents/ldangelo"
Directory Structure
- Sessions/ - Session logs saved at end of each session
- Topics/ - Topic notes for conceptual knowledge
- Daily Notes/ - Date-based journal entries
- Projects/ - Project-specific documentation
- Tasks/ - Task tracking and action items
When to Use
Use this skill (automatically) when:
- Saving Session Logs - At the end of every session (automatic)
- Searching for Context - Looking up concepts, projects, or past work
- Saving Documents - When asked to "save to obsidian"
- Managing Tasks - Creating task notes in the vault
- Looking up Information - Querying the vault for previous work
Automatic Session Log Saving
Session logs are automatically saved to the Obsidian vault at session end via the obsidian-session-saver.ts extension.
The extension:
- Listens to
session_shutdown events
- Extracts conversation highlights from the session
- Generates a markdown file with metadata (date, project, tags)
- Saves to
Sessions/YYYY-MM-DD-session-id.md
Automatic Saving Behavior:
- Triggered when pi exits normally (Ctrl+C, Ctrl+D)
- Does NOT trigger on
/reload, /new, or /resume (only on actual quit)
- Session file path determines the output filename
- Context is extracted from the last user/assistant messages
How It Works
-
On session_shutdown event, the extension extracts:
- Session header metadata (date, working directory)
- Last user message content
- Last assistant message content
- Tool call count
- Total entries
-
Generates a markdown file with:
---
date: YYYY-MM-DD
project: project-name
tags: [pi-session, auto-saved]
---
# Session — YYYY-MM-DD
...
-
Saves to VAULT/Sessions/session-id.md
Helper Scripts
The skill includes helper scripts for manual operations:
Search Vault
pi obsidian search "term"
pi obsidian search "term" --dir=Projects
pi obsidian search "term" --dir=Sessions --date=2024
Get Vault Context
pi obsidian recent-sessions
pi obsidian list-topics
pi obsidian daily-notes
Save Document to Vault
pi obsidian save "filename.md" --content="..." --dir=Projects
pi obsidian save-daily "content" --tags=tag1,tag2
List Vault Contents
pi obsidian list-topics
pi obsidian list-sessions
pi obsidian list-daily-notes
Integration with Claude, OpenClaw, and Codex
All four agents (pi, Claude, OpenClaw, Codex) use the same Obsidian vault for persistent memory:
| Agent | Vault Path | Session Logs |
|---|
| pi | ~/Library/Mobile Documents/iCloud~md~obsidian/Documents/ldangelo | Sessions/ |
| Claude | Same vault | Sessions/ |
| OpenClaw | Same vault | Sessions/ |
| Codex | Same vault | Sessions/ |
Session Log Format
---
date: YYYY-MM-DD
project: project-name
tags: [pi-session, auto-saved]
---
# Session — YYYY-MM-DD
## Summary
This session log was automatically saved by the pi agent.
## Conversation Highlights
[Last user message content]
## Key Results
[Last assistant message content]
## Statistics
- Tool calls: N
- Total entries: N
- Reason: quit
## Open Items
*Review the session log and add any pending tasks here.*
## Files Modified
*Review the session log and list any files modified here.*
## Key Learnings
*Review the session log and note any important learnings here.*
Configuration
Environment Variables
PI_OBSIDIAN_VAULT - Override the default vault path
Extension Location
The session saver extension is at:
~/.pi/agent/extensions/obsidian-session-saver.ts
Example Usage
pi obsidian save-session
pi obsidian search "api design patterns"
pi obsidian list-topics
pi obsidian recent-sessions
Notes
- All agents share the same Obsidian vault for unified persistent memory
- Session logs are saved automatically at session end (quit only)
- The extension uses
session_shutdown event for reliable saving
/pi-fact <fact> saves durable facts to Agent/PiMemory/MEMORY.md in the vault
- Manual scripts available for search and context retrieval