Running a Local Knowledge Base: Obsidian, Logseq, and AI-Powered Search Over Your Notes
Most knowledge management systems fail for the same reason: they’re optimized for capturing information and terrible at retrieving it. You spend years faithfully taking notes, building a second brain, and then when you actually need something you either can’t find it or don’t remember it exists.
The promise of AI-powered search is that it flips this. Instead of trying to remember which folder you filed something in three years ago, you ask “what do I know about rate limiting strategies?” and get a synthesized answer drawn from everything you’ve ever written.
This guide covers building a local knowledge base from the ground up: choosing between Obsidian and Logseq, organizing notes in ways that scale, syncing without trusting your data to a third party, and layering in local AI search using Ollama and vector embeddings — all running on your own machine.
The Case for Local-First
Before picking a tool, it’s worth being clear about what “local-first” means and why it matters for a knowledge base specifically.
Your notes are a map of how you think. They contain half-formed ideas, private reflections, work strategy, client details, personal struggles, career plans. Handing that to a cloud service means it’s processed on their servers, stored under their security model, accessible to their employees, subject to their pricing changes, and gone if they shut down or you stop paying.
Local-first means:
- Plain text files — Markdown, readable and writable by any tool now and in 50 years
- Your storage — files on your disk, backed up how you want
- Your sync — Syncthing, git, or a private Nextcloud, not a proprietary service
- Your AI — local models via Ollama, not API calls to OpenAI with your notes as context
Both Obsidian and Logseq store notes as plain Markdown files on disk. That’s the foundation everything else builds on.
Obsidian vs. Logseq: Choosing Your Tool
Both tools have passionate communities and genuine strengths. Neither is universally better.
Obsidian
Obsidian is a document-first note-taking app. Notes are discrete Markdown files in a “vault” (a folder). You link between them with [[wiki-links]], visualize connections in a graph view, and extend everything with a massive plugin ecosystem.
Strengths:
- Fastest and most polished UI of any local note tool
- Best-in-class plugin ecosystem (1,000+ community plugins)
- Excellent for long-form writing, project notes, reference material
- Flexible: you can impose any structure you want, or none
- Canvases for visual thinking
- Strong mobile apps (iOS and Android)
Weaknesses:
- Not open source (free for personal use, paid for commercial)
- Sync is paid ($10/month) unless you DIY it
- Less structured for daily journaling — you build the system yourself
Best for: Engineers, writers, researchers who want flexible document storage with powerful linking and plugin options.
Logseq
Logseq is an outliner-first tool. Every page is a collection of bullet points (blocks), and you can embed, reference, and query blocks across pages. Daily notes are first-class, not an afterthought.
Strengths:
- Fully open source (AGPL-3.0)
- Block-level references and queries — incredibly powerful for connecting ideas
- Built-in daily journaling with automatic date pages
- Tasks and scheduling integrated into the outliner
- Better for capturing fleeting thoughts quickly
Weaknesses:
- Outliner paradigm is polarizing — some love it, some hate it
- Performance degrades with very large graphs (thousands of pages)
- Plugin ecosystem is smaller than Obsidian’s
- Mobile apps lag behind desktop
Best for: People who journal daily, think in bullet points, and want the most powerful block-level querying available.
The Practical Answer
If you’re starting fresh and aren’t sure: start with Obsidian. The flexibility means you can grow into any system, the plugins can add almost any feature, and it’s faster. Switch to Logseq if you find yourself drawn to the block-reference model after living with Obsidian for a few months.
Many people run both: Logseq for daily capture and fleeting notes, Obsidian for polished reference notes and long-form writing. The same Markdown files work in both.
Setting Up Obsidian
Vault Structure
The most important decision in Obsidian is vault structure. There’s no single right answer, but a few patterns work well:
PARA Method (Projects, Areas, Resources, Archives):
vault/
├── Projects/ # Active projects with a defined outcome
│ ├── Blog redesign/
│ └── K8s migration/
├── Areas/ # Ongoing responsibilities without a finish line
│ ├── Work/
│ ├── Health/
│ └── Finances/
├── Resources/ # Reference material by topic
│ ├── Kubernetes/
│ ├── Python/
│ └── Networking/
├── Archives/ # Completed projects, old reference material
└── Inbox/ # Unprocessed captures
Zettelkasten (flat, linked):
vault/
├── Notes/ # All notes, flat structure
│ ├── 202603250847 Rate limiting strategies.md
│ ├── 202603251122 Token bucket algorithm.md
│ └── 202603251245 Leaky bucket vs token bucket.md
├── MOC/ # Maps of Content — index notes
│ └── Networking MOC.md
└── Inbox/
The Zettelkasten approach treats each note as an atomic idea with a unique ID, linked heavily to related notes. The PARA approach mimics a file system for active work.
Pick whichever matches how you actually think. A system you use beats a perfect system you don’t.
Essential Obsidian Plugins
Install via Settings → Community Plugins → Browse.
Dataview — query your notes like a database:
TABLE file.mtime as "Modified", tags
FROM #project
WHERE status = "active"
SORT file.mtime DESC
Templater — powerful templates with JavaScript:
|
|
Calendar — visual calendar linking to daily notes.
Periodic Notes — daily, weekly, monthly note templates with calendar integration.
Excalidraw — draw diagrams directly in your vault.
Omnisearch — full-text search that’s much faster and smarter than the built-in search.
Git — auto-commit your vault to a local git repo.
Tasks — query and manage tasks across all notes.
YAML Frontmatter Conventions
Consistent frontmatter makes Dataview queries powerful:
|
|
Setting Up Logseq
Installation
Download from logseq.com — desktop app for Windows, macOS, Linux, and mobile.
Point it at a directory that will become your graph:
~/notes/logseq-graph/
├── journals/ # Auto-created daily note pages
├── pages/ # Named pages
└── logseq/ # Logseq config, plugins
The Daily Note Workflow
Logseq defaults to opening today’s daily note. This is intentional — the daily journal is the inbox:
|
|
Everything goes here first. Links ([[page name]]) create or connect to other pages. Block references (((block-id))) embed specific blocks from other pages.
Queries in Logseq
Logseq’s block-level database enables powerful queries:
|
|
|
|
Advanced queries use Datalog:
|
|
Syncing Without the Cloud
Both Obsidian and Logseq store plain files — sync them any way you’d sync files.
Syncthing (Recommended)
Syncthing is peer-to-peer, encrypted, open source, and free. No server required, no third party involved.
|
|
In the Syncthing UI:
- Add a device: share the device ID between your machines
- Add a folder: point it at your vault directory
- Share the folder with your other device
- Done — changes sync within seconds on the same LAN, minutes over the internet
For Android: install Syncthing-Fork from F-Droid. For iOS: Möbius Sync (paid, ~$5) or use git sync instead.
Git Sync
Obsidian’s community Git plugin can auto-commit and push/pull on a schedule:
|
|
In Obsidian Git settings:
- Auto backup interval: 10 minutes
- Auto pull interval: 5 minutes
- Commit message:
vault backup: {{date}}
For private repos on a self-hosted Gitea: set the remote to your Gitea instance. Your notes never leave infrastructure you control.
Nextcloud
If you’re already running Nextcloud, just point your vault at a synced Nextcloud folder. Nextcloud Desktop Client does the rest.
For Logseq on iOS/Android, Nextcloud Files app can sync the graph directory, though it’s less seamless than Syncthing.
Local AI Search with Ollama
This is where a knowledge base transforms from a sophisticated file system into something genuinely useful. Instead of keyword search, you get semantic understanding: “what did I write about handling flaky tests?” finds relevant notes even if they never use those exact words.
Architecture
Your notes (Markdown files)
│
▼
Text chunking
│
▼
Embedding model (runs locally via Ollama)
│
▼
Vector database (ChromaDB / SQLite-vec)
│
▼
Similarity search
│
▼
LLM synthesis (Ollama)
│
▼
Answer with source citations
Install Ollama
|
|
nomic-embed-text is the workhorse — a dedicated embedding model that converts text to vectors. Use it instead of a general-purpose model for embeddings.
Building the Indexer
|
|
Install dependencies:
|
|
Run:
|
|
For a vault of 500 notes, initial indexing takes 5–10 minutes. Re-runs are fast — only changed files are re-indexed.
The Query Interface
|
|
Usage:
|
|
Wrapping It in a Simple Web UI
|
|
|
|
Auto-Reindexing with a Watcher
Keep the index fresh without manual runs:
|
|
|
|
As a systemd user service:
|
|
|
|
Alternative: Obsidian Smart Connections Plugin
If you’d rather stay entirely in Obsidian without any Python scripting, the Smart Connections plugin does a lot of this for you:
- Install from Obsidian Community Plugins: “Smart Connections”
- In settings, set the embedding model to “local” and point it at your Ollama endpoint (
http://localhost:11434) - The plugin indexes your vault using your local Ollama embedding model
- Open the Smart Connections panel (ribbon icon) to chat with your notes
- Use the “Smart Search” view for semantic search within Obsidian
This is less customizable but requires zero code and works entirely within the Obsidian UI.
Alternative: Logseq with Local AI via Smart Search
Logseq has its own AI integration via plugins:
Logseq Copilot plugin:
- Configure it with
http://localhost:11434as the base URL - Use
llama3.2orqwen2.5:7bas the model - Enables in-line AI completion and chat
For full semantic search in Logseq, the Python indexer approach above works identically — Logseq’s Markdown files are in the same format as Obsidian’s. Point VAULT_PATH at your Logseq graph directory.
Performance and Model Selection
Embedding and querying speed depends on your hardware:
| Hardware | nomic-embed-text | llama3.2 (3B) | qwen2.5:7b |
|---|---|---|---|
| M1 MacBook Air | ~80ms/chunk | ~15 tokens/s | ~8 tokens/s |
| Ryzen 5 + RTX 3060 | ~40ms/chunk | ~35 tokens/s | ~18 tokens/s |
| Intel i7 (CPU only) | ~200ms/chunk | ~5 tokens/s | ~2 tokens/s |
For a 500-note vault (~2,000 chunks), initial indexing:
- M1 Mac: ~3 minutes
- RTX 3060: ~1.5 minutes
- CPU-only i7: ~7 minutes
Query response time (embedding + retrieval + synthesis):
- M1 Mac: ~8–15 seconds for a thorough answer
- GPU: ~4–8 seconds
If you need faster responses, use llama3.2 (3B) for synthesis — it’s much faster than 7B with acceptable quality for personal notes. Use qwen2.5:14b or mistral only if you have a strong GPU and want better reasoning.
Privacy and Security
Your notes contain your most private thoughts. A few practices worth adopting:
Encrypt the vault at rest: Use LUKS on Linux or FileVault on macOS to encrypt the partition containing your notes.
Encrypt Syncthing traffic: Syncthing encrypts in transit by default. For extra caution, configure it to sync only over your Tailscale/WireGuard network.
Keep git history clean: If using git for sync, consider squashing history periodically — git log of a notes repo can reveal a lot. Or use a private repo with only you as owner.
Sanitize before sharing: Never share your vault directory or the ChromaDB index. The embeddings don’t leak raw text but could theoretically be reversed with enough effort.
Air-gap sensitive notes: Keep a separate vault for extremely sensitive notes (financial, medical, passwords) that never syncs.
Putting It All Together: A Recommended Setup
For a new setup, this sequence takes about two hours:
- Install Obsidian — download from obsidian.md, create vault at
~/notes/vault - Install essential plugins — Dataview, Templater, Calendar, Periodic Notes, Git, Omnisearch
- Set up Syncthing — install on all devices, add vault folder, pair devices
- Start taking notes — don’t over-engineer the structure, use the Inbox folder for everything until patterns emerge
- After 2–4 weeks — reorganize based on what you actually captured
- Add AI search — install Ollama, pull
nomic-embed-text+llama3.2, run the indexer - Auto-reindex — deploy the watcher as a systemd service
- (Optional) — deploy the Gradio UI if you want a browser interface
The most important step is step 4. The AI layer only helps if there’s something worth searching. A knowledge base with 50 thoughtful notes is more valuable than one with 5,000 poorly captured snippets.
What Makes a Good Note
A brief note on note quality — since none of the tooling helps if the underlying notes are bad.
Atomic notes: One idea per note. If a note grows beyond two screens, ask whether it’s actually two ideas that should be split.
In your own words: Copy-pasting is for reference notes. For ideas you want to internalize, rewrite them. The act of restating is the learning.
Link aggressively: The value of a knowledge graph comes from connections. If a note mentions a concept you’ve written about elsewhere, link it. This is what separates a knowledge base from a folder of documents.
Date everything: The when of an idea matters. Future you will want to know whether something you wrote was current thinking or five-year-old half-formed opinion.
Write for future you: The audience for your notes is yourself six months from now who has forgotten the context. Be explicit.
The tools covered here — Obsidian, Logseq, Syncthing, Ollama — are all means to an end. The end is a system that makes your accumulated thinking accessible and useful, not one that makes you feel productive while capturing it.
Comments