Shard ingests PDFs, URLs, YouTube videos, and text into your Obsidian vault as structured AI-generated notes with semantic search. Everything runs locally by default β your data never leaves your machine.
- π Multi-source ingestion (PDF, URL, YouTube, text, stdin)
- π€ AI-powered formatting with auto-generated titles, tags, summaries
- π Semantic search with Redis Stack vector embeddings
- π Local-first with Ollama β no cloud, no API keys, no cost
- π Native Obsidian integration with YAML frontmatter
- π Flexible model support via LiteLLM (Ollama, OpenAI, Anthropic, Groq, etc.)
- β‘ Fuzzy note search and one-click Obsidian opening
- π§ Learn your style β analyzes your vault and writes new notes that match how you already write
- βοΈ Atomic notes β automatically splits any source into focused single-concept notes, all interlinked with [[wikilinks]]
- π Auto backlinks β syncs [[wikilinks]] across your vault to build a rich knowledge graph
- π Flat file saving β notes save directly to your vault root, no buried subfolders
- π€ Model switcher β switch between local and cloud models, pull Ollama models, and manage API keys with
shard model
git clone https://github.com/RicePollution/shard
cd shard
uv tool install .
shard config
shard add "https://example.com/article"
shard ask "what did I just read?"Need Python, uv, or Ollama? See Prerequisites.
Run:
shard configExample wizard output:
Note: Default path requires a space for /Documents/Obsidian Vault
Welcome to Shard! Let's get you set up.
Path to your Obsidian vault [/home/user/Documents/ObsidianVault]: /home/user/Documents/MyVault
Checking for a local Ollama installationβ¦
Ollama is running. Found 1 installed model(s).
Installed models:
qwen2.5:3b
'qwen2.5:3b' is already installed. Using it as the default model.
Config saved to /home/user/.config/shard/config.json
Config file location:
| OS | Path |
|---|---|
| π§ Linux | ~/.config/shard/config.json |
| π macOS | ~/.config/shard/config.json |
| πͺ Windows | %APPDATA%\shard\config.json |
Ingest any source into your vault as atomic notes.
| Flag | Description |
|---|---|
--single |
One note, no splitting |
--instruction, -i |
Custom formatting instruction (e.g. "focus on code examples") |
shard add "https://example.com"
shard add /path/to/paper.pdf
shard add "https://youtube.com/watch?v=..."
shard add "raw text or idea"
cat file.txt | shard add -
shard add "https://example.com" -i "focus on practical examples"Semantic search across your entire vault with AI answers.
| Flag | Description |
|---|---|
--top-k N |
Number of source chunks to retrieve (default: 5) |
shard ask "what do I know about RAG?"
shard ask "best practices for testing" --top-k 10Manage models and API keys.
| Subcommand | Description |
|---|---|
shard model |
Interactive model menu |
shard model list |
Show all available models |
shard model use <model> |
Switch to a model |
shard model pull <model> |
Pull an Ollama model |
shard model key <provider> |
Add a cloud API key |
shard model key --list |
Show configured keys |
shard model use gpt-5
shard model pull llama3.1:8b
shard model key openaiLearn your vault's writing style for better note generation.
| Flag | Description |
|---|---|
--depth quick |
5 notes, 1 API call, fastest |
--depth normal |
20 notes, balanced (default) |
--depth deep |
Entire vault, most accurate |
--force |
Re-analyze even if profile exists |
--show |
Print current style fingerprint |
--template |
Print blank note template |
shard learn
shard learn --depth deepAdd [[wikilinks]] between related notes automatically.
| Flag | Description |
|---|---|
--dry-run |
Preview changes without modifying files |
--verbose |
Show each link as it's added |
shard sync
shard sync --dry-runRebuild the semantic search index from your vault.
shard indexShow all imported notes.
shard listFuzzy-match and open a note in Obsidian.
shard open "machine learning"View and update settings.
| Flag | Description |
|---|---|
--show |
Print current config |
--set KEY=VALUE |
Update a single value |
--setup |
Re-run setup wizard |
shard config --show
shard config --set vault_path="/new/path"| Tier | Models | Cost | RAM Required |
|---|---|---|---|
| π’ Local Small | qwen2.5:3b, phi3.5, llama3.2:3b |
Free | ~4 GB |
| π‘ Local Large | llama3.1:8b, qwen2.5:14b |
Free | 8+ GB |
| π΅ Cloud | Claude, GPT-4o, Gemini, Groq | Paid / Free tier | N/A |
| Provider | Model String | Free Tier | API Key |
|---|---|---|---|
| Groq | groq/llama-3.1-8b-instant |
β Yes | console.groq.com |
| OpenAI | gpt-4o |
β No | platform.openai.com |
| Anthropic | claude-sonnet-4-20250514 |
β No | console.anthropic.com |
gemini/gemini-pro |
β Yes | aistudio.google.com |
π‘ Groq offers a generous free tier with fast inference. It's the best starting point if you want cloud models without paying.
Add API keys with: shard model key <provider>
Python is the programming language Shard is built with. You need version 3.11 or newer.
Check if installed:
python3 --versionπ§ Arch Linux
sudo pacman -S pythonπ§ Ubuntu / Debian
sudo apt update
sudo apt install python3π§ Fedora / RHEL
sudo dnf install python3π macOS
brew install python3πͺ Windows
Download the installer from python.org and run it. Make sure to check "Add Python to PATH" during installation.
Verify:
python3 --version # Must show 3.11 or higheruv is a modern Python package manager. It's faster than pip and lets you install Python apps as global commands without managing virtual environments. Think of it like installing an app, not a library.
Check if installed:
uv --versionπ§ Arch Linux
sudo pacman -S uvπ§ Ubuntu / Debian
curl -LsSf https://astral.sh/uv/install.sh | sh
source ~/.bashrcπ§ Fedora / RHEL
curl -LsSf https://astral.sh/uv/install.sh | sh
source ~/.bashrcπ macOS
brew install uvOr via the installer:
curl -LsSf https://astral.sh/uv/install.sh | sh
source ~/.zshrcπͺ Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Verify:
uv --versionOllama runs AI models locally on your machine for free. No account, no API key, no internet needed after setup. Shard uses it by default so your notes stay completely private.
Check if installed:
ollama --versionπ§ Arch Linux
sudo pacman -S ollamaπ§ Ubuntu / Debian
curl -fsSL https://ollama.ai/install.sh | shπ§ Fedora / RHEL
curl -fsSL https://ollama.ai/install.sh | shπͺ Windows
Download the installer from ollama.com and run it.
Start Ollama:
π§ Arch Linux
ollama serveOr for automatic startup on boot (recommended):
sudo systemctl enable --now ollamaπ§ Ubuntu / Debian
ollama serveOr for automatic startup on boot (recommended):
sudo systemctl enable --now ollamaπ§ Fedora / RHEL
ollama serveOr for automatic startup on boot (recommended):
sudo systemctl enable --now ollamaπ macOS
Ollama runs automatically as a menu bar app after installation. No extra steps needed.
πͺ Windows
Ollama runs automatically as a system tray app after installation. No extra steps needed.
π‘
ollama servemust be running whenever you use Shard. On Linux, usingsystemctlis the easiest option β it starts automatically on boot.
Pull the default model:
ollama pull qwen2.5:3bπ‘ This downloads about 2 GB. It runs on any modern machine with no GPU required. Completely free, forever.
Verify:
ollama run qwen2.5:3b "say hello"Redis Stack provides the vector search engine for shard ask. It stores note embeddings and runs fast similarity queries.
Check if installed:
redis-cli pingπ§ Arch Linux
yay -S redis-stack-server
sudo systemctl enable --now redis-stack-serverπ§ Ubuntu / Debian
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
sudo apt update
sudo apt install redis-stack-server
sudo systemctl enable --now redis-stack-serverπ macOS
brew tap redis-stack/redis-stack
brew install redis-stack-server
redis-stack-server --daemonize yesπͺ Windows
Use Docker:
docker run -d --name redis-stack -p 6379:6379 redis/redis-stack-server:latestπ³ Docker (any OS)
docker run -d --name redis-stack -p 6379:6379 redis/redis-stack-server:latestVerify:
redis-cli ping # Should print PONGπ‘ Redis Stack must be running whenever you use
shard askorshard index. Theshard addcommand indexes notes automatically.
Obsidian is a note-taking app that stores notes as plain markdown files in a folder called a "vault." Shard saves generated notes directly into your vault.
π§ Ubuntu / Debian
Download the .deb file from obsidian.md and install it:
sudo apt install ./Obsidian-*.debπ§ Fedora / RHEL
Download the .rpm file from obsidian.md and install it:
sudo dnf install ./Obsidian-*.rpmπͺ Windows
Download the installer from obsidian.md and run it.
Open Obsidian and create a vault if you haven't. Note the vault folder path β you'll need it during Shard setup. Example paths:
- Linux:
/home/yourname/Documents/MyVault - macOS:
/Users/yourname/Documents/MyVault - Windows:
C:\Users\yourname\Documents\MyVault
git clone https://github.com/RicePollution/shard
cd shard
uv tool install .π‘
uv tool install .installs Shard as a global command from the local folder. You only need to do this once. After this,shardworks from any directory.
If shard is not found:
π§ Arch Linux
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcπ§ Ubuntu / Debian
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcπ§ Fedora / RHEL
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcπ macOS
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcπͺ Windows
- Press
Win + Xand select "System" - Click "Advanced system settings" on the left
- Click "Environment Variables" button
- Under "User variables", click "New"
- Variable name:
PATH - Variable value:
%USERPROFILE%\.local\bin - Click OK on all dialogs
- Restart your terminal
Verify:
shard --help| Field | Default | Description |
|---|---|---|
vault_path |
(set during setup) | Absolute path to your Obsidian vault |
model |
ollama_chat/qwen2.5:3b |
LiteLLM model string for note generation |
redis_host |
localhost |
Redis Stack hostname |
redis_port |
6379 |
Redis Stack port |
redis_password |
"" |
Redis password (if set) |
embedding_model |
all-MiniLM-L6-v2 |
Sentence-transformers model for embeddings |
custom_models |
[] |
User-registered model descriptors |
api_keys |
{} |
Provider API keys (alternative to env vars) |
notes_subfolder |
"" (vault root) |
Where new notes are saved |
style_profile |
auto-managed | Path to learned style JSON |
Your Input β Extractor β Formatter (AI) β Indexer β Obsidian Vault
- Extractor: Pulls text from PDFs (pdfplumber), URLs (httpx + BeautifulSoup), YouTube (transcript API), or stdin
- Formatter: Sends text to your LLM to generate a structured note with title, tags, summary, and markdown body
- Indexer: Chunks the note text, generates vector embeddings (sentence-transformers), and stores them in Redis Stack for semantic search
- Vault: Saves the note as a markdown file with YAML frontmatter in your Obsidian vault
β shard: command not found
Your PATH doesn't include the uv tool install directory.
π§ Linux:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcπ macOS:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcπͺ Windows:
- Press
Win + Xand select "System" - Click "Advanced system settings" on the left
- Click "Environment Variables" button
- Under "User variables", click "New"
- Variable name:
PATH - Variable value:
%USERPROFILE%\.local\bin - Click OK on all dialogs
- Restart your terminal
β Connection refused / Cannot reach Ollama
Ollama isn't running. Start it:
π§ Linux:
ollama serveOr for automatic startup:
sudo systemctl enable --now ollamaπ macOS:
Open the Ollama app from your Applications folder.
πͺ Windows:
Open the Ollama app from your Start Menu.
β Model not found
Pull the default model:
ollama pull qwen2.5:3bβ Redis is not available
Redis Stack isn't running or doesn't have the RediSearch module loaded.
Start Redis Stack:
# Linux (systemd)
sudo systemctl start redis-stack-server
# macOS (Homebrew)
redis-stack-server --daemonize yes
# Docker
docker start redis-stackIf you have plain Redis without the Stack modules, you need Redis Stack instead. See the Redis Stack prerequisite.
β Vault path does not exist
Re-run setup:
shard config --setupβ³ Slow on first run
Normal! First run loads the AI model into memory and downloads the embedding model (~80 MB). Subsequent runs are much faster.
β Permission denied (Linux)
If you get permission errors on Linux:
chmod +x ~/.local/bin/shardβ shard learn says not enough notes
shard learn needs at least 5 notes in your vault to analyze.
Add some notes first with shard add, then re-run shard learn.
β shard sync changed something it shouldn't have
shard sync always creates a backup before making changes.
Find your backup at ~/.shard/backups/ and restore from there.
To preview changes without modifying files, always use:
shard sync --dry-runWe welcome contributions! For guidelines, see CONTRIBUTING.md.
Good first issues:
- Add support for EPUB files
- Add support for RSS feeds
- Improve chunking with semantic boundaries
- Add
shard exportcommand - Better error messages for common failures
This project is licensed under the MIT License. See the LICENSE file for details.