✅ Overview
Scimax VS Code includes a powerful database and search system that indexes your org, markdown, and Jupyter notebook files. The database provides:
Full-text search with FTS5 (SQLite's Full-Text Search) and BM25 ranking
Semantic search using vector embeddings for meaning-based queries
Hybrid search combining keyword and semantic approaches
Advanced search with query expansion, weighted RRF, and LLM reranking (SOTA)
Structured queries for headings, TODOs, tags, properties, and links
Agenda views for scheduled items and deadlines
Code block search filtered by programming language
The database is built on SQLite (via @libsql/client) with support for vector similarity search, making it both fast and capable of sophisticated semantic queries.
✅ What Gets Indexed
File Types
The database indexes the file types listed in scimax.db.fileExtensions,
which defaults to:
.orgfiles - Org-mode documents.mdfiles - Markdown documents
Add others (e.g. "markdown") to that setting; anything that isn't .org is
parsed as Markdown. The extension and the scimax CLI both read this one
setting. See scimax.db.fileExtensions.
✅ Indexed Content
For each file, the database extracts and indexes:
✅ Headings
Heading text and level (*, **, ***, etc.)
TODO states (TODO, DONE, IN-PROGRESS, etc.)
Priority markers ([#A], [#B], [#C])
Tags (both direct and inherited)
Properties (CUSTOM_ID, CATEGORY, etc.)
Scheduling information (SCHEDULED, DEADLINE, CLOSED)
Line numbers for navigation
✅ Source Blocks
Programming language
Complete code content
Header arguments (:results, :exports, etc.)
Line numbers
For notebooks: cell indices
✅ Links
Link type (file, http, https, id, etc.)
Target path or URL
Optional description text
Line number
✅ Full Text
Complete document content for full-text search
Indexed with FTS5 virtual tables
Porter stemming and Unicode normalization
Here is a hashtag #FullTextSearch
✅ Text Chunks (for Semantic Search)
Document divided into ~2000 character chunks
3-line overlap between chunks for context
Vector embeddings (if embedding service configured)
Line ranges for each chunk
✅ File Watching
The database automatically watches for file changes:
New files are indexed when created
Modified files are re-indexed (debounced with 500ms delay)
Deleted files are removed from the index
Changes are queued and processed sequentially
✅ Ignore Patterns
Some paths are always ignored. This baseline cannot be turned off, because indexing these directories produces duplicates of real notes rather than notes:
| Pattern group | Patterns |
|---|---|
| Dependencies | **/node_modules/** |
| Version control | **/.git/**, **/.hg/**, **/.svn/** |
| Build output | **/dist/**, **/build/**, **/__pycache__/** |
| Notebook checkouts | **/.ipynb_checkpoints/** |
| System | **/.Trash/**, **/Library/Caches/** |
| Editor state | **/Code/User/History/**, **/Code/User/globalStorage/**, |
**/Code/User/workspaceStorage/**, **/Code/agent-host/**, | |
| the same paths for Code - Insiders, VSCodium and Cursor, and | |
**/.vscode/extensions/** | |
| Claude app state | **/Library/Application Support/Claude/** |
Editor state matters most. VS Code's Local History keeps a timestamped copy of
every edit under the original file extension, so a single project.org edited
200 times becomes 200 more .org files in the index — each with its own stale
copy of your TODOs, deadlines and scheduled items, all of which then appear in
the agenda.
scimax.db.exclude adds to this baseline; it does not replace it. That is
deliberate: a VS Code settings array overrides the contributed default outright,
so without a hard floor, adding one personal exclude pattern would silently
re-enable indexing of node_modules and editor history.
If entries that the current rules would reject are already in the database —
after an upgrade that adds a baseline pattern, or after you tighten
scimax.db.exclude — clear them with:
scimax db prune --dry-run # show what would go, grouped by pattern
scimax db prune # remove them
scimax db sync will not do this for you: it keeps a database entry whose file
still exists on disk, so that files added by other means are not lost.
The excludes apply to every way a file reaches the index, not only the directory scan: a save, a file-watcher event or a re-index of an excluded file is skipped, and if the file was indexed before, its entry is dropped.
Choosing What Gets Indexed
By default the index covers four sources: every registered scimax project
(scimax.db.includeProjects), the folders open in VS Code
(scimax.db.includeWorkspace), the journal (scimax.db.includeJournal) and
scimax.db.include. Every folder you open in VS Code is registered as a project
and stays one, so a few broad folders (~/Dropbox, ~/projects) can put far
more in scope than you meant: cloud-drive mirrors, cloned repositories and build
output, each with its own copies of TODOs that then show up in the agenda.
Your home directory and the folders above it (/Users, /) are never
registered automatically when opened, and are never used as indexing roots even
if an older version registered them, since that would index everything under
~.
scimax.db.include takes single .org / .md files as well as folders, in
both the extension and the CLI (scimax db sync).
To index only what you choose, turn off the projects and workspace sources and list the folders and files you want:
{
"scimax.db.include": ["~/Dropbox/projects", "~/Dropbox/proposals", "~/Dropbox/dashboard.org"],
"scimax.db.exclude": ["**/_build/**", "**/_site/**", "**/venv/**"],
"scimax.db.includeJournal": true,
"scimax.db.includeProjects": false,
"scimax.db.includeWorkspace": false
}
How a file gets into the index
| Route | What is indexed |
|---|---|
| The indexed folders | Scanned, watched and kept up to date (scimax.db.include, the journal, ...) |
| Saving a file | That file, wherever it is (opening it is not enough); it stays until removed |
| A file changing on disk | Only if it is in the indexed folders or already in the index |
scimax.db.exclude | Kept out by every route, except a file forced in by its exact path |
So a file you work on outside your folders is indexed when you save it, and
stays up to date after that; files that merely change on disk elsewhere (a
git pull, a build, another program writing files) are left out.
A file beats a folder: Scimax: Always Index File
(cmd:scimax.db.alwaysIndexFile, also on an editor tab's right-click menu)
puts the file's exact path in scimax.db.include, and it is indexed even if
its folder is excluded, e.g. one notes file in an ignored repository.
Scimax: Don't Index File (cmd:scimax.db.ignoreFile) does the opposite
(and takes the file out of scimax.db.include if it was there). The built-in
excludes (node_modules, VS Code's history, ...) apply to every file.
Files outside the indexed folders stay until you remove them. Scimax: Remove
Files Outside Indexed Folders... (cmd:scimax.db.removeOutOfScope) lists
them by folder, all ticked; untick the ones to keep and press Enter to remove
the rest from the index (the files themselves are not touched). It is also the
way to tidy up after narrowing scimax.db.include.
scimax db prune on the command line removes indexed files that match an
exclude pattern.
Search View
C-c d v (cmd:scimax.search.view, Scimax: Search View) opens a search
page beside your files, in the manner of the agenda view. Results update as you
type, from the database, grouped by file with the lines that match.
The Query and the Modes
Type in the query field at the top. Three checkboxes choose how to search; any mix may be on, and a file found by several shows a badge for each:
| Mode | Finds |
|---|---|
| Full text | Lines with the query words (FTS5 syntax: AND, OR, NOT, |
"phrases", prefix*), with stem variants marked | |
| Semantic | Passages close in meaning; needs embeddings (see Semantic |
| Search). Results arrive a moment after the others | |
| Headings | Headings whose title holds every query word |
Full text and Headings are on at first. The Semantic box is greyed out when semantic search is not available, and its tooltip says why. Files are ranked by reciprocal-rank fusion over the modes that found them.
The query and filters are remembered for the next time the view opens. With
text selected on one line, C-c d v starts with that text as the query.
Filters
| Filter | How it works |
|---|---|
| Tags | Click a tag once to require it (✓), again to exclude it (✕), |
| and again to clear it. Inherited tags count | |
| TODO | Same clicks as tags, on the states in the database, plus |
Any open and Any done. Required states are OR'd: a heading | |
| needs one of them. Done means a done state in its file's | |
#+TODO line, or one in scimax.agenda.doneStates | |
| Properties | STATUS=draft, AUTHOR: a key alone means the property is set; |
KEY=value means its value contains the text (any case) | |
| Paths | Comma-separated. Plain text matches anywhere in the path; a |
glob (*.md, notes/**) matches the file name or the path | |
| relative to its workspace folder |
A line counts under the heading it sits in, so tag, TODO and property filters
keep only lines in matching sections. With filters and an empty query, the
view lists the headings that pass them, so requiring Any open with an empty
query lists your open tasks. Clear filters resets them all, and
Database… opens the Database View.
Results
The Sort menu at the bottom orders the files:
| Sort | Order |
|---|---|
| Recently modified | Newest file first (the default) |
| Best match | Reciprocal-rank fusion over the modes |
| File name | By file name, with numbers in numeric order (b9 before b10) |
Recently modified and File name reorder the best matches: the view fetches three times as many files as it shows, then sorts those, so a weak match in a recently edited file can still be left out of a long result list.
Each file shows its name, folder, when it was modified and match badges, then
its hits: the line number, the outline of headings above the line, and the line
with the matches marked. Five hits show per file, with Show N more for the
rest, and More files at the bottom loads another 50 files. Saving an org or Markdown
file runs the search again once the database has reindexed it.
| Key | Action |
|---|---|
↓ or Enter (query) | Move into the results |
n, j, ↓ | Next hit |
p, k, ↑ | Previous hit (↑ on the first goes back up) |
Enter, o | Open the file at the hit, beside the view |
/, Esc | Back to the query |
q | Close the view |
Click a hit to select it and double-click to open it.
✅ Full-Text Search
✅ Overview
Full-text search uses SQLite's FTS5 (Full-Text Search version 5) with:
BM25 ranking - Industry-standard relevance scoring
Porter stemming - Matches word variations (e.g., "run" matches "running")
Unicode normalization - Handles accented characters correctly
Snippet generation - Shows matching context with highlighting
✅ Usage
✅ Query Syntax
FTS5 supports rich query syntax:
✅ Basic Queries
machine learning # Match both words (in any order)
"machine learning" # Match exact phrase
neural OR artificial # Match either word
Boolean Operators
python AND jupyter # Must contain both
python NOT tensorflow # Contains python but not tensorflow
deep OR machine learning # Contains "deep" or the phrase "machine learning"
Prefix Matching
comput* # Matches: computer, computing, computation
data* # Matches: data, database, dataset
Column Queries
title: introduction # Search only in titles
content: python # Search only in content
Proximity Queries
NEAR(neural network, 5) # Words within 5 tokens of each other
Punctuation in Queries
Words with punctuation are searched as phrases, so citation keys, file names and hyphenated words can be typed as they are:
kitchin-2025-beyon-fourt # Same as "kitchin-2025-beyon-fourt"
cite:&kitchin-2025 # Finds the key's text; the cite: prefix is ignored
e-mail c++ # Phrases "e mail" and "c"
Half-typed queries are repaired rather than reported as errors: an
unclosed phrase or parenthesis is closed, a stray ) and a trailing
AND/OR/NOT are dropped. If a query still is not valid, its words are
searched as plain text. title: word and title:word are the same column
filter.
Results
Search results include:
File path and basename
Line number
Preview snippet with <mark> tags highlighting matches
BM25 relevance score
Up to 100 results (configurable)
Example Searches
# Find all references to "gradient descent"
gradient descent
# Find Python-related TODO items
TODO python
# Find documents about data science or machine learning
"data science" OR "machine learning"
# Find recent mentions of TensorFlow (excluding Keras)
tensorflow NOT keras
# Find all documents with "introduction" in title
title: introduction
✅ Semantic Search
✅ Overview
Semantic search finds content by meaning rather than exact words. It uses vector embeddings to represent text in a high-dimensional space where semantically similar content is close together.
Benefits:
Find content even when using different words
Discover related concepts
More natural query language
Example: Searching for "machine learning algorithms" will also find documents about "neural networks", "deep learning models", and "classification methods" even if they don't contain those exact words.
✅ Requirements
Semantic search requires:
Vector search support in libsql - The database must support vector operations
Embedding provider configured - Ollama must be running locally
Files indexed with embeddings - Run scimax.db.reindex after configuring
Checking Availability
Run Scimax: Show Database Stats (scimax.db.stats) to see:
Whether vector search is supported
Number of embeddings stored
Any error messages
If vector search is unavailable, the stats will show:
Semantic search: Unavailable (vector search not supported)
Fallback to Full-Text Search
If semantic search is unavailable, use full-text search (`scimax.db.search') instead. FTS5 is always available and very fast for keyword-based queries.
Embedding Provider
Scimax uses Ollama for embeddings:
Ollama
Pros: Free, private, local control, high quality
Cons: Requires Ollama installed and running
Setup: Install Ollama, then ollama pull nomic-embed-text
Known models and their embedding dimensions:
| Model | Dimensions | Notes |
|---|---|---|
| `nomic-embed-text' | 768 | Default, recommended |
| `all-minilm' | 384 | Smaller, faster |
| `mxbai-embed-large' | 1024 | Larger |
| `snowflake-arctic-embed' | 1024 | Larger |
Any other model name is assumed to produce 768-dimensional vectors.
Changing Models
The vector table is sized for the configured model's dimensions. When you
switch to a model with a different dimension (for example from
nomic-embed-text to all-minilm), Scimax drops the chunks table and
recreates it at the new size. This happens when the new
model takes effect: after Scimax: Configure Embedding Service, or the next
time the database is opened.
All existing embeddings are discarded; run Scimax: Sync Files
(scimax.db.reindex) to re-embed your files with the new model.
✅ Configuration
Interactive Setup
Semantic search is off until you choose a provider: the default
scimax.db.embeddingProvider is none, in VS Code and in the CLI.
Run Scimax: Configure Embedding Service (scimax.db.configureEmbeddings)
This wizard will:
Let you choose a provider
Select a model
Test the connection
Update your settings
Prompt you to reindex files
✅ Manual Configuration
Add to your VS Code settings (settings.json):
Ollama Configuration
{
"scimax.db.embeddingProvider": "ollama",
"scimax.db.ollamaUrl": "http://localhost:11434",
"scimax.db.ollamaModel": "nomic-embed-text"
}
✅ Usage
✅ Command
Run Scimax: Semantic Search or use command scimax.db.searchSemantic
✅ Query Examples
Semantic search uses natural language:
# Conceptual searches
explain neural network architecture
how to optimize database queries
project management best practices
# Related concept discovery
clustering algorithms # Finds: k-means, hierarchical, DBSCAN
data visualization # Finds: matplotlib, charts, plots, graphs
# Question answering
what is gradient descent
how does attention mechanism work
Results
Results include:
File path and line number
Preview (first 200 characters of chunk)
Similarity score (0-100%, higher is more relevant)
Cosine distance (lower is more similar)
Up to 20 results by default
✅ Syncing for Semantic Search
After configuring an embedding provider, run Scimax: Sync Files (scimax.db.reindex). You do not need to rebuild the database:
Sync re-indexes changed files as usual, and also queues embeddings for every indexed file that has none (for example, files indexed before a provider was configured).
Embeddings are generated in the background. The status bar shows
Embeddings: done/total(click it to cancel), and the Database view showsEmbeddings: Generating done/totalunder Search, updating as it goes. Expect roughly one to a few files per second, depending on the provider. You do not need to run Sync again while this runs.Semantic search works on the files embedded so far while the queue runs, and covers all files when it finishes.
Scimax: Rebuild Database (from scratch) (scimax.db.rebuild) is only needed if you want to discard and regenerate everything.
Hybrid Search
Overview
Hybrid search combines full-text (keyword) and semantic (vector) search using Reciprocal Rank Fusion (RRF). This approach:
Gets the best of both worlds
Balances exact matches with conceptual similarity
Provides more robust results
Usage
Command
Run Scimax: Hybrid Search or use command scimax.db.searchHybrid
How It Works
Query runs through both FTS5 and vector search
Results from each are ranked
RRF algorithm combines rankings:
Higher rank in either search boosts result
Results appearing in both searches rank highest
Final results sorted by combined score
Weights
Default weights are 50/50, but can be adjusted:
// Internal API (for extension developers)
db.searchHybrid(query, {
limit: 20,
ftsWeight: 0.5, // 50% weight on keywords
vectorWeight: 0.5 // 50% weight on semantics
});
When to Use Hybrid
Default choice for general searches
When you want both exact matches and related concepts
When query has both specific terms and broad concepts
Example: "python sklearn classification accuracy" - finds both sklearn-specific code and general ML accuracy discussions
Results
Results include:
Combined ranking score
Source indicator (Keywords, AI, or both)
File location and preview
Up to 20 results
✅ Advanced Search (SOTA Pipeline)
Overview
Advanced search implements a state-of-the-art (SOTA) search pipeline inspired by modern search engines like qmd. It combines multiple techniques for maximum recall and precision:
Query Expansion - Generates alternative query formulations
Parallel Retrieval - Runs FTS5 and vector search concurrently
Weighted Reciprocal Rank Fusion (RRF) - Combines results intelligently
LLM Reranking - Uses AI to improve final ranking (optional)
Usage
Command
Run Scimax: Advanced Search (cmd:scimax.db.searchAdvanced)
When to Use
Complex research queries
When you want maximum recall
When hybrid search isn't finding relevant content
For important searches where accuracy matters more than speed
Query Expansion
Query expansion improves recall by generating alternative formulations of your query.
Pseudo-Relevance Feedback (PRF)
No LLM required - Analyzes top results to find related terms.
How it works:
Runs initial search with original query
Extracts key terms from top 5 results
Creates expanded query with additional terms
Searches again with expanded query
Example:
Original: "machine learning"
Expanded: "machine learning neural network training models"
LLM Query Expansion
Requires Ollama - Uses a language model to generate query variants.
How it works:
Sends query to LLM (e.g., qwen3:1.7b)
LLM generates 3 alternative phrasings
All variants searched in parallel
Original query gets 2× weight in ranking
Example:
Original: "database optimization"
Variants:
- "improve SQL query performance"
- "speed up database queries"
- "index tuning for databases"
Weighted RRF
Standard RRF assigns scores based on rank position. Advanced search enhances this with:
Position Bonuses
Top-ranked results get bonuses:
Rank 1: +15% bonus
Rank 2: +10% bonus
Rank 3: +5% bonus
Original Query Weight
The original query's results receive 2× weight compared to expanded query results.
Score Normalization
Different backends produce different score ranges:
BM25: Negative values (normalized to 0-1)
Vector: Cosine distance (converted to similarity)
All scores normalized before fusion
LLM Reranking
Requires Ollama - Uses AI to score relevance after initial retrieval.
How It Works
Takes top 30 candidates from RRF fusion
LLM scores each document's relevance (0-10)
Scores blended with retrieval scores using position-aware weights
Position-Aware Blending
High-confidence retrieval matches are preserved:
Ranks 1-3: 75% retrieval, 25% reranker
Ranks 4-10: 60% retrieval, 40% reranker
Ranks 11+: 40% retrieval, 60% reranker
Performance Considerations
Reranking adds latency (~1-2 seconds for 30 documents). Disable for fast searches.
Capabilities Check
Run Scimax: Show Search Capabilities (scimax.db.searchCapabilities) to see:
✓ Full-Text Search (FTS5/BM25) - Available
✓ Semantic/Vector Search - Available (Ollama)
✓ Query Expansion (PRF) - Available (no LLM required)
✗ Query Expansion (LLM) - Unavailable - check Ollama
✗ LLM Reranking - Unavailable - pull qwen3:0.6b
Graceful Degradation
Advanced search works without all features:
| If Unavailable | Fallback |
|---|---|
| Vector search | FTS-only |
| LLM expansion | PRF-only |
| Reranking | Skip reranking |
| All LLM features | Equivalent to hybrid search |
Configuration
Search Mode
{
"scimax.search.defaultMode": "hybrid", // or "fast", "semantic", "advanced"
"scimax.search.defaultLimit": 20
}
Query Expansion
{
"scimax.search.queryExpansion.enabled": true,
"scimax.search.queryExpansion.method": "prf", // or "llm", "both"
"scimax.search.queryExpansion.prfTopK": 5,
"scimax.search.queryExpansion.prfTermCount": 5,
"scimax.search.queryExpansion.llmModel": "qwen3:1.7b"
}
Reranking
{
"scimax.search.reranking.enabled": false, // Enable for better accuracy
"scimax.search.reranking.model": "qwen3:0.6b",
"scimax.search.reranking.topK": 30,
"scimax.search.reranking.usePositionBlending": true
}
Hybrid Weights
{
"scimax.search.hybrid.ftsWeight": 0.5,
"scimax.search.hybrid.vectorWeight": 0.5,
"scimax.search.hybrid.usePositionBonus": true,
"scimax.search.hybrid.k": 60 // RRF constant
}
Caching
{
"scimax.search.caching.enabled": true,
"scimax.search.caching.ttlSeconds": 900, // 15 minutes
"scimax.search.caching.maxEntries": 500
}
Setting Up LLM Features
To enable query expansion and reranking with Ollama:
Install Ollama: https://ollama.ai
Start Ollama:
ollama servePull models: #+BEGIN_SRC bash ollama pull qwen3:1.7b # For query expansion ollama pull qwen3:0.6b # For reranking #+END_SRC
Enable in settings: #+BEGIN_SRC json { "scimax.search.queryExpansion.method": "both", "scimax.search.reranking.enabled": true } #+END_SRC
Performance Comparison
| Mode | Speed | Recall | Precision | When to Use |
|---|---|---|---|---|
| Fast | <50ms | Low | High | Exact matches |
| Semantic | ~200ms | High | Medium | Conceptual queries |
| Hybrid | ~300ms | High | High | General purpose |
| Advanced | 1-3s | Highest | Highest | Important searches |
Structured Queries
Beyond free-text search, the database supports structured queries for specific content types.
Heading Search
Jump to any indexed heading by typing a few words from it:
Command
Scimax: Search Headings (scimax.db.searchHeadings) — C-c d h
Features
Type space-separated terms; every term must match (case-insensitive substring)
Terms match the heading title, TODO state, tags, or file path, so
todo budgetfinds TODO headings about budgets andefrc aimsfinds "aims" headings in files under anefrcdirectorySearches the whole database as you type (up to 200 results shown), so every indexed heading is reachable
Headings from the most recently modified files are listed first
An empty query lists headings from your most recently modified files
Shows heading level, tags, TODO state, priority, deadlines and scheduled dates
Respects the directory search scope, if one is set
Example Use Cases
# Find all headings about Python
python
# TODO headings mentioning a grant
todo grant
# Headings in a particular project directory
proposals catalysis
# Recently edited headings
<empty query>
Tag Search
Search headings by org-mode tags. This is the closest thing to Emacs
org-tags-view, and it doubles as a way to review the tags you already use.
Command
Scimax: Search By Tag (scimax.db.searchByTag)
Features
Lists every heading tag (
:tag:) in the indexed files.#hashtagshave their own command,scimax.db.searchHashtags.Shows how many headings carry each tag
Sorted alphabetically, ignoring case, so spelling variants such as
:groupmeeting:and:groupmeetings:sit next to each otherPicking a tag lists headings that carry it directly or inherit it
Respects the current search scope (all files or one directory)
Tags displayed as :tagname:
The same tag list feeds scimax.speed.setTags (C-c C-q), which warns when
a new tag looks like one you already use. See
Tag Commands.
Property Search
Search headings by property drawer values:
Command
Scimax: Search By Property (scimax.db.searchByProperty)
Common Properties
CUSTOM_ID # Unique identifiers for linking
ID # Auto-generated UUIDs
CATEGORY # Classification
CREATED # Creation timestamp
MODIFIED # Last modification time
Examples
# Find all entries with CATEGORY property
Property: CATEGORY
Value: <empty>
# Find entries with specific CATEGORY
Property: CATEGORY
Value: research
# Find entries with CUSTOM_ID
Property: CUSTOM_ID
Value: <empty or specific>
TODO Search
Browse and filter TODO items:
Command
Scimax: Show TODOs (scimax.db.showTodos)
Features
Lists all TODO items across workspace
Filter by state (TODO, DONE, IN-PROGRESS, etc.)
Shows priority, tags, scheduling
Excludes DONE and CANCELLED by default in other views
Common TODO States
TODO # Not started
IN-PROGRESS # Currently working on
NEXT # Up next
WAIT # Waiting on something
DONE # Completed
CANCELLED # Abandoned
✅ Source Block Search
Search code blocks by language:
✅ Command
Scimax: Search Code Blocks (scimax.db.searchBlocks). cmd:scimax.db.searchBlocks
✅ Features
Filter by programming language
Optional text search within code
Shows first line of code as preview
Includes both org files and notebook cells
✅ Example Workflow
1. Select language (or "All languages")
2. Optionally enter search text
3. Browse matching code blocks
4. Jump to file location
✅ Hashtag Search
Find files by inline hashtags:
✅ Command
Scimax: Search Hashtags (scimax.db.searchHashtags). cmd:scimax.db.searchHashtags
Features
Lists all hashtags found (`#tagname')
Shows file count per hashtag
Lists every line with the selected hashtag, in every file
Case-insensitive matching
Hashtag Format
A hashtag is # followed by a letter and then letters, digits, _ or -,
at the start of a line or after a space or (. #web-dev, #py3 and
#snake_case are hashtags; URL fragments (page.html#intro), priority
cookies ([#A]) and numbers (#42) are not. Comment lines (# text),
keyword lines (#+TITLE:) and the insides of src, example and export blocks
and Markdown code fences are skipped. A line that starts with #idea is not
an org comment (a comment needs a space after the #), so idea is a
hashtag.
This is a #research note about #MachineLearning
,# Database indexes as
,# research
,# machinelearning
The highlighter, the hover and the database use this same rule. Files indexed
before it was introduced keep their old hashtags until they change or the
database is rebuilt (scimax.db.rebuild).
✅ File Browser
Browse all indexed files:
✅ Command
Scimax: Browse Indexed Files (scimax.db.browseFiles). cmd:scimax.db.browseFiles
✅ Features
Lists all files in database
Shows last indexed date
Sorted by most recently indexed
Displays file type (org, md, ipynb)
✅ Agenda and Time Management
✅ Agenda View
The agenda shows scheduled items and deadlines:
✅ Command
Scimax: Show Agenda (scimax.db.agenda). cmd:scimax.db.agenda
✅ Time Periods
Next 2 weeks (default)
Next month
Next 3 months
All items (no time limit)
✅ Options
Include unscheduled TODOs
Filter by time range
Sorted by urgency (overdue first)
✅ Item Types
✅ Deadline
Items with DEADLINE timestamps:
* TODO Submit report
DEADLINE: <2026-01-20 Mon>
✅ Scheduled
Items with SCHEDULED timestamps:
* TODO Team meeting
SCHEDULED: <2026-01-15 Wed 14:00>
✅ Unscheduled TODOs
Items with TODO state but no scheduling
✅ Deadline View
Show only upcoming deadlines:
Command
Scimax: Show Deadlines (scimax.db.deadlines). cmd:scimax.db.deadlines
✅ Features
Next 2 weeks of deadlines
Overdue items highlighted
Shows days until deadline
Excludes DONE and CANCELLED
Display Format
⚠️ Overdue: Submit TPS Report (3 days ago)
🔔 Today: Code Review
🔔 Tomorrow: Documentation Update
🔔 In 5 days: Project Demo
Date Formats
Scheduling in Org Files
# Simple date
SCHEDULED: <2026-01-20>
# Date with time
SCHEDULED: <2026-01-20 Mon 14:00>
# Date with time range
SCHEDULED: <2026-01-20 Mon 14:00-16:00>
# Deadline with warning period
DEADLINE: <2026-01-20 Mon -3d>
# Closed timestamp
CLOSED: [2026-01-13 Mon 10:30]
Relative Dates
+2w # 2 weeks from now
+1m # 1 month from now
+3d # 3 days from now
+1y # 1 year from now
Search Scope
Limit searches to specific directories:
Commands
Scimax: Set Search Scope (scimax.db.setScope)
Scope Types
All Files (Default)
Searches entire indexed database
Includes all workspace folders
Includes additional configured directories
Current Directory
Limits to active file's directory
Includes subdirectories
Useful for project-focused searches
Current Scope Indicator
The current scope is shown when setting scope:
Search scope: all
Search scope: directory (my-project)
Database View
C-c d i (cmd:scimax.db.view, Scimax: Database View) opens a page about
the database. The Database panel in the sidebar has buttons for it and for the
Search View.
Overview
Cards show the number of files (org and Markdown), headings, source blocks,
chunks, the size of the database file, when a file was last indexed, whether
semantic search is on (and how far the embedding queue has got), the search
scope and the schema version. The path of the database file is below them,
with Reveal to show it in the Finder or Explorer. The numbers update while a
sync or the embedding queue runs; Refresh reads them again.
Actions
Buttons run the database commands: sync, remove files outside the indexed folders, cancel sync, rebuild, optimize, verify, back up, restore and clear (rebuild and clear ask first), and open the Search View, the file browser, the search scope picker and the embedding setup.
Folders and Recent Files
Folders with the most files lists the 15 folders with the most indexed
files. Exclude adds a folder to scimax.db.exclude and offers to remove its
files from the index now. Recently changed files opens a file on click.
Settings
Every scimax.db.* and scimax.search.* setting is listed by section (what
gets indexed, embeddings, syncing, limits, search), with its description and a
control: a checkbox, number or text field, a menu, or a list of entries with
Add (and Browse… for scimax.db.include). Changes save as you make them,
to the workspace settings when the setting is set there and to your user
settings otherwise. A changed setting has a bar at its left and a Reset
link; ⚙ opens it in VS Code's Settings editor. Open settings and
settings.json at the top open the editor and the JSON file. Type in the
filter box to narrow the list.
Database Management
Refreshing the Index
Sync Files (daily use)
Command: Scimax: Sync Files (scimax.db.reindex). cmd:scimax.db.reindex
Scans all configured directories (
scimax.db.includeJournal,includeWorkspace,includeProjects, plusscimax.db.include)Checks file modification times against the database
Only re-indexes changed files
This is the everyday command for picking up edits, especially when syncing across machines via Dropbox.
scimax.db.refreshis the canonical implementation;scimax.db.reindexis the user-facing alias.
Full Rebuild
Command: Scimax: Rebuild Database (from scratch) (scimax.db.rebuild). cmd:scimax.db.rebuild
Wipes the database and re-indexes everything
Use after schema changes or to recover from corruption
✅ Auto-Indexing
{
"scimax.db.autoIndex": true
}
Warning: Disable for very large workspaces (>10,000 files) to prevent memory issues.
Indexing Sources
By default, the database indexes:
Journal directory (
scimax.db.includeJournal: true)Workspace folders (
scimax.db.includeWorkspace: true)Scimax projects (
scimax.db.includeProjects: true)
Add additional directories (or individual .org/.md files) with
scimax.db.include:
{
"scimax.db.include": [
"/home/user/research",
"/home/user/notes",
"/home/user/notes/inbox.org",
"~/Documents/org"
]
}
The Scimax: Configure Agenda Files command
(cmd:scimax.agenda.configure) appends to this list from a folder/file
picker and refreshes the index in one step.
Optimization
✅ Command
Scimax: Optimize Database (scimax.db.optimize). cmd:scimax.db.optimize
Operations
Removes entries for deleted files
Runs VACUUM to reclaim space
Reports the file size before and after, for example
Database optimized: 47.0 GB -> 1.9 GB
Earlier versions kept a vector index on the embeddings that semantic search never used. It could grow to tens of gigabytes and made semantic search take over a minute. The database now drops it when it is opened, which can take a few minutes once on a large database; run optimize afterwards to give the space back.
Should be run periodically (monthly)
VACUUM rewrites the whole file, so a large database needs free disk space about
its own size and can take minutes. The CLI equivalent is scimax db optimize
(close VS Code first). See CLI.
Link indexes
Migration 8 adds indexes on the link targets, so back-link lookups (the CodeLens counts and Find All References) use an index instead of scanning every link. It runs automatically on startup.
Clearing Database
Command
Scimax: Clear Database (scimax.db.clear)
Warning
This is destructive and requires confirmation:
Removes all indexed data
Clears embeddings
Resets statistics
Requires full reindex to restore
When to Clear
Database corruption
Major schema changes
Troubleshooting issues
Fresh start needed
Statistics
Command
Scimax: Show Database Stats (scimax.db.stats)
Information Displayed
Scimax DB: 127 files (98 org, 23 md, 6 ipynb),
1,234 headings, 456 code blocks, 789 links.
Semantic search: Enabled (243 chunks).
Last indexed: 2026-01-13 14:30:00
Stats Include
File count by type
Heading count
Code block count
Link count
Chunk count (for semantic search)
Embedding status
Last index timestamp
Performance Considerations
Indexing Performance
File Size
Small files (<100KB): ~10-50ms
Medium files (100KB-1MB): ~50-200ms
Large files (>1MB): ~200ms-1s
Batch Indexing
100 small files: ~2-5 seconds
1,000 small files: ~20-60 seconds
With embeddings: 2-5x slower
Optimization Tips
Use ignore patterns for large non-content directories
Disable auto-indexing for huge workspaces
Index incrementally (only changed files)
Run optimization monthly
Search Performance
Full-Text Search (FTS5)
Query time: 10-50ms (typical)
Scales well to 10,000+ files
BM25 scoring is highly optimized
Results returned in rank order
Semantic Search
Query time: 50-500ms depending on provider
Local embeddings: slower but private
Ollama: moderate speed
OpenAI: fastest but requires network
Hybrid Search
Query time: Combined FTS + vector time
Typically 100-600ms
Runs searches in parallel
RRF fusion adds ~10ms
Database Size
Typical Sizes
100 files: ~5-10 MB
1,000 files: ~50-100 MB
10,000 files: ~500 MB-1 GB
With Embeddings
+50-100% size increase for chunks and vectors
384-dim embeddings: ~1.5 KB per chunk
768-dim embeddings: ~3 KB per chunk
1536-dim embeddings: ~6 KB per chunk
Memory Usage
Indexing
Base: ~50-100 MB
Peak during large batch: ~200-500 MB
Embedding generation: +100-300 MB
Searching
FTS5: ~10-50 MB
Vector search: ~50-200 MB (loads embeddings)
Minimal memory footprint when idle
Scaling Guidelines
Small Workspace (<100 files)
Enable auto-indexing
Use any embedding provider
Full reindex in seconds
Medium Workspace (100-1,000 files)
Enable auto-indexing
Local or Ollama embeddings recommended
Full reindex in under a minute
Large Workspace (1,000-10,000 files)
Consider disabling auto-indexing
Ollama embeddings recommended
Reindex incrementally
Very Large Workspace (>10,000 files)
Disable auto-indexing (manual reindex)
Use selective directory indexing
Consider multiple smaller databases
Ollama with a fast model recommended
Configuration Reference
Database Settings
scimax.db.includeJournal
Type: boolean
Default: true
Include journal directory in database indexing.
scimax.db.includeWorkspace
Type: boolean
Default: true
Include workspace folders in database indexing.
scimax.db.includeProjects
Type: boolean
Default: true
Include all scimax projects in database indexing.
scimax.db.include
Type: string[]
Default: []
Additional directories or files to index (supports ~ for home directory).
{
"scimax.db.include": [
"/home/user/notes",
"~/Documents/research"
]
}
scimax.db.exclude
Type: string[]
Default: []
Additional patterns or paths to exclude from indexing (globs and absolute
paths). These are added to the always-on baseline described under
Ignore Patterns — you do not need to repeat
**/node_modules/** and friends here.
{
"scimax.db.exclude": [
"**/temp/**",
"**/*.backup.org",
"~/notes/scratch.org"
]
}
`scimax.db.autoIndex'
Type: boolean Default: false
Automatically index workspace on activation. Disable for large workspaces.
{
"scimax.db.autoIndex": true
}
Embedding Settings
`scimax.db.embeddingProvider'
Type: enum Values: "none" | "ollama" Default: "none"
Embedding provider for semantic search. With the default none, semantic
search is off; set it to ollama (or run `Scimax: Configure Embedding
Service') to turn it on.
{
"scimax.db.embeddingProvider": "ollama"
}
`scimax.db.ollamaUrl'
Type: string Default: "http: localhost:11434"
Ollama server URL.
{
"scimax.db.ollamaUrl": "http://localhost:11434"
}
`scimax.db.ollamaModel'
Type: string Default: "nomic-embed-text"
Ollama embedding model name.
{
"scimax.db.ollamaModel": "nomic-embed-text"
}
Command Reference
All Database Commands (C-c d ?)
C-c d ? (cmd:scimax.db.help) lists every database command. The ones
bound under C-c d show their key, and typing it runs the command at once, so
C-c d ? s does what C-c d s does. The commands with no key follow under
More: type to narrow the list and press Enter.
| Key | Action |
|---|---|
d | Database hydra menu |
s | Search all files |
v | Search View |
i | Database View |
h | Search headings |
f | Browse indexed files |
t | Show TODOs |
a | Show agenda |
| - | Code block, hashtag, tag, property, semantic, hybrid and |
| advanced search; deadlines; search scope | |
| - | Refresh, sync, rebuild, cancel sync, auto-scan, remove or |
| ignore files, stats, embeddings, optimize, verify, backup | |
| and restore, clear |
Search Commands
| Command | Description |
|---|---|
| scimax.db.search | Full-text search (FTS5) |
| scimax.db.searchSemantic | Semantic search (vector) |
| scimax.db.searchHybrid | Hybrid search (FTS + vector) |
| scimax.db.searchAdvanced | Advanced search (full pipeline) |
| scimax.db.searchCapabilities | Show search capabilities |
| scimax.db.searchHeadings | Search headings |
| scimax.db.searchByTag | Search by org tag |
| scimax.db.searchByProperty | Search by property value |
| scimax.db.searchBlocks | Search code blocks |
| scimax.db.searchHashtags | Search by hashtag |
View Commands
| Command | Description |
|---|---|
| scimax.db.showTodos | Show TODO items |
| scimax.db.agenda | Show agenda |
| scimax.db.deadlines | Show upcoming deadlines |
| scimax.db.browseFiles | Browse indexed files |
| scimax.search.view | Search View |
| scimax.db.view | Database View |
Management Commands
| Command | Description |
|---|---|
| scimax.db.refresh | Refresh database (incremental) |
| scimax.db.rebuild | Rebuild database (from scratch) |
| scimax.db.optimize | Optimize database |
| scimax.db.clear | Clear database |
| scimax.db.stats | Show database statistics |
| scimax.db.setScope | Set search scope |
| scimax.db.configureEmbeddings | Configure embedding service |
| scimax.db.backup | Backup database to file |
| scimax.db.restore | Restore database from file |
| scimax.db.rebuild | Rebuild database completely |
| scimax.db.verify | Verify database integrity |
✅ Database Maintenance
✅ Backup and Restore
The database can be backed up and restored to prevent data loss and enable migration between machines.
✅ Backup
Command: Scimax: Backup Database (scimax.db.backup)
Creates a portable backup file containing:
All indexed file paths (not file contents)
Project information
Database metadata
Backup is stored in JSON format for portability.
# Example backup location
~/.scimax/backup-2026-01-22.json
✅ Restore
Command: Scimax: Restore Database (scimax.db.restore)
Restores database from a backup file:
Imports project list
Queues files for reindexing
Preserves original creation timestamps
Note: Actual file content must still be reindexed after restore.
✅ Database Rebuild
Command: Scimax: Rebuild Database (scimax.db.rebuild)
Completely rebuilds the database from scratch:
Drops and recreates all tables
Re-scans all configured directories
Regenerates all indexes
Regenerates embeddings (if configured)
Use when:
Database appears corrupted
Major schema changes after update
Switching embedding providers
Performance issues after many incremental updates
Options
| Option | Description |
|---|---|
| Full rebuild | Complete reindex of all files |
| Projects only | Only rebuild project table |
✅ Database Verification
Command: Scimax: Verify Database (scimax.db.verify)
Checks database integrity and freshness:
Checks Performed
File existence - Verifies indexed files still exist on disk
Modification time - Detects files modified since indexing
Index integrity - Validates FTS5 and vector indexes
Project validity - Checks project directories exist
Result Format
Database Verification Results:
- Total files: 127
- Missing files: 2
- Stale files: 5
- Projects: 8 (7 valid, 1 missing)
- Status: NEEDS_REINDEX
Status Values
| Status | Meaning |
|---|---|
| OK | Database is current and valid |
| NEEDS_REINDEX | Some files are stale or missing |
| CORRUPTED | Index integrity check failed |
✅ Project Integration
The database now stores project information, integrated with the Projectile project manager:
Benefits
Projects persist across VS Code restarts
Shared project list between Projectile and Database
Fast project switching using indexed data
Projects can be associated with indexed files
Project Commands
Projects are managed through Projectile commands (C-c p), but the database provides the persistence layer.
See Projectile for project management commands.
Troubleshooting
Semantic Search Not Working
Problem
Semantic search returns no results, shows "unavailable", or displays an error.
If it works but is very slow (tens of seconds) or times out, check the database's size in Scimax: Show Database Stats. A file far larger than your notes is most likely the old vector index (see Optimization); open the database with this version, then run Scimax: Optimize Database.
First: Check Vector Search Support
Run Scimax: Show Database Stats (scimax.db.stats) to see the semantic search status:
| Status Message | Meaning |
|---|---|
| Semantic search: Enabled (N chunks) | Working, N chunks with embeddings |
| Semantic search: Ready (no embeddings) | Supported, but no provider configured |
| Semantic search: Unavailable (error) | Vector search not supported by database |
Embedding Provider Issues
If vector search is supported but not working:
Check embedding provider is configured: scimax.db.embeddingProvider
Test connection: Run Scimax: Configure Embedding Service
Run Scimax: Sync Files after configuring embeddings (it queues files that have no embeddings)
Check console for errors (Help: Toggle Developer Tools)
"Embeddings failed for N file(s)"
When the embedding queue finishes and some files could not be embedded, Scimax shows a warning:
Scimax: embeddings failed for 3 file(s). Last error: <message>
The last error usually points at the cause: Ollama not running, the model not pulled, or a dimension mismatch. Fix the cause and run Scimax: Sync Files again; files without embeddings are queued again.
Files Saved While Being Embedded
Embedding a file can take a few seconds. If you save the file during that time, it is re-indexed and queued for embedding again. The embeddings computed for the old version are discarded rather than stored, so the file ends up embedded from its latest content. This is expected and not an error.
Ollama Issues
Ensure Ollama is running: ollama serve
Pull model: ollama pull nomic-embed-text
Check URL is correct in settings
Test connection: curl http: localhost:11434 api embeddings
Search Returns No Results
Problem
Searches return empty results despite having files.
Solutions
Run Scimax: Show Database Stats to check file count
If files = 0, run Scimax: Sync Files (scimax.db.reindex)
Check file extensions (.org, .md, .ipynb)
Verify files aren't in ignored directories
Check search scope is set to "All files"
Slow Indexing
Problem
Indexing takes very long or appears stuck.
Solutions
Check workspace size (number of files)
Add ignore patterns for large non-content directories
Disable embedding generation if not needed
Index directories incrementally
Check disk I/O and available memory
Database Corruption
Problem
Errors mentioning "database is locked" or "disk I/O error".
Solutions
Close other VS Code windows accessing same workspace
Restart VS Code
Run Scimax: Clear Database and reindex
Check disk space is available
Verify database file permissions
High Memory Usage
Problem
VS Code uses excessive memory during indexing or searching.
Solutions
Disable auto-indexing
Reduce number of indexed directories
Use more aggressive ignore patterns
Clear and reindex database
Restart VS Code between large indexing operations
Examples and Workflows
Research Paper Management
# Organize papers with properties
* TODO Read: Attention Is All You Need
:PROPERTIES:
:CUSTOM_ID: vaswani2017attention
:AUTHOR: Vaswani et al.
:YEAR: 2017
:CATEGORY: research
:END:
#transformers #attention #nlp
SCHEDULED: <2026-01-15 Wed>
# Search by property
Property: CATEGORY
Value: research
# Search by hashtag
#nlp
# Semantic search
transformer architecture papers
Project Todo Management
# Use tags for organization
* TODO Implement login feature :work:backend:
DEADLINE: <2026-01-20 Mon>
* TODO Write API documentation :work:docs:
SCHEDULED: <2026-01-18 Sat>
# Search by tag
:work: -> shows all work items
:backend: -> shows backend tasks
# View agenda
Next 2 weeks -> prioritized by deadline
# Search TODOs
Filter by: TODO (in progress)
Code Snippet Library
# Store reusable code blocks
* Data Processing Utils
#+BEGIN_SRC python
def normalize_data(df):
"""Normalize numeric columns"""
return (df - df.mean()) / df.std()
#+END_SRC
# Search code blocks
Language: python
Query: normalize
# Or semantic search
how to standardize dataframe columns
Personal Knowledge Base
# Use hybrid search for discovery
Query: "improve code performance"
Results will include:
- Exact matches: "code performance" articles
- Related concepts: optimization, profiling, caching
- Similar topics: algorithm efficiency, memory management
# Use properties for metadata
:PROPERTIES:
:CREATED: [2026-01-13 Mon 10:00]
:MODIFIED: [2026-01-13 Mon 15:30]
:CATEGORY: programming
:END:
Best Practices
Indexing Strategy
Start selective - Index specific directories first
Use ignore patterns - Exclude build artifacts and dependencies
Index incrementally - Don't reindex everything on changes
Schedule optimization - Run monthly for large databases
Monitor statistics - Check file counts and sizes regularly
Search Strategy
Start broad - Use semantic or hybrid search for exploration
Refine with keywords - Switch to FTS for specific terms
Use structured queries - Filter by tags/properties when possible
Set scope appropriately - Narrow to directories for focused work
Combine approaches - Use multiple search types for thorough research
Organization Tips
Use consistent tags - Establish tag naming conventions
Add properties - Include metadata for filtering
Set schedules - Use SCHEDULED/DEADLINE for time management
Include hashtags - Quick inline categorization
Write descriptive headings - Better search results
Performance Tips
Disable auto-indexing - For large workspaces (manual trigger)
Choose appropriate embeddings - Balance quality vs. speed
Limit result counts - Don't request thousands of results
Use search scope - Narrow searches to relevant directories
Cache frequent queries - Database has 15-minute result cache
Technical Architecture
Database Schema
Files Table
Tracks indexed files with modification tracking:
path, file_type, mtime, hash, size, indexed_at
Headings Table
Org/markdown headings with full metadata:
level, title, todo_state, priority
tags, inherited_tags, properties
`scheduled', `deadline', `closed'
line_number, begin_pos
Source Blocks Table
Code blocks with language and content:
`language', `content', `headers'
line_number, cell_index
Links Table
All link types (file, http, id, etc.):
link_type, target, description
line_number
Chunks Table
Text chunks for semantic search:
content, line_start, line_end
embedding (F32_BLOB vector)
FTS Content (Virtual Table)
Full-text search index:
file_path, title, content
Porter stemming, Unicode normalization
BM25 ranking support
Indexes
Performance indexes on:
headings.file_id, headings.todo_state
`headings.deadline', `headings.scheduled'
source_blocks.language
`hashtags.tag'
files.file_type
Vector Search
Using libsql's vector functions:
Cosine similarity metric
F32_BLOB storage format
No vector index: each query ranks every chunk with
vector_distance_cos. An exact scan of a few hundred thousand chunks is fast enough, and an index costs far more in disk space and write time than it saves.
Parsers
Org Mode
UnifiedParserAdapter - Full AST parser compatible with org-element:
Recursive heading parsing with inheritance
Property drawer extraction
Timestamp parsing (scheduled, deadline, closed)
Source block with headers
Link extraction
Markdown
Simplified parser:
ATX heading syntax (`#')
Fenced code blocks
Inline links
Jupyter Notebooks
ipynbParser - Notebook-specific parser:
Markdown cells → headings and links
Code cells → source blocks
Cell indices tracked for navigation
Hashtags from markdown cells