π Ask questions to your knowledge base with OpenAI, Gemini, or Local LLMs
ποΈ Tag Generator Included β Perfect for Obsidian Vaults
Semantic Vault brings semantic search to your Markdown and text notes, optimized for Obsidian users but adaptable to any folder with .md or .txt files. Ask natural language questions and get relevant answers based on your notes.
Includes an AI-powered tag generator to enrich your notes automatically β great for organizing Obsidian vaults.
β
Semantic Search with Embeddings β Find relevant notes intelligently, no file limits!
β
AI-Powered Semantic Search (Chat interface)
β
Beautiful Web Interface β Modern browser-based UI
β
Supports OpenAI, Gemini, and Ollama Local LLMs
β
CPU-Only Embeddings β No GPU required, runs efficiently on any machine
β
Markdown & Text File Support (.md and .txt files)
β
AI Tag Generation Script β YAML Compatible
β
Easy Setup with requirements.txt
- Python 3.9+
- Dependencies (use the provided
requirements.txt)
pip3 install -r requirements.txt- No GPU Required β Semantic search runs efficiently on CPU
- Optional:
- OpenAI API Key β Get one
- Google Gemini API Key β Get one
- Ollama for local LLMs β See Ollama Setup
semantic-vault/
βββ semanticVault.py # Main Semantic Search Script
βββ auto_tag_generation.py # AI Tag Generator for Markdown Notes
βββ templates/
β βββ index.html # Web UI template
βββ .embeddings_cache/ # Cached embeddings (auto-generated)
βββ requirements.txt # Python dependencies
βββ .env # API keys configuration (create this)
βββ README.md
git clone https://github.com/renantmagalhaes/semantic-vault.git
cd semantic-vaultpip3 install -r requirements.txtCreate a .env file:
OPENAI_API_KEY="your_openai_key_here"
GEMINI_API_KEY="your_openai_key_here"Only required if using OpenAI or Gemini models.
Edit semanticVault.py:
VAULT_PATH = "/path/to/your/obsidian/vault"Semantic search is enabled by default and works with unlimited files! Edit semanticVault.py:
USE_SEMANTIC_SEARCH = True # Enable semantic search (recommended)
TOP_K_NOTES = 10 # Number of most relevant notes to use (adjust as needed)Benefits:
- β No file limits β Works with vaults of any size
- β Cost efficient β Only sends relevant notes to LLM (saves API costs)
- β Better accuracy β Finds semantically relevant notes, not random ones
- β CPU-only β No GPU required, runs on any machine
In semanticVault.py:
USE_MODEL = "openai" # Options: "openai", "gemini", "ollama"Note: Semantic search works with all three providers! The embeddings are generated locally using CPU, then only the most relevant notes are sent to your chosen LLM.
CLI Mode (Command Line):
python3 ./semanticVault.pyAsk your question in the terminal, get AI-driven answers based on your notes.
Web Interface Mode (Recommended):
python3 ./semanticVault.py --webThen open your browser to http://localhost:5000 to access the beautiful web interface!
The web UI features:
- π¨ Modern, responsive design with gradient themes
- π¬ Chat-style interface for natural conversations
- π Real-time statistics (note count, model type)
- β‘ Smooth animations and loading indicators
- π± Mobile-friendly responsive layout
-
First Run: Generates embeddings for all your notes (one-time, ~1-5 minutes depending on vault size)
- Embeddings are cached automatically in
.embeddings_cache/ - Uses lightweight CPU-only model (
all-MiniLM-L6-v2)
- Embeddings are cached automatically in
-
Subsequent Queries:
- Finds the top K most relevant notes using semantic similarity
- Only sends those relevant notes to the LLM (saves costs!)
- Typically finds results in <1 second
-
Automatic Updates: Embeddings are regenerated only when notes change
Performance:
- First run: 10-30 seconds (small vault) to 2-5 minutes (large vault)
- Subsequent queries: Near-instant (uses cached embeddings)
- No GPU needed: Runs efficiently on CPU
Enrich your notes with relevant, AI-suggested tags.
python3 ./auto_tag_generation.pyOptional flags:
| Flag | Description |
|---|---|
--dry-run |
Preview changes, no files modified |
--force |
Overwrite all existing tags with new ones |
Edit tag_generation.py:
VAULT_PATH = "/path/to/your/obsidian/vault"
USE_MODEL = "openai" # or "gemini" or "ollama"β Tags are inserted in YAML frontmatter β ideal for Obsidian users.
Prefer privacy or offline capabilities? Run fully local models with Ollama.
curl -fsSL https://ollama.com/install.sh | shFor Linux/macOS or check latest guides on ollama.com.
Examples:
ollama run mistral
ollama run llama3Edit:
USE_MODEL = "ollama"
OLLAMA_MODEL = "mistral"Supports lightweight, privacy-friendly models locally.
- Full-featured Obsidian Plugin (Separate project)
- Persistent chat mode to refine questions without losing context
- More advanced tag generation modes
- CLI improvements and advanced filters
- Custom embedding models and fine-tuning options
Open to contributions β PRs, issues, suggestions welcome!
MIT License β Free to use, modify, and distribute.
- OpenAI
- Google Gemini
- Ollama
- Sentence Transformers (for semantic search embeddings)
- Inspired by Obsidian Copilot

