A powerful, privacy-focused journal system with AI-powered semantic search and metadata analysis. This system allows you to query your personal journal entries using natural language and analyze patterns in your mood, habits, and thoughts over time.
- π Semantic Search: Query your journal entries using natural language with Rust-powered performance
- π Frontmatter Analysis: Track mood, anxiety, weight, and custom metrics over time
- π¦ Rust Implementation: High-performance indexing and search using native Rust
- π Local Processing: Journal files and search indexing stay on your machine
- β‘ Fast Embeddings: Uses fastembed for efficient vector generation
- π± Cross-Platform: Works on macOS, Linux, and Windows (via WSL)
Choose your platform and run the setup script:
macOS:
./setup_mac_environment.shUbuntu/Debian (including WSL):
./setup_ubuntu_environment.shArch Linux:
./setup_arch_environment.shThese scripts will:
- Install Rust (if needed)
- Install system dependencies
- Build all tools
- Set up convenience scripts
If you prefer manual setup:
Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/envBuild the tools:
# Build the RAG search tools
cd .tech/code/rust_scripts/rag_search
cargo build --release
# Build the frontmatter query tool
cd ../frontmatter_query
cargo build --releaseAdd entries to the journal/ directory using the provided templates:
Daily Entry (template/daily.md):
journal/2025/01/01.md
journal/2025/01/02.md
Weekly Retrospective (template/weekly_retro.md):
journal/2025/week_01_retro.md
Example frontmatter for tracking:
---
date: 2025-01-01
mood: 7
energy: 8
sleep_hours: 7.5
tags: ["work", "learning", "reflection"]
---
# Today's thoughts
Your journal content here...Templates are provided in the template/ directory:
daily.md- Daily journal template with sections for reflectionweekly_retro.md- Weekly retrospective for reviewing progressprompt.md- Guide for configuring your AI assistant persona
The project includes convenient shell scripts for common operations:
# Reindex journal entries (run after adding new entries)
./reindex-rag.sh
# Search your journal
./search-rag.sh "anxiety and sleep patterns"
./search-rag.sh "rust learning journey" -n 10
./search-rag.sh "relationship insights" --after 2025-06-01
./search-rag.sh "debugging professional" --files-only
# Query frontmatter metadata
./query-frontmatter.sh --fields mood anxiety weight_kg
./query-frontmatter.sh --fields mood --start-date 2025-07-01 --stats
./query-frontmatter.sh --fields weight_kg --format csv > weight_data.csvYou can also use the Rust binaries directly:
# Index all journal files
.tech/code/rust_scripts/rag_search/target/release/rag-index \
--journal-dir journal \
--lance-dir .tech/data/lancedb
# Force rebuild the entire index
.tech/code/rust_scripts/rag_search/target/release/rag-index --rebuild
# Index only recent files (since a specific date)
.tech/code/rust_scripts/rag_search/target/release/rag-index --since 2025-01-01# Basic search
.tech/code/rust_scripts/rag_search/target/release/rag-search "productivity tips"
# Search with date filters
.tech/code/rust_scripts/rag_search/target/release/rag-search "anxiety" \
--after 2025-01-01 \
--before 2025-01-31
# Get more results
.tech/code/rust_scripts/rag_search/target/release/rag-search "meditation" --num-results 20
# Output as JSON
.tech/code/rust_scripts/rag_search/target/release/rag-search "goals" --format json# Query specific fields
.tech/code/rust_scripts/frontmatter_query/target/release/frontmatter-query \
--fields mood anxiety weight_kg
# Calculate statistics
.tech/code/rust_scripts/frontmatter_query/target/release/frontmatter-query \
--fields mood anxiety \
--stats
# Export as CSV
.tech/code/rust_scripts/frontmatter_query/target/release/frontmatter-query \
--fields mood weight_kg \
--format csv > mood_weight.csvmarkdown-journal-rust/
βββ README.md # This file
βββ CLAUDE.md # Instructions for Claude Code
βββ setup_mac_environment.sh # macOS setup script
βββ setup_ubuntu_environment.sh # Ubuntu/Debian setup script
βββ setup_arch_environment.sh # Arch Linux setup script
βββ search-rag.sh # Convenient search script
βββ reindex-rag.sh # Reindex journal script
βββ query-frontmatter.sh # Query metadata script
βββ .claude/ # Claude Code integration
β βββ agents/ # Custom AI agents
β βββ commands/ # Slash commands
β βββ settings.json # Claude Code settings
βββ template/ # Journal templates
β βββ daily.md # Daily entry template
β βββ weekly_retro.md # Weekly review template
β βββ prompt.md # AI assistant configuration
βββ journal/ # Your journal entries
β βββ 2025/01/01.md # Daily entries
β βββ topics/ # Topic-based entries
βββ .tech/ # Technical components
βββ code/
β βββ rust_scripts/ # Rust implementations (PRIMARY)
β β βββ rag_search/ # RAG search workspace
β β β βββ rag-index/ # Indexing tool
β β β βββ rag-search/ # Search tool
β β βββ frontmatter_query/ # Metadata analysis tool
β βββ python_legacy/ # Python implementation (DEPRECATED)
β βββ mcp/ # MCP servers
β βββ scripts/ # Python scripts
β βββ LEGACY_README.md # Legacy documentation
βββ data/ # Generated data
βββ lancedb/ # Vector database (Rust)
βββ chroma_db/ # Vector database (Python legacy)
- Rust 1.70+ (install via rustup)
- 4GB RAM
- 2GB free disk space
- 8GB+ RAM for better performance
- SSD storage for faster indexing
Track various metrics in your journal entries:
---
date: 2025-01-01 # Entry date (required)
mood: 7 # 1-10 scale
anxiety: 3 # 1-10 scale
energy: 8 # 1-10 scale
sleep_hours: 7.5 # Hours of sleep
weight_kg: 70 # Weight in kg
exercise_minutes: 30 # Exercise duration
weather: "sunny" # Weather description
tags: ["work", "family"] # Custom tags
---You can customize these fields based on what you want to track.
This project includes enhanced Claude Code integration for a superior development experience:
-
Custom Agents (
.claude/agents/):journal-rag-search: Automatically searches your journal when context is neededjournal-field-completer: Helps complete journal frontmatter fieldsweekly-retro-analyzer: Analyzes weekly retrospectives
-
Slash Commands (
.claude/commands/):/start: Initialize your journaling session/commit: Smart git commits with context
-
Status Line: Real-time token usage tracking (requires
bunx ccusage) -
Automatic Timestamps: Each prompt includes current timestamp for context
- Claude Code will automatically detect the
.claudedirectory - For status line, install ccusage:
npm install -g ccusage - Agents and commands are available immediately
With Claude Code:
- Ask about past events - the RAG agent will search automatically
- Use
/startto begin a new session with context - Use
/commitfor intelligent commit messages
These integrations are optional but recommended for the best experience.
Your journal is just markdown files - sync with any service:
- Git repositories
- Cloud storage (Dropbox, iCloud, etc.)
- Network drives
The LanceDB index (.tech/data/lancedb/) can be rebuilt anytime from your journal files.
- Setup Scripts:
setup_mac_environment.sh,setup_ubuntu_environment.sh,setup_arch_environment.sh - Claude Code Guide:
CLAUDE.md
"Command not found" errors:
- Ensure Rust is installed:
rustc --version - Check if tools are built:
ls .tech/code/rust_scripts/*/target/release/ - Use full paths or create aliases
Indexing issues:
- Ensure journal directory exists and contains .md files
- Check file permissions
- Try rebuilding with
--rebuildflag
Performance issues:
- The first indexing might be slow as models are downloaded
- Subsequent runs use cached models and are much faster
- Consider using fewer results with
--num-results
- Check the documentation files
- Review the
--helpoutput for each tool - Open an issue on GitHub with system details
What stays private (always local):
- Your journal files and content
- Vector embeddings and search indexing
- Frontmatter analysis and statistics
- All file processing and storage
Performance Note: This Rust implementation offers superior search quality and blazing-fast search speeds (<20ms) compared to the Python version. While indexing is slower than the GPU-accelerated Python version, the search results are more accurate and retrieval is nearly instantaneous.
A Python implementation is available in .tech/code/python_legacy/ for compatibility and educational purposes. This includes:
- Original MCP servers for AI agent integration
- ChromaDB-based semantic search
- Python-based frontmatter analysis
Note: The Python implementation is deprecated and not actively maintained. It's provided for:
- Users who need MCP protocol compatibility
- Educational comparison between implementations
- Fallback if Rust setup is problematic
For setup instructions, see .tech/code/python_legacy/LEGACY_README.md.
We strongly recommend using the Rust implementation for all new projects.