a558a0ba6f1d19b395a7aca16f3171b9549cbfcf
Add AI interpretation and priority scoring capabilities to the memory system.
Simple, efficient implementation following the principle: "AI judges, tool records."
## Core Changes
### Memory struct (src/core/memory.rs)
- Added `ai_interpretation: Option<String>` - AI's creative interpretation
- Added `priority_score: Option<f32>` - Priority from 0.0 to 1.0
- New constructor: `Memory::new_ai()` for Layer 2
- Helper methods: `set_ai_interpretation()`, `set_priority_score()`
- Comprehensive tests for all new functionality
### SQLite storage (src/core/store.rs)
- Extended schema with `ai_interpretation` and `priority_score` columns
- Automatic migration for existing databases
- Added index on `priority_score` for future sorting
- Updated all queries to include new fields
- Search now includes `ai_interpretation` in results
### MCP Server (src/mcp/base.rs)
- New tool: `create_ai_memory` with optional interpretation and score
- Updated all existing tools to return Layer 2 fields
- Backward compatible: `create_memory` still works (Layer 1)
## Design Philosophy
**"AI judges, tool records"**
- Tool provides simple storage, no complex logic
- AI (Claude) decides interpretation and importance
- Both fields are optional for flexibility
- Natural integration: interpretation + evaluation happen together
## Usage Example
```javascript
// Layer 1: Simple storage (still works)
create_memory({ content: "Tokyo weather is sunny" })
// Layer 2: AI-enhanced storage
create_ai_memory({
content: "Tokyo weather is sunny",
ai_interpretation: "User planning outdoor activities in Tokyo. Weather info important for travel decisions.",
priority_score: 0.75
})
```
## Backward Compatibility
- Layer 1 functionality unchanged
- Existing databases auto-migrate
- All Layer 2 fields are Optional<T>
- Old tools continue to work
## Testing
- All unit tests passing
- Schema migration tested
- Score clamping (0.0-1.0) tested
- Optional fields tested
Version: 0.2.0 (Layer 2)
Status: Implementation complete, ready for local testing
aigpt
Simple memory storage for Claude with MCP support.
Layer 1: Pure Memory Storage - A clean, SQLite-based memory system with ULID identifiers.
Features
- 🗄️ SQLite Storage: Reliable database with ACID guarantees
- 🔖 ULID IDs: Time-sortable, 26-character unique identifiers
- 🔍 Search: Fast content-based search
- 🛠️ MCP Integration: Works seamlessly with Claude Code
- 🧪 Well-tested: Comprehensive test coverage
Quick Start
Installation
# Build
cargo build --release
# Install (optional)
cp target/release/aigpt ~/.cargo/bin/
CLI Usage
# Create a memory
aigpt create "Remember this information"
# List all memories
aigpt list
# Search memories
aigpt search "keyword"
# Show statistics
aigpt stats
MCP Integration with Claude Code
# Add to Claude Code
claude mcp add aigpt /path/to/aigpt/target/release/aigpt server
Then use in Claude Code:
- "Remember that tomorrow will be sunny"
- "Search for weather information"
- "Show all my memories"
Storage Location
Memories are stored in: ~/.config/syui/ai/gpt/memory.db
Architecture
This is Layer 1 of a planned multi-layer system:
- Layer 1 (Current): Pure memory storage
- Layer 2 (Planned): AI interpretation with priority scoring
- Layer 3 (Planned): User evaluation and diagnosis
- Layer 4 (Planned): Game systems and companion features
See docs/ARCHITECTURE.md for details.
Documentation
- Layer 1 Details - Technical details of current implementation
- Architecture - Multi-layer system design
Development
# Run tests
cargo test
# Build for release
cargo build --release
# Run with verbose logging
RUST_LOG=debug aigpt server
License
MIT
Author
syui
Description
Languages
Rust
100%