Vault Setup
Configuring your Zettelkasten vault for use with zk-chat.
What is a Vault?
A vault is your Zettelkasten - a folder containing your markdown notes and documents. Common tools that create vaults:
- Obsidian - Popular note-taking app
- Logseq - Outliner-based knowledge base
- Foam - VS Code extension
- Any markdown editor - Plain text files
Requirements
Your vault should contain:
- Markdown files (.md)
- UTF-8 text encoding
- Accessible file system location
Setting Your Vault Path
On First Run
Bookmarking Vaults
Save frequently used vaults:
# Save current vault
zk-chat interactive --vault /path/to/vault --save
# List bookmarks
zk-chat interactive --list-bookmarks
# Remove bookmark
zk-chat interactive --remove-bookmark /path/to/vault
After bookmarking, you can omit --vault:
Multiple Vaults
You can work with multiple vaults:
# Work vault
zk-chat interactive --vault ~/Documents/Work
# Personal vault
zk-chat interactive --vault ~/Documents/Personal
# Each vault maintains its own:
# - Configuration (.zk_chat)
# - Index (.zk_chat_db/)
# - System prompt (ZkSystemPrompt.md)
Vault Structure
Recommended Organization
your-vault/
├── Daily Notes/
│ ├── 2024-01-15.md
│ └── 2024-01-16.md
├── Projects/
│ ├── Project A.md
│ └── Project B.md
├── Reference/
│ ├── Books.md
│ └── Articles.md
├── Templates/
│ └── Daily Template.md
├── .zk_chat # zk-chat config
├── .zk_chat_db/ # Vector database
└── ZkSystemPrompt.md # System prompt
zk-chat Files
zk-chat creates these files in your vault:
.zk_chat - Configuration file
.zk_chat_db/ - Vector database
- Contains ChromaDB files
- Can be safely deleted to rebuild
- Managed automatically
ZkSystemPrompt.md - System prompt (optional)
- Defines AI behavior
- Customizable
- Created automatically if --store-prompt is used
Vault Best Practices
File Organization
Use descriptive names:
Organize by topic:
Use consistent structure: - Keep similar content together - Create index/MOC (Map of Content) files - Use folders sparingly (flat is often better)
Wikilinks
Use wikilinks to connect ideas:
Tips: - Link related concepts - Use consistent naming - Create bidirectional links - Build hub documents
Frontmatter (Optional)
Add metadata to documents:
---
title: Getting Things Done
tags: [productivity, gtd, workflow]
created: 2024-01-15
---
# Getting Things Done
Content here...
Git Integration
Existing Git Repository
If your vault already uses Git:
New Git Repository
zk-chat can initialize Git:
.gitignore
Optionally exclude zk-chat files:
# .gitignore
# Exclude zk-chat (if desired)
.zk_chat
.zk_chat_db/
# But keep system prompt (if customized)
!ZkSystemPrompt.md
System Prompt
What is the System Prompt?
The system prompt defines how the AI behaves when working with your vault. It's stored in ZkSystemPrompt.md.
Default Behavior
By default, zk-chat creates and uses ZkSystemPrompt.md.
Customizing
Edit ZkSystemPrompt.md to change AI behavior:
You are an AI assistant specialized in helping with my Zettelkasten.
Focus on:
- Providing detailed technical explanations
- Using examples from software development
- Connecting ideas across documents
Always:
- Cite specific documents
- Suggest related notes
- Use precise wikilink syntax
Disabling
Don't create/use the system prompt file:
Vault Backup
Why Backup?
Protect your knowledge base from: - Accidental deletions - File corruption - System failures
Backup Strategies
Git (Recommended):
# Use Git for version control
git init
git add .
git commit -m "Initial commit"
# Push to remote
git remote add origin https://github.com/user/vault.git
git push -u origin main
Cloud Sync: - Obsidian Sync - Syncthing - iCloud Drive - Dropbox - Google Drive
Local Backup:
Common Vault Patterns
Obsidian Vault
vault/
├── Daily Notes/
├── Templates/
├── Attachments/
│ └── images/
├── .obsidian/ # Obsidian config (ignored by zk-chat)
├── .zk_chat # zk-chat config
└── notes...
Logseq Vault
vault/
├── journals/
├── pages/
├── assets/
├── logseq/ # Logseq config (ignored by zk-chat)
├── .zk_chat # zk-chat config
└── notes...
Plain Markdown
Troubleshooting
Vault Not Found
Error: "Vault not found at path"
Check: - Path is correct - Path is absolute - Directory exists - Has read permissions
Can't Write to Vault
Error: Permission denied
Solutions:
Large Vault Performance
For vaults with thousands of files:
# Use incremental rebuilds
zk-chat index rebuild
# Only full rebuild when necessary
zk-chat index rebuild --full
See Also
- Installation - Initial setup
- Model Selection - Choosing models
- Index Management - Managing the index
- Git Integration - Version control