Architecture
Database Location
Default path:~/.pro-workflow/data.db
Core Features
Learnings Storage
Persistent memory for corrections, patterns, and rules. Searchable via full-text search with BM25 ranking.
Session Tracking
Track edit counts, correction counts, and prompts per session. Analyze productivity patterns.
FTS5 Search
Fast prefix matching, phrase search, and BM25 relevance scoring. Sub-millisecond queries.
Project Scoping
Filter learnings by project. Share global learnings across projects or keep them isolated.
Schema
Tables
| Table | Purpose |
|---|---|
learnings | Core learning storage with category, rule, mistake, correction |
learnings_fts | FTS5 virtual table for full-text search |
sessions | Session metadata with timing and activity counts |
Indexes
idx_learnings_category— Fast category filteringidx_learnings_project— Fast project scopingidx_learnings_created_at— Chronological queriesidx_sessions_project— Session-by-project lookupsidx_sessions_started_at— Recent sessions
Database Configuration
Custom database location. Must be an absolute path.
SQLite Pragmas
The database is initialized with optimized settings:WAL mode allows multiple readers and one writer simultaneously. Perfect for background hooks and parallel agents.
Triggers
Automatic FTS synchronization via triggers:View Trigger Details
View Trigger Details
API Functions
Initialization
Initialize the database with schema and indexes. Idempotent — safe to call multiple times.
Returns
~/.pro-workflow/data.db. Use for custom configurations.Create
~/.pro-workflow/ if it doesn’t exist. Called automatically by initializeDatabase.Store API
Create a high-level store instance with methods for learnings and sessions.
Example Usage
Next Steps
Learnings API
CRUD operations for learnings storage
Sessions API
Track and query session analytics
Search API
Full-text search with BM25 ranking
Plugin Config
Install the database as a Claude Code plugin