Intelligent AI-powered metadata generation for Obsidian vaults
AutoAiTag automatically enhances your Obsidian notes with AI-generated summaries, tags, and intelligent date detection. It's designed to work with local language models (LM Studio) for maximum privacy and cost-effectiveness.
- Smart Summaries: Generate concise, contextual summaries (max 50 words) for long notes (Configurable; Default=1000 chars)
- Intelligent Tagging: Extract up to 3 relevant keyword tags from note content
- Date Detection: Three-tier system for accurate date extraction:
- AI Detection: LLM extracts dates from note content with confidence scoring
- Filename Parsing: Extract dates from filenames like
(2024-01-15) - File System Fallback: Use file creation date as last resort
- Non-destructive: Preserves all existing frontmatter and metadata
- Smart Merging: Combines new AI tags with existing ones
- Smart Update: Uses
autoAiTagtag to prevent re-processing files that AutoAiTag has already processed. Can be 'forced' to reprocess all files if need be. - Non Destructive Dry Run: Use the Dry run option first to see a JSON file containing all the proposed changes before comitting them to your Markdown files. Includes a confidence level for Date parsing.
- Multithreaded Processing: Configurable worker threads for large vaults
- Concurrency Control: Limit simultaneous LLM requests to prevent server overload
- Progress Tracking: Real-time feedback and detailed error logging
- Batch Processing: Handle thousands of notes efficiently
- Local LLM Support: Works with LM Studio, Ollama, or any OpenAI-compatible API
- Customizable Thresholds: Adjust character limits and processing parameters
- Environment Variables: Easy deployment across different systems
- Debug Mode: Detailed logging for troubleshooting
- Python 3.7+ (Python 3.8+ recommended)
- LM Studio or compatible local LLM server
- Obsidian vault with markdown files
# Clone the repository
git clone https://github.com/tonyknight/AutoAiTag.git
cd AutoAiTag
# Install dependencies
pip install -r requirements-minimal.txt
# Run the script
python AutoAiTag.py# Install dependencies directly
pip install requests PyYAML
# Download and run
wget https://raw.githubusercontent.com/tonyknight/AutoAiTag/main/AutoAiTag.py
python AutoAiTag.py- Install LM Studio from lmstudio.ai
- Download a model (recommended: Llama2 7B or larger)
- Start the server with OpenAI-compatible API enabled
- Update the script with your server details:
# In AutoAiTag.py, update these settings:
API_URL = "http://localhost:1234/v1/chat/completions" # Your LM Studio endpoint
MODEL_NAME = "llama2:7b" # Your preferred model# Processing Settings
DEFAULT_CHAR_LIMIT = 1000 # Minimum characters for AI summary processing
DEFAULT_WORKERS = 4 # Number of concurrent file processors
DEFAULT_MAX_CONCURRENT_LLM = 2 # Max simultaneous LLM requests
REQUEST_TIMEOUT = 60 # LLM response timeout (seconds)- Run the script:
python AutoAiTag.py - Choose mode:
- Dry Run: Test without modifying files
- Write Mode: Actually update your notes
- Configure settings:
- Character threshold for AI processing
- Worker thread count
- Force processing options
- Process your vault: Let AutoAiTag enhance your notes!
---
title: Meeting Notes
Date: 2024-01-15
summary: Team discussed Q1 goals, budget allocation, and timeline for new product launch
tags: [meeting, planning, budget, product-launch]
wordCount: 1250
autoAiTag: true
---- Purpose: Test configuration and see what would happen
- Output:
metadata_dryrun.jsonwith planned changes - Safety: No files are modified
- Use case: First-time setup, testing, auditing
- Purpose: Actually enhance your notes with metadata
- Output: Modified markdown files with new frontmatter
- Safety: Creates backups, preserves existing content
- Use case: Production use, bulk processing
AutoAiTag generates detailed error logs for troubleshooting:
- Filename:
(YYYY-MM-DD HH-MM-SS) AutoAiTag Log.json - Contents: File paths, error messages, timestamps
- Location: Same directory as your vault
- LLM Connection Failed: Check LM Studio server status and API URL
- Permission Errors: Ensure write access to vault directory
- Memory Issues: Reduce worker thread count
- Slow Processing: Increase LLM concurrency limit (if server can handle it)
# Process specific subdirectory
python AutoAiTag.py
# Then enter: ./DailyNotes
# Force reprocessing of all files
python AutoAiTag.py
# Choose Write Mode, then: Force processing = yAutoAiTag recognizes these filename patterns:
Meeting Notes (2024-01-15).mdβJournal 2024-01-15.mdβ (no parentheses)Notes (2024-1-5).mdβ (auto-formats to 2024-01-05)
# For large vaults (1000+ files)
DEFAULT_WORKERS = 8
DEFAULT_MAX_CONCURRENT_LLM = 4
# For slower LLM servers
DEFAULT_MAX_CONCURRENT_LLM = 1
REQUEST_TIMEOUT = 120# Install development dependencies
pip install -r requirements.txt
# Run tests
python -m pytest
# Code formatting
black AutoAiTag.py
flake8 AutoAiTag.py- Additional local LLM providers (Ollama, etc.)
- More metadata fields (reading time, complexity score)
- GUI interface for command line haters
This project is licensed under the MIT License.
- Issues: GitHub Issues
- Wiki: Documentation
- Discussions: GitHub Discussions
Made with β€οΈ for the Obsidian community
Transform your vault from a collection of notes into an intelligent, searchable knowledge base with AutoAiTag.