by suniyao
Creates a semantic graph based on content similarity using vector embeddings.
Graphene - A Semantic Graph View for Obsidian Based on Content Similarity Using Vector Embeddings
Graphene transforms your Obsidian vault into an interactive, semantic knowledge graph. Unlike the standard graph view which only shows explicit links, Graphene uses vector embeddings to discover and visualize hidden connections between your notes based on their content similarity.
Key Features
- Semantic Connections: Visualizes content similarity as dotted lines, revealing relationships you didn't explicitly link.
- Hybrid Visualization: Combines standard wikilinks (solid lines) with semantic similarity (dotted lines) in a single view.
- Interactive Physics: Powered by D3.js, featuring a responsive force-directed layout you can tweak in real-time.
- Smart Embeddings: Optimizes token usage by choosing processed word limit and initial word skipping, saving costs and processing time.
- Granular Control:
- Adjust connection thresholds.
- Customize physics (repulsion, link distance, center force).
- Toggle tags, arrows, and animations.
- Native Obsidian-style sliders for fine-tuning.
Installation
Manual Installation
- Clone this repo to your vault's
.obsidian/plugin/directory. - Reload Obsidian and enable Graphene in Community Plugins.
This plugin is yet not featured in Obsidian plugin directory, but we are actively working on it (and waiting for the queue to be reviewed)!
Setup & Configuration
To power the semantic connections, Graphene needs to generate vector embeddings for your notes. You can choose between Ollama (local, free) or OpenAI (cloud, paid).
Option 1: Ollama (Recommended - Free & Private)
Ollama runs entirely on your machine with no API costs.
- Install Ollama: Download from ollama.ai
- Pull an embedding model:
ollama pull nomic-embed-text - Configure Plugin:
- Go to Settings > Graphene
- Select Ollama (local) as the embedding provider
- Default endpoint is
http://localhost:11434(change if needed) - Default model is
nomic-embed-text
- Generate Embeddings: Click Generate all in the settings
Popular Ollama embedding models:
nomic-embed-text- Good balance of speed and quality (768 dimensions)mxbai-embed-large- Higher quality (1024 dimensions)all-minilm- Fastest, smaller model (384 dimensions)
Option 2: OpenAI (Cloud)
- Go to Settings > Graphene
- Select OpenAI (API key required) as the embedding provider
- Enter your OpenAI API Key
- Click Generate all
Usage
Opening the Graph
- Click the Graphene view icon (network dots) in the left ribbon.
- Or use the Command Palette (
Cmd/Ctrl + P) and search for "Graphene: Open graph view".
Controls
The control panel on the right allows you to customize the graph:
- Display: Toggle tags, arrows, and adjust text fading.
- Forces: Tweak the physics engine.
- Repel Force: How much nodes push apart.
- Link Distance: How long the connections are.
- Center Force: How strongly nodes are pulled to the middle.
- Reset: Restore default settings with a single click.
Generating Embeddings
- Go to the plugin settings to see the Embedding status.
- It tracks which files are new, modified, or up-to-date.
- Click Update embeddings to process only the changed files.
Tips:
- If you have a fixed style of notes (e.g., meeting notes), consider using the Skip initial words and Exclude headings from embedding settings to prevent correlation based on template similarity.
- If you have a large vault, adjust the Word limit for embeddings to reduce token usage and speed up embedding generation.
Troubleshooting: To clear all embeddings when encountering issues, use the Clear all embeddings button in settings.
Development
# Clone the repository
git clone https://github.com/suniyao/obsidian-graphene.git
# Install dependencies
npm install
# Start development build
npm run build
# With Hot Reload
npm run dev
For hot reloading during development, install Hot Reload.
License
Native-style graph controls
Graphene uses the native graph's zoom response, square-root node and label scaling, logarithmic text fading, and screen-space link thickness. Display sliders use multipliers (1 is the default); force controls use the native ranges and response curves. Existing saved force settings are converted for display without changing their underlying values. Reset restores the new graph defaults without deleting cached embeddings or changing the similarity threshold.
The panel contains Filters, Groups, Display, Forces, and Embeddings. Filters include tags, attachments, unresolved links, and orphans. Search matches file names, paths, and contents. Color groups match plain text in file names or paths; the first matching group wins. Search and groups do not implement Obsidian's advanced search-query syntax.
The Embeddings section controls semantic links, similarity threshold, links per note (0 means uncapped), adaptive pruning, and particle appearance. Dotted semantic connections remain distinct from solid explicit links. These controls use locally cached embeddings; changing display options does not regenerate vectors.
Run npm test for layout, zoom/display, filter/link, and semantic-link checks. Run npm run build to update the installed plugin bundle.
Contribution
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.