A powerful command-line note-taking application with semantic vector search capabilities, powered by SQLite and lil-rag for intelligent search.
- ๐ Complete Note Management - Create, edit, delete, and organize notes with powerful CLI tools
- ๐ Website Import - Import web pages as notes with headless browser support and image URL preservation
- ๐ Modern Web Interface - Beautiful, responsive web UI with real-time markdown preview and graph visualization
- ๐ท๏ธ Smart Tagging System - Organize notes with tags, search by tags, and manage tag collections
- ๐ Triple Search Methods - Semantic vector search, traditional text search, and tag-based search
- ๐ Interactive Graph Visualization - Explore relationships between notes with D3.js-powered graph views
- ๐ Fast & Lightweight - Built with Go and SQLite for maximum performance
- ๐ Lil-Rag Integration - Advanced semantic search with project-aware namespacing
- ๐ Smart Search Isolation - Project-scoped search prevents cross-contamination between different note collections
- ๐ง AI-Powered Analysis - Deep analysis with custom prompts and reasoning visibility
- โ๏ธ Advanced Editor Features - Split-pane markdown editor with synchronized scrolling and focus-based behavior
- ๐ ๏ธ Highly Configurable - Customize everything from storage paths to AI models
- ๐ Debug Support - Built-in debugging for troubleshooting and development
- ๐ค MCP Server - Model Context Protocol server for LLM integration (Claude Desktop)
- ๐ Smart Reindexing - Automatic vector index management and optimization
- Installation
- Quick Start
- Configuration
- Web Interface
- CLI Usage
- MCP Server
- Development
- Contributing
- License
- Go 1.22 or higher
- CGO support (for SQLite integration)
- (Optional) Lil-Rag service for enhanced semantic search
- (Optional) Ollama for AI-powered features
# Clone the repository
git clone https://github.com/streed/ml-notes.git
cd ml-notes
# Build the application
make build
# Install to your PATH
sudo make installDownload the latest release from the Releases page.
# Download and extract (Linux/macOS example)
wget https://github.com/streed/ml-notes/releases/latest/download/ml-notes-linux-amd64.tar.gz
tar -xzf ml-notes-linux-amd64.tar.gz
sudo mv ml-notes /usr/local/bin/# Build for current platform
make build
# Install to /usr/local/bin (requires sudo)
make install
# Build and install in one step
make all
# Clean build artifacts
make clean
# Run tests
make test
# Development build with race detector
make devML Notes supports building for multiple platforms:
# Build for all platforms (Linux, macOS, Windows)
make build-all
# Build for specific platforms
make build-linux # Linux AMD64
make build-darwin # macOS (Intel & Apple Silicon)
make build-windows # Windows AMD64
# Create release packages
make releasePlatform Support:
- โ Linux AMD64 - Full native support
- โ macOS Intel (AMD64) - Native and cross-compilation support
- โ macOS Apple Silicon (ARM64) - Native and cross-compilation support
- โ Windows AMD64 - Native and cross-compilation support
Cross-Compilation Notes:
- Cross-compilation requires appropriate toolchains (clang for macOS, mingw for Windows)
- For best results, build natively on target platforms
- CGO is required for sqlite-vec support
- Use
make build-nativefor automatic platform detection
- Initialize configuration:
# Interactive setup (recommended for first-time users)
ml-notes init --interactive
# Or quick setup with defaults
ml-notes init
# Or custom setup with flags
ml-notes init \
--data-dir ~/my-notes \
--ollama-endpoint http://localhost:11434 \
--summarization-model llama3.2:latest \
--enable-summarization- Add your first note:
ml-notes add -t "My First Note" -c "This is the content of my first note"
# Or add a note with tags
ml-notes add -t "Project Ideas" -c "Some great ideas for the next project" --tags "ideas,projects,todo"- List your notes:
ml-notes list- Search with vector similarity:
ml-notes search --vector "machine learning concepts"- Search by tags:
ml-notes search --tags "projects,ideas"- Start the web interface:
ml-notes serve
# Open http://localhost:21212 in your browserML Notes stores its configuration in ~/.config/ml-notes/config.json.
Run the interactive setup:
ml-notes init -iOr configure with flags:
ml-notes init \
--data-dir ~/.local/share/ml-notes \
--ollama-endpoint http://localhost:11434 \
--summarization-model llama3.2:latest \
--enable-summarization| Option | Description | Default |
|---|---|---|
data-dir |
Where notes database is stored | ~/.local/share/ml-notes |
ollama-endpoint |
Ollama API endpoint | http://localhost:11434 |
lilrag-url |
Lil-Rag service endpoint | http://localhost:12121 |
summarization-model |
Model for AI analysis | llama3.2:latest |
enable-summarization |
Enable/disable analysis features | true |
enable-auto-tagging |
Enable/disable AI auto-tagging | true |
max-auto-tags |
Maximum auto-generated tags | 5 |
editor |
Default editor for note editing | Auto-detect |
debug |
Enable debug logging | false |
ML Notes uses Lil-Rag for advanced semantic search with project-aware namespacing:
Project Isolation: Each project directory gets its own search namespace (e.g., ml-notes-myproject), preventing search results from mixing between different projects.
Setup Lil-Rag Service:
# Install and run lil-rag service
go install github.com/stillmatic/lil-rag@latest
lil-rag serve --port 12121
# Configure ML Notes to use lil-rag
ml-notes config set lilrag-url http://localhost:12121Benefits:
- Project Scoping: Search only within your current project's notes
- Cross-Project Isolation: Notes from different projects don't contaminate search results
- Automatic Namespacing: Project directory name automatically determines search scope
- Fallback Support: Gracefully falls back to text search when lil-rag is unavailable
# View current configuration
ml-notes config show
# Update settings
ml-notes config set ollama-endpoint http://localhost:11434
ml-notes config set lilrag-url http://localhost:12121
ml-notes config set summarization-model llama3.2:latest
ml-notes config set enable-auto-tagging true
ml-notes config set max-auto-tags 5
ml-notes config set editor "code --wait"
ml-notes config set debug trueML Notes includes a modern, responsive web interface that provides an intuitive way to manage your notes, visualize relationships, and edit content with a powerful markdown editor.
# Start the web server on default port (21212)
ml-notes serve
# Start on specific host and port
ml-notes serve --host 0.0.0.0 --port 3000
# Access the web interface
open http://localhost:21212- Focus-Based Split Pane: Editor automatically appears when you focus on editing areas
- Real-Time Preview: Live markdown rendering with synchronized scrolling
- Auto-Scroll: Preview automatically follows your cursor when typing extends the editor
- Smooth Transitions: Elegant animations for pane resizing and focus changes
- Visual tag display with removal capabilities
- Tag input with comma-separated support
- Filter notes by tags using the sidebar dropdown
- Auto-tagging integration with AI-powered suggestions
- Real-time search as you type
- Vector search integration for semantic similarity
- Tag-based filtering
- Search results with content previews
- Sidebar with all notes and metadata
- Chronological organization with creation dates
- Active note highlighting
- Quick navigation between notes
- Light and dark theme toggle
- Consistent theming across all components
- Paper-like texture for comfortable reading
- Responsive design for all screen sizes
- One-click auto-tagging for notes
- AI-powered note analysis with custom prompts
- Integration with Ollama for local AI processing
- Analysis results with thinking process visibility
- D3.js-Powered Visualization: Smooth, interactive graph showing note relationships
- Smart Node Positioning: Isolated notes stay near center, connected notes spread outward
- Connection-Based Sizing: Node size reflects number of connections to other notes
- Tag-Based Relationships: Notes connected by shared tags with weighted connections
- Color-Coded Groups: Different colors for different note clusters/topics
- Zoom and Pan: Scroll to zoom, drag to pan around the graph
- Node Interaction: Click nodes to navigate directly to notes
- Hover Tooltips: See note titles, tags, and connection counts
- Drag Nodes: Manually position nodes by dragging
- Filter Controls: Filter by tag, minimum connections, and maximum nodes displayed
- Filter Panel:
- Filter by specific tags
- Set minimum connection threshold
- Limit maximum nodes displayed
- Zoom Controls: Zoom in/out buttons and fit-to-view
- View Options: Toggle between full graph view and embedded preview
- Reset View: Return to optimal view with one click
- Desktop Experience: Full-featured graph with all controls and interactions
- Mobile Friendly: Simplified interface optimized for touch devices
- Embedded Mode: Compact graph view for the main dashboard
- Performance Optimized: Efficient rendering for large note collections
- Direct Navigation: Click any node to jump to that note
- Context Preservation: Graph remembers position when returning
- Visual Feedback: Selected and hovered nodes are highlighted
- Breadcrumb Integration: Easy return to main interface
| Shortcut | Action |
|---|---|
Ctrl/Cmd + S |
Save current note |
Ctrl/Cmd + N |
Create new note |
Ctrl/Cmd + / |
Toggle theme |
Escape |
Close modals |
The web server supports additional configuration options:
# Enable custom CSS
ml-notes config set webui-custom-css true
# Set default theme
ml-notes config set webui-theme darkThe web server also exposes REST API endpoints:
GET /api/v1/notes- List all notesPOST /api/v1/notes- Create new noteGET /api/v1/notes/{id}- Get specific notePUT /api/v1/notes/{id}- Update noteDELETE /api/v1/notes/{id}- Delete notePOST /api/v1/notes/search- Search notesGET /api/v1/tags- List all tagsGET /api/v1/graph- Get graph data for visualizationPOST /api/v1/auto-tag/suggest/{id}- Get AI tag suggestions
# Interactive mode (opens your editor)
ml-notes add -t "Title"
# With content directly
ml-notes add -t "Title" -c "Content"
# With tags
ml-notes add -t "Project Notes" -c "Important project details" --tags "project,important,todo"
# From stdin
echo "Content" | ml-notes add -t "Title"
# Use specific editor
ml-notes add -t "Code Review" --editor-cmd "code --wait"# List recent notes
ml-notes list
# With pagination
ml-notes list --limit 10 --offset 20
# Short format (ID and title only)
ml-notes list --shortml-notes get <note-id># Edit note in your default editor (includes tags)
ml-notes edit 123
# Edit title only
ml-notes edit -t 123
# Edit content only
ml-notes edit -c 123
# Use a specific editor
ml-notes edit -e "code --wait" 123Note: When editing in your editor, the note format includes tags:
Title: Your Note Title
Tags: tag1, tag2, tag3
---
Your note content goes here
# Delete a single note
ml-notes delete 123
# Delete multiple notes
ml-notes delete 123 456 789
# Skip confirmation prompt
ml-notes delete -f 123
# Delete all notes (use with extreme caution!)
ml-notes delete --all# Import a website as a new note
ml-notes import-url https://blog.example.com/article
# Import with custom tags
ml-notes import-url https://docs.example.com/guide --tags "docs,reference,tutorial"
# Import with AI auto-tagging
ml-notes import-url https://example.com/post --auto-tag
# Import with custom timeout for slow-loading sites
ml-notes import-url https://heavy-site.com --timeout 60sFeatures:
- Headless Browser: Uses Chrome to render JavaScript and dynamic content
- Smart Content Extraction: Prioritizes main content areas (article, main) while filtering out navigation, ads, and sidebars
- Image URL Preservation: Converts relative image URLs to absolute URLs while maintaining external/CDN links
- Markdown Conversion: Clean HTML-to-markdown conversion with proper formatting
- Security-First: Uses secure browser settings with SSL validation for live websites
# List all tags in the system
ml-notes tags list
# Add tags to an existing note
ml-notes tags add 123 --tags "urgent,important"
# Remove specific tags from a note
ml-notes tags remove 123 --tags "old,outdated"
# Replace all tags for a note
ml-notes tags set 123 --tags "research,ai,final"
# Remove all tags from a note
ml-notes tags set 123 --tags ""# Search for notes with specific tags
ml-notes search --tags "project,important"
# Search for notes with any of the specified tags
ml-notes search --tags "research,ai,ml"
# Combine with other search options
ml-notes search --tags "project" --limit 5 --short# Search in titles and content
ml-notes search "golang"
# Limit results
ml-notes search --limit 5 "machine learning"
# Short format showing only IDs and titles
ml-notes search --short "programming"# Semantic similarity search (returns most similar note by default)
ml-notes search --vector "neural networks and deep learning"
# Get top 5 most similar notes
ml-notes search --vector --limit 5 "machine learning concepts"
# Finds related notes even without exact matches
ml-notes search --vector "AI concepts"# Search by single tag
ml-notes search --tags "research"
# Search by multiple tags (finds notes with ANY of these tags)
ml-notes search --tags "project,important,urgent"
# Combine tag search with limits and formatting
ml-notes search --tags "ai,ml" --limit 10 --short
# Tag-only search (no text query needed)
ml-notes search --tags "todo"ML Notes automatically isolates search results by project directory:
# In /home/user/project1
ml-notes search --vector "machine learning" # Searches ml-notes-project1 namespace
# In /home/user/project2
ml-notes search --vector "machine learning" # Searches ml-notes-project2 namespace# Enable for current command
ml-notes --debug search --vector "test"
# Enable persistently
ml-notes config set debug true# Analyze a single note
ml-notes analyze 123
# Analyze multiple notes together
ml-notes analyze 1 2 3
# Analyze all notes
ml-notes analyze --all
# Analyze recent notes
ml-notes analyze --recent 10# Focus on technical aspects
ml-notes analyze 123 -p "Focus on technical implementation details"
# Analyze all notes with a specific tag
ml-notes search --tags "research" --analyze -p "Summarize research findings"
# Extract insights and patterns
ml-notes analyze --all -p "What are the recurring themes and patterns?"
# Comparative analysis
ml-notes analyze 1 2 3 -p "Compare and contrast these approaches"
# Business-focused analysis
ml-notes analyze --recent 5 -p "What business opportunities are mentioned?"# Analyze search results
ml-notes search --analyze "machine learning"
# Custom analysis of search results
ml-notes search --analyze -p "Focus on practical applications" "algorithms"
# Show both analysis and detailed results
ml-notes search --analyze --show-details "python"- Reasoning Visibility: See the AI's thought process with formatted thinking sections
- Custom Prompts: Target analysis with specific questions or focus areas
- Multi-Note Analysis: Analyze relationships and patterns across multiple notes
- Search Integration: Analyze search results for deeper insights
# Enable/disable analysis features
ml-notes config set enable-summarization true
# Set the analysis model
ml-notes config set summarization-model llama3.2:latest
# View current settings
ml-notes config showML Notes includes a Model Context Protocol (MCP) server that allows LLMs like Claude to interact with your notes programmatically.
Add ML Notes to your Claude Desktop configuration:
-
Open your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/claude/claude_desktop_config.json
- macOS:
-
Add the ML Notes MCP server:
{
"mcpServers": {
"ml-notes": {
"command": "ml-notes",
"args": ["mcp"]
}
}
}- Restart Claude Desktop
The MCP server provides the following tools to LLMs:
- add_note - Create a new note with title, content, and optional tags
- get_note - Retrieve a specific note by ID (includes tags)
- update_note - Modify existing note title, content, or tags
- delete_note - Remove a note from the database
- list_notes - List notes with pagination support (shows tags)
- list_tags - List all tags in the system
- update_note_tags - Update tags for a specific note
- search_notes - Search using vector similarity, text matching, or tag search
- Supports semantic vector search, keyword search, and tag-based search
- Configurable result limits
- Automatically uses best search method
- Tag search with comma-separated tag lists
The MCP server exposes these resources:
notes://recent- Get the most recently created notesnotes://stats- Database statistics and configurationnotes://config- Current ML Notes configurationnotes://note/{id}- Access specific note by ID
Pre-configured prompts for common tasks:
- search_notes - Structured search prompt with query parameters
- analyze_notes - Generate AI-powered analysis of your note collection
# Start MCP server (for use with LLM clients)
ml-notes mcp
# The server communicates via stdio for Claude Desktop integrationml-notes/
โโโ cmd/ # CLI commands
โ โโโ root.go # Root command
โ โโโ add.go # Add note command
โ โโโ list.go # List notes command
โ โโโ get.go # Get note command
โ โโโ search.go # Search command
โ โโโ serve.go # Web server command
โ โโโ init.go # Init configuration
โ โโโ config.go # Config management
โ โโโ reindex.go # Reindex embeddings
โ โโโ detect.go # Detect dimensions
โ โโโ mcp.go # MCP server command
โโโ internal/ # Internal packages
โ โโโ api/ # Web server and API endpoints
โ โโโ autotag/ # AI-powered auto-tagging
โ โโโ config/ # Configuration management
โ โโโ database/ # Database operations
โ โโโ embeddings/ # Embedding generation
โ โโโ logger/ # Logging utilities
โ โโโ mcp/ # MCP server implementation
โ โโโ models/ # Data models
โ โโโ search/ # Search implementation
โ โโโ summarize/ # AI analysis features
โโโ web/ # Web interface assets
โ โโโ templates/ # HTML templates
โ โ โโโ index.html # Main web interface
โ โ โโโ graph.html # Graph visualization page
โ โโโ static/ # Static web assets
โ โโโ css/ # Stylesheets
โ โ โโโ styles.css # Main styles
โ โ โโโ themes.css # Theme definitions
โ โโโ js/ # JavaScript
โ โโโ app.js # Main web application
โโโ main.go # Entry point
โโโ go.mod # Go modules
โโโ Makefile # Build automation
โโโ README.md # Documentation
# Get dependencies
go mod download
# Build with CGO
CGO_ENABLED=1 go build -o ml-notes
# Run tests
go test ./...
# Run with race detector
go build -race -o ml-notes-dev# Run all tests
make test
# Run with coverage
make test-coverage
# Run specific package tests
go test ./internal/embeddings/...We welcome contributions! Please see CONTRIBUTING.md for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Lil-Rag Connection:
# Check lil-rag service is running
curl http://localhost:12121/health
# Update endpoint if needed
ml-notes config set lilrag-url http://your-lilrag:12121
# Service falls back to text search if lil-rag unavailableOllama Connection:
# Check Ollama is running
curl http://localhost:11434/api/tags
# Update endpoint if needed
ml-notes config set ollama-endpoint http://your-ollama:11434Debug Information:
# Enable debug mode to see namespace usage
ml-notes --debug search --vector "test"
ml-notes --debug <command>This project is licensed under the MIT License - see the LICENSE file for details.
- Lil-Rag - Advanced semantic search service
- Ollama - Local LLM inference
- SQLite - Reliable embedded database
- Cobra - CLI framework
- ๐ Report bugs
- ๐ก Request features
- ๐ Documentation
Made with โค๏ธ by the ML Notes community