A semantic note-taking application with knowledge graph capabilities, powered by SQLite-Vec for vector search and LLM integration for intelligent summarization.
- 🔍 Semantic Search: Find notes using meaning and context, not just keywords
- 🕸️ Knowledge Graph: Automatic relationship detection between notes
- 🧠 LLM Integration: AI-powered summarization and analysis
- 📝 Rich Notes: Support for tags, titles, and content
- 🎯 Interactive UI: Gradio-based web interface for visualization
- 💾 Local-first: SQLite database with vector extensions
- 🚀 Fast: Efficient vector search with sqlite-vec
- Python 3.12+
- OpenAI API key (for LLM features)
-
Create virtual environment:
uv venv --python=3.12 .venv source .venv/bin/activate -
Install dependencies:
uv pip install -r requirements.txt
-
Set up API key:
export OPENAI_API_KEY="your-openai-api-key"
# Test vector database functionality
uv run python test_vec0.py
# Run comprehensive tests
uv run python test_note_graph.pyuv run python demo.pyuv run python gradio_app.pyThe web interface will be available at http://localhost:7860
ruby-chan/
├── note_graph.py # Core NoteGraph class
├── gradio_app.py # Web interface
├── test_note_graph.py # Comprehensive tests
├── test_vec0.py # Vector database tests
├── debug_vec.py # Debug utilities
├── requirements.txt # Dependencies
├── README.md # This file
└── AGENTS.md # Project documentation
from note_graph import NoteGraph
# Initialize the system
ng = NoteGraph("my_notes.db")
ng.init_embedding_model()
ng.init_openai("your-api-key")
# Add a note
note_id = ng.add_note(
"Machine Learning Basics",
"Machine learning enables computers to learn from data...",
["AI", "ML", "Basics"]
)
# Semantic search
results = ng.semantic_search("neural networks", limit=5)
# Get knowledge graph
G = ng.get_knowledge_graph()
# Generate summary
summary = ng.summarize_notes([note_id, other_id])The Gradio interface provides:
- 📝 Add Notes: Create new notes with tags
- 🔍 Search: Semantic and text search
- 🕸️ Knowledge Graph: Interactive visualization
- 📊 Analysis: Note details and AI summaries
Run all tests to verify functionality:
# Vector database tests
uv run python test_vec0.py
# Comprehensive system tests
uv run python test_note_graph.py
## 🔬 Technology Stack
- **Database**: SQLite with sqlite-vec extension
- **Embeddings**: Sentence Transformers (all-MiniLM-L6-v2)
- **Web UI**: Gradio
- **Graph**: NetworkX
- **LLM**: OpenAI GPT-3.5-turbo
- **Visualization**: Plotly
## 📝 API Keys
The system uses OpenAI for:
- Automatic relationship generation
- Note summarization
- Intelligent analysis
Set your API key:
```bash
export OPENAI_API_KEY="sk-..."Uses sqlite-vec for high-performance semantic search:
- 384-dimensional embeddings
- Euclidean distance for similarity
- Sub-second search times
- Supports thousands of notes
Automatically detects relationships between notes:
- Similar: Semantically related content
- Reference: Direct references or citations
- Follow-up: Sequential learning paths
- Contrast: Opposing or alternative views
- Research Notes: Connect academic papers and concepts
- Learning Journal: Track understanding and relationships
- Meeting Notes: Find related discussions and decisions
- Personal Knowledge: Build your second brain
- Documentation: Connect technical concepts and examples
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Submit a pull request
This project is open source and available under the MIT License.
- Tokenizers Warning: Set
TOKENIZERS_PARALLELISM=false - Embedding Size: Ensure all embeddings are 384 dimensions
- API Key: Verify OpenAI key is set correctly
- Memory: Large datasets may need more RAM
Run the debug script to test vector operations:
uv run python debug_vec.py- Install dependencies
- Set up API key
- Launch the web interface
- Start adding notes!
Happy note-taking! 🚀