Local-first, AI-powered note-taking that eliminates the friction of organization.
Dump your thoughts freely. Let AI handle the structure, context, and retrieval.
Why Hathi? · Features · Tech Stack · Setup · Usage
Hathi is built on a simple philosophy:
This means you never have to worry about organizing your notes, typing full sentences, grammar, or formatting. Just dump them and let Hathi organize everything. And when you want to retrieve information from your personal knowledge graph, instead of searching, just ask Hathi!
- 100% local storage - Your notes never leave your machine
- No subscriptions, no servers - Complete data ownership
- Offline-first - Works entirely without internet (except for AI features)
- Privacy-focused - Your thoughts remain private
Stop worrying about:
- ❌ Perfect grammar and formatting
- ❌ Organizing notes into folders
- ❌ Remembering where you saved something
- ❌ Structuring your thoughts before writing
Start focusing on:
- ✅ Capturing ideas instantly as they come
- ✅ Natural language - write however you think
- ✅ Automatic organization - AI tags and categorizes for you
- ✅ Effortless retrieval - just ask Hathi
- Dump - Write anything, anywhere. No formatting needed.
- Let AI structure - Fixes grammar, adds context, identifies TODOs
- Ask when needed - "What should I remember about John?" or "Get me started for today"
- Never search again - Your AI agent finds what you need
Contexts are Hathi's way of organizing notes without manual folder management.
- What are contexts? - Intelligent tags that group related notes
- How to use them? - Wrap any word in double square brackets:
[[meeting]],[[project-alpha]] - Automatic linking - Related notes connect automatically
- Easy editing - Rename contexts anytime; all notes update automatically
Why contexts work: Instead of "Where should I save this?", just write [[work]] or [[ideas]] and it's organized.
As you type context brackets [[, Hathi provides intelligent suggestions based on your existing contexts:
- Fuzzy matching - Type
[[projto see all contexts containing "proj" - Recently used - Most frequently used contexts appear first
- Auto-complete - Use arrow keys and Enter to select suggestions
- Create new - Type a new name and it becomes a new context automatically
This makes referencing existing contexts fast while keeping the option to create new ones seamlessly.
💡 AI-Powered Organization: Hathi's AI can automatically tag your notes with relevant contexts. See Automatic Context Tagging for details.
The journal page treats every date as a context. You can dump all your notes in today's journal without leaving the page. The context linking ensures that the notes are automatically linked to their contexts.
- Today button - Instantly jump to today's journal (keyboard shortcut friendly)
- Date navigation - Browse past and future dates with ease
- Date contexts - Each date (e.g.,
[[2026-01-17]]) is automatically a context - Timeline view - See your day-by-day thought progression
Pro tip: Write meeting notes on their date, then reference them with [[2026-01-17]] from anywhere.
- Double-click to edit - Create new notes or edit existing ones by double-clicking anywhere in the journal
- Markdown support - Format text with standard Markdown syntax
- Auto-closing brackets - Type
[[and get]]automatically positioned - Context suggestions - Start typing
[[projto see matching contexts - Real-time auto-save - Never lose your work, every keystroke is saved
Every note is automatically semantically indexed. When you create or update a note, Hathi generates vector embeddings using a local model—no API calls needed. These embeddings enable powerful semantic search, allowing the AI agent to understand meaning, not just match keywords.
Benefits:
- Semantic organization - Notes are organized by meaning, not just tags
- Intelligent retrieval - Find notes by concept, even with different wording
- Privacy-first - Embeddings generated locally on your machine
- Automatic - Works silently in the background on every note
Write your thoughts freely without worrying about perfect grammar or formatting. Hathi's AI automatically cleans up your notes while preserving your original meaning.
What it does:
- Fixes grammar and punctuation - Transforms fragmented thoughts into proper sentences
- Prettifies as Markdown - Creates structured, readable text with headers, lists, and emphasis
- Adds inline contexts - Automatically inserts
[[context]]tags where applicable - Preserves meaning - Your ideas remain intact, just better expressed
- Works on demand - Click to structure any note when you're ready
Example transformation:
Before: "remember buy milk also finish report tomorrow john meeting 3pm"
After: "Remember to buy milk. Also finish report by tomorrow. John meeting at 3pm."
Think freely, write messily—the AI handles the polish.
Automatically detects action items and extracts due dates from natural language—no need for strict date formats.
Natural Language Date Understanding:
Write dates however you naturally think—the AI understands and converts them to actual deadlines:
- Relative dates: "tomorrow", "next week", "in 3 days"
- Day references: "Monday", "next Friday", "this weekend"
- Casual phrases: "end of week", "by next month", "after lunch"
- Specific dates: "January 25", "on the 30th", "March 15th"
Examples:
- "Call Sarah about the project tomorrow" → Deadline: Jan 20, 2026
- "Remember to review the budget before Friday" → Deadline: Jan 24, 2026
- "Need to finish the presentation by end of week" → Deadline: Jan 26, 2026
- "Don't forget meeting at 3pm tomorrow" → Deadline: Jan 20, 2026 3:00 PM
- "Buy groceries after work" → Detected as TODO (no specific deadline)
The AI automatically identifies the action item, extracts the deadline from your natural language, and tracks it—all without you specifying structured data.
AI automatically analyzes your notes and suggests relevant contexts—building your knowledge graph with every entry.
How it works:
- Learns from your contexts - AI understands your existing context patterns and suggests matches
- Suggests new contexts - Identifies emerging themes and proposes new contexts when appropriate
- Gets smarter over time - The more contexts you have, the better the predictions become
- Automatic enrichment - Each note strengthens connections in your knowledge graph
Example: Write "discussed quarterly targets with Sarah from marketing" and the AI might suggest existing contexts like [[work]], [[marketing]], [[quarterly-review]], or propose new ones like [[sarah]] if it's a new connection.
This ensures your notes are always properly connected, making retrieval effortless without manual organization.
Ask questions naturally and the agent finds relevant notes using semantic search, context filtering, and date ranges. View and edit source notes directly in the chat.
- "Get me started for today" - Surfaces relevant TODOs
- "What should I remember before meeting John?" - Pulls related notes with a quick summary
- "Show me ideas about the product launch" - Semantic search
- "What was decided in last week's meeting?" - Date + context filtering
- "Find notes about authentication" - Conceptual similarity
Conversational: Ask follow-up questions to dig deeper. The agent remembers context throughout the conversation.
- Frontend: Next.js 15 (App Router) + React 19
- Language: TypeScript (full type safety)
- Styling: Tailwind CSS + shadcn/ui components
- State Management: Redux Toolkit with redux-persist
- Database ORM: Drizzle ORM
- Agent: Vercel AI SDK
Hathi uses SQLite as the primary database (PostgreSQL support exists but is optional).
Notes Table (notes):
id(TEXT) - UUID primary keycontent(TEXT) - Note contentkey_context(TEXT) - Primary context for the notetags(TEXT) - JSON array of tagssuggested_contexts(TEXT) - AI-suggested contextsnote_type(TEXT) - Type: 'note', 'todo', etc.embedding(TEXT) - JSON array (768-dim vector for semantic search)embedding_model(TEXT) - Model used for embeddingdeadline(INTEGER) - Unix timestamp for TODOsstatus(TEXT) - TODO status trackingcreated_at,updated_at(INTEGER) - Timestamps
Contexts Table (contexts):
id(TEXT) - UUID primary keyname(TEXT) - Unique context namecreated_at,updated_at(INTEGER) - Timestamps
Notes-Contexts Junction (notes_contexts):
- Many-to-many relationship between notes and contexts
- Enables notes to belong to multiple contexts
- sqlite-vec extension - Efficient vector similarity search
- Configurable embeddings model - By default, the app uses the multilingual-e5-base model that offers 768-dimensional embeddings. You can configure any other model from Hugging Face as long as it is supported by the transformers library.
- Local embeddings - Runs entirely on your machine (HuggingFace Transformers)
Hathi provides a configuration UI accessible directly from the application—no need to edit config files manually! Access all settings from the menu.
Dark Mode Toggle
- Switch between light and dark themes instantly
- Preference is saved locally and persists across sessions
- Optimized for comfortable reading in any lighting condition
Enter to Submit
- Control chat submission behavior in the AI agent
- When enabled: Press Enter to save the note (Shift+Enter for new line)
- When disabled: Press Enter for new line (Shift+Enter to save the note)
Auto Context Suggestions
- Toggle automatic context tagging powered by AI
- When enabled: AI automatically adds the relevant contexts to your note. It prefers your existing contexts, but may add a new context if it finds it highly relevant.
- When disabled: The AI still suggests you the contexts that are relevant to the note. You can double click on the note and accept these suggestions manually.
- Helps build your knowledge graph automatically without manual organization
Hathi currently supports Google Gemini models for the AI features and the Agent. Support for additional providers like OpenAI and Anthropic is planned for future releases.
Setting Up Your API Key
- Get your Google AI API key from Google AI Studio
- Open the Configuration UI in Hathi
- Paste your API key and click "Validate"
- The system confirms if your key is valid and working
Configurable Models
Hathi uses three AI models for different tasks:
- Text Generation Model - Structures notes, fixes grammar, and generates text
- Lite Model - Handles lightweight tasks like context suggestions and TODO extraction (use a cheaper model here to save costs)
- Agent Model - Powers the AI chat agent
You can use the same Gemini model for all three or mix different models based on your needs. For example, use gemini-2.5-flash for the agent and gemini-2.0-flash-lite for the lite model to reduce costs.
Changes save automatically and apply immediately.
- Node.js 18+ (18.17.0 or higher recommended)
- Yarn package manager
- Optional: Google AI API key (for Gemini models)
Hathi includes an automated setup script that handles everything:
chmod +x start.sh
./start.shThat's it! The script handles:
- ✅ Node.js installation (if needed)
- ✅ Dependency installation
- ✅ Environment configuration
- ✅ SQLite database setup
- ✅ Embedding model download (local, no API needed)
- ✅ Application launch
Visit http://localhost:3000 and configure your AI models from the UI.
If you prefer manual control:
yarn installCreate .env.local:
# Database Configuration (SQLite - local file)
USE_DB=sqlite
# Google AI Configuration (Optional - configure from UI)
GOOGLE_AI_API_KEY=your-google-ai-api-key
# AI Provider Configuration
AI_PROVIDER=GEMINI # LLM provider
EMBEDDING_PROVIDER=HUGGINGFACE # Embedding provider (local, no API)
EMBEDDINGS_DIMS=768 # Vector dimensions
# AI Model Configuration (Optional - uses defaults)
GEMINI_TEXT_GENERATION_MODEL=gemini-2.5-flash
GEMINI_TEXT_GENERATION_LITE_MODEL=gemini-2.0-flash-lite
GEMINI_AGENT_MODEL=gemini-2.5-flash
HUGGINGFACE_EMBEDDING_MODEL=intfloat/multilingual-e5-base
# Optional: Performance Logging
LOG_PERF_TO_CSV=false
# Optional: Development Settings
NEXT_PUBLIC_DISPLAY_TOOL_INFO=false # Show AI tool execution info# Run migrations to create tables
yarn db:sqlite:migrate
# Optional: Seed with sample data
yarn db:sqlite:seedFor local embeddings without API calls:
yarn model:downloadThis downloads the HuggingFace model for offline use.
yarn devOpen http://localhost:3000 in your browser.
Configure from UI (Recommended): Set your Google AI API key and select models directly in the app.
Environment Variables (Alternative): Use .env.local to configure models if preferred. UI settings override environment variables.
- Open the app at http://localhost:3000
- Start typing - No signup, no setup, just write
- Add context - Type
[[project-name]]to categorize - Let AI help - Grammar, structure, and TODOs handled automatically
- Click "Today" button to jump to today's date
- Write daily notes - Each date is a context automatically
- Navigate dates - Use date picker to browse past/future entries
- Reference dates - Link to specific days with
[[2026-01-17]]
# Creating contexts (automatic)
[[work]] [[meeting]] [[ideas]]
# Context suggestions (as you type)
Type "[[proj..." → See matching contexts
# Multiple contexts per note
[[project-alpha]] [[urgent]] [[client-meetings]]
Open the chat panel and try:
Daily Planning:
- "Get me started for today"
- "What are my pending tasks?"
- "What's on my agenda?"
Information Retrieval:
- "What should I remember about John?"
- "Show me recent notes about the product launch"
- "What was discussed in yesterday's meeting?"
Date-based Queries:
- "What did I write last week?"
- "Show me notes from January"
- "What happened on [[2026-01-15]]?"
Context Filtering:
- "All notes about [[project-alpha]]"
- "Work-related TODOs"
- "Show me urgent tasks"
- In Journal: Click any note to edit inline
- In Agent Chat: Click source notes to edit directly
- Auto-save: Changes save automatically as you type
- Context updates: Edit context names; all notes update
yarn dev- Start development server with Turbopackyarn build- Build for productionyarn start- Start production serveryarn lint- Run ESLintyarn test- Run tests with Jestyarn test:watch- Run tests in watch mode
yarn db:sqlite:migrate- Run SQLite migrationsyarn db:sqlite:reset- Reset SQLite database and run all migrationsyarn db:sqlite:seed- Seed SQLite with sample datayarn db:sqlite:fresh- Truncate and reseed databaseyarn db:sqlite:tables- List all tablesyarn db:sqlite:schema- Show database schemayarn db:sqlite:data- View table datayarn db:sqlite:overview- Show database overview
yarn validate-config- Validate AI configurationyarn model:download- Download local embedding model
hathi-db/
├── app/ # Next.js App Router
│ ├── actions/ # Server actions
│ │ ├── ai.ts # AI operations (structurize, suggest contexts)
│ │ ├── notes.ts # Note CRUD operations
│ │ └── contexts.ts # Context management
│ ├── agent_tools/ # AI Agent tools
│ │ ├── filter-notes.ts # Advanced note filtering
│ │ ├── semantic-search.ts # Vector similarity search
│ │ └── summarize-notes.ts # Note summarization
│ ├── api/chat/ # Chat API endpoint
│ └── journal/ # Journal page routes
├── components/
│ ├── journal/ # Journal components
│ │ ├── editor/ # Note editor with plugins
│ │ ├── note_card/ # Note display components
│ │ └── date-context-picker.tsx
│ ├── chat/ # AI agent chat interface
│ └── ui/ # shadcn/ui components
├── db/
│ ├── sqlite/ # SQLite implementation
│ │ ├── schema.ts # Database schema
│ │ ├── adapter.ts # Database operations
│ │ └── migrate-runner.ts
│ ├── postgres/ # PostgreSQL (optional)
│ └── types.ts # Shared types
├── lib/
│ ├── ai/ # AI service layer
│ │ ├── gemini.ts # Gemini LLM integration
│ │ ├── huggingface-embedding.ts # Local embeddings
│ │ └── ai-config.ts # Configuration management
│ ├── prompts/ # AI prompts
│ ├── noteUtils.ts # Note manipulation utilities
│ ├── date-utils.ts # Date formatting
│ └── bracketMatchUtils.ts # Context bracket handling
├── store/ # Redux state management
│ ├── notesSlice.ts # Notes state
│ ├── journalSlice.ts # Journal state
│ ├── agentSlice.ts # Agent state
│ └── middleware/ # Persistence middleware
├── hooks/ # Custom React hooks
├── scripts/
│ ├── download-model.js # HuggingFace model downloader
│ └── validate-config.ts # Config validation
└── start.sh # Automated setup script
Hathi uses SQLite with sqlite-vec for local storage:
- Notes table: Stores note content, metadata, and embeddings
- Contexts table: Stores context definitions
- Notes-Contexts junction: Links notes to multiple contexts
- Vector embeddings: 768-dimensional vectors for semantic search
- Similarity search: Uses cosine similarity to find related notes
- Note Creation → Extract contexts with
[[...]]regex - AI Processing → Suggest contexts, detect TODOs, extract deadlines
- Structurization (optional) → Clean up grammar and formatting
- Embedding Generation → Create 768-dim vector (local)
- Storage → Save to SQLite with all metadata
The AI agent uses multiple tools:
- filter_notes: Filter by date, context, type, or content
- semantic_search: Find similar notes using vectors
- summarize_notes: Summarize note collections
- get_filter_options: List available contexts and tags
Enable tool info display:
# In .env.local
NEXT_PUBLIC_DISPLAY_TOOL_INFO=trueOr toggle in browser console:
window.toggleToolInfo();# Reset and seed database
yarn db:sqlite:fresh
# Inspect database
yarn db:sqlite:overview
yarn db:sqlite:schemaEnable CSV logging:
# In .env.local
LOG_PERF_TO_CSV=trueCheck performance_log.csv for operation timings.
Local-First: Privacy, speed, ownership, and offline capability (except AI features).
SQLite: Embedded, portable, fast, with native vector search via sqlite-vec. Zero configuration.
AI-First: Traditional note-taking requires upfront organization and manual search. Hathi inverts this—write freely, AI organizes automatically, and your agent retrieves information naturally.
For basic use: No. Local embeddings work without any API.
For AI features: Yes. You need a Google AI API key for:
- Context suggestions
- Note structurization
- TODO detection
- AI agent chat
Configure it from the UI or set GOOGLE_AI_API_KEY in .env.local.
Yes, completely. All notes are stored in a local SQLite file on your machine. Nothing is sent to any cloud service except:
- AI API calls (if you enable AI features)
- These only send note content for processing, not the entire database
Mostly yes. You can create, edit, browse, and search notes offline with local embeddings. Internet is only needed for AI features (structurization, context suggestions, agent queries).
Very accurate. The system recognizes:
- Explicit keywords: "todo", "remember", "don't forget"
- Action verbs: "call", "email", "buy", "finish"
- Checkbox formats:
[ ],- [ ],* [ ] - Temporal phrases: "tomorrow", "next week", "by Friday"
Due dates are automatically extracted from natural language.
Your data is already in an open format:
- Database: SQLite file at
local.db(use any SQLite browser) - Format: Standard SQL schema, easy to export
- No lock-in: Simple migration to other systems
Simply backup the local.db file (SQLite database). You can:
- Copy it to cloud storage
- Version control with git
- Use any backup solution
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Use TypeScript for type safety
- Use Yarn (not npm or pnpm)
- Follow existing code structure
- Add tests for new features
- Update documentation as needed
This project is licensed under the MIT License.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
See the LICENSE file for full details.
- Next.js - React framework
- Vercel AI SDK - AI integration
- Drizzle ORM - Type-safe database
- shadcn/ui - UI components
- sqlite-vec - Vector search in SQLite
- HuggingFace Transformers - Local embeddings
- Google Gemini - LLM capabilities
Hathi is actively evolving to become an even more powerful AI-powered second brain. Here are the exciting features planned for future releases:
- Scheduled backups - Automatic daily/weekly backup of your local database
- Cloud sync options - Optional integration with cloud storage providers
- Version history - Keep multiple backup versions with restore capabilities
- Cross-device sync - Seamlessly access your notes across multiple devices
- Model Context Protocol support - Enhanced AI agent capabilities through MCP
- Extended tool ecosystem - Access to a broader range of AI tools and services
- Better reasoning - More sophisticated agent interactions and workflows
- Plugin architecture - Community-driven extensions for specialized use cases
Define your own AI workflows and templates for different scenarios:
- Email templates - Generate professional emails with your personal style
- Daily summary templates - Customize how your daily summaries are formatted
- Meeting note templates - Standardized formats for different meeting types
- Content generation - Custom prompts for blogs, reports, or creative writing
- Workflow automation - Chain multiple AI operations with custom prompts
A prompt for each day of the week that can be used by the AI to generate the get me started for today responses. Personalize your weekly workflow for smarter daily summaries:
- Monday setup - "Planning day: Review weekly goals and priorities"
- Wednesday check-ins - "Mid-week review: Assess progress and adjust plans"
- Friday wrap-ups - "Reflection day: Document learnings and plan next week"
- Custom descriptions - Define what you typically do on each weekday
- Smart summaries - AI uses weekday context to generate relevant "get me started" prompts
- Professional redesign - Modern, intuitive interface design
- Accessibility improvements - Better support for screen readers and keyboard navigation
- Mobile optimization - Responsive design for seamless mobile note-taking
- Customizable themes - Multiple color schemes and layout options
- Looking for UI designers - Open to collaboration with talented designers
- Seamless date navigation - Scroll through dates without page reloads
- Performance optimization - Efficient loading of large date ranges
- Smooth transitions - Fluid scrolling experience across months and years
- Date anchoring - Maintain context while browsing historical entries
- Quick navigation - Jump to specific dates while maintaining scroll position
Made with ❤️ for better note-taking





