|
| 1 | +# Eggdrop AI v2.0.0 - Vector Memory Release |
| 2 | + |
| 3 | +## 🚀 Major Features |
| 4 | + |
| 5 | +### Vector Memory System |
| 6 | +The bot now has a **complete conversational memory** using vector embeddings and semantic search: |
| 7 | + |
| 8 | +- **Full channel awareness**: Stores ALL channel messages, not just direct mentions |
| 9 | +- **Semantic search**: Finds relevant past messages using vector similarity (Xenova/all-MiniLM-L6-v2) |
| 10 | +- **Hybrid context**: Combines recent messages + semantically similar messages |
| 11 | +- **Chronological ordering**: Context presented in proper timeline for coherent recall |
| 12 | +- **Persistent storage**: SQLite database with sqlite-vec extension for vector operations |
| 13 | +- **Configurable retention**: Default 90-day message retention (configurable or unlimited) |
| 14 | + |
| 15 | +### New Endpoints |
| 16 | + |
| 17 | +- `POST /store` - Passive message storage without LLM response (used for all channel messages) |
| 18 | +- `POST /chat` - Enhanced to retrieve context from vector memory before generating responses |
| 19 | + |
| 20 | +### How It Works |
| 21 | + |
| 22 | +1. **All channel messages** → stored in vector memory via `/store` endpoint |
| 23 | +2. **When mentioned** → bot retrieves relevant context (recent + similar messages) |
| 24 | +3. **LLM response** → generated with full conversational awareness |
| 25 | +4. **Bot remembers** → facts, preferences, and conversations over time |
| 26 | + |
| 27 | +## 🔧 Improvements |
| 28 | + |
| 29 | +### Performance & Reliability |
| 30 | +- Increased API timeout: 30s → 90s (handles slow free tier models) |
| 31 | +- Increased Eggdrop timeout: 45s → 100s |
| 32 | +- Fixed message duplication in context (3x → 2x) |
| 33 | +- Async message storage (doesn't block responses) |
| 34 | + |
| 35 | +### Configuration |
| 36 | +New environment variables for vector memory: |
| 37 | +- `MEMORY_ENABLED` - Enable/disable memory system (default: true) |
| 38 | +- `MEMORY_DB_PATH` - Database file path |
| 39 | +- `MEMORY_TOP_K` - Max similar messages to retrieve (default: 15) |
| 40 | +- `MEMORY_RECENT_COUNT` - Recent messages to include (default: 5) |
| 41 | +- `MEMORY_RETENTION_DAYS` - Message retention period (default: 90) |
| 42 | +- `DEBUG_LOG_REQUESTS` - Log full context sent to LLM (for debugging) |
| 43 | + |
| 44 | +### Model Configuration |
| 45 | +- Increased `max_tokens`: 100 → 300 tokens |
| 46 | +- Updated production model: `xiaomi/mimo-v2-flash:free` |
| 47 | +- System prompt improvements for memory usage |
| 48 | + |
| 49 | +## 📦 Installation Notes |
| 50 | + |
| 51 | +### New Requirements |
| 52 | +```bash |
| 53 | +cd gateway |
| 54 | +npm run setup # Downloads sqlite-vec extension |
| 55 | +``` |
| 56 | + |
| 57 | +On first run, the embedding model (~90MB) will be downloaded automatically. This takes 10-30 seconds and only happens once. |
| 58 | + |
| 59 | +### Upgrading from v1.0.0 |
| 60 | + |
| 61 | +1. **Pull latest code**: |
| 62 | + ```bash |
| 63 | + git pull origin main |
| 64 | + ``` |
| 65 | + |
| 66 | +2. **Install new dependencies**: |
| 67 | + ```bash |
| 68 | + cd gateway |
| 69 | + npm install |
| 70 | + npm run setup # Download sqlite-vec extension |
| 71 | + ``` |
| 72 | + |
| 73 | +3. **Update Eggdrop script**: |
| 74 | + ```bash |
| 75 | + cp eggdrop/eggdrop-ai.tcl /path/to/eggdrop/scripts/ |
| 76 | + ``` |
| 77 | + |
| 78 | +4. **Rebuild and restart gateway**: |
| 79 | + ```bash |
| 80 | + npm run build |
| 81 | + npm start # or restart your systemd/pm2 service |
| 82 | + ``` |
| 83 | + |
| 84 | +5. **Rehash Eggdrop**: |
| 85 | + ``` |
| 86 | + .rehash |
| 87 | + ``` |
| 88 | + |
| 89 | +### Configuration Migration |
| 90 | + |
| 91 | +The `.env` file has new optional variables. Your existing configuration will continue to work with defaults: |
| 92 | + |
| 93 | +```bash |
| 94 | +# Optional - vector memory is enabled by default |
| 95 | +MEMORY_ENABLED=true |
| 96 | +MEMORY_RETENTION_DAYS=90 |
| 97 | +``` |
| 98 | + |
| 99 | +## 📝 Documentation Updates |
| 100 | + |
| 101 | +- Comprehensive README updates explaining vector memory architecture |
| 102 | +- Updated CLAUDE.md with implementation details |
| 103 | +- New troubleshooting sections for memory-related issues |
| 104 | +- Enhanced testing instructions |
| 105 | + |
| 106 | +## 🐛 Bug Fixes |
| 107 | + |
| 108 | +- Fixed TypeScript compilation error with Pipeline type |
| 109 | +- Fixed message duplication causing 3x context repetition |
| 110 | +- Improved error handling for memory system failures |
| 111 | +- Better timeout handling for slow API responses |
| 112 | + |
| 113 | +## 🔍 Example Usage |
| 114 | + |
| 115 | +**Teaching the bot facts:** |
| 116 | +``` |
| 117 | +<user> @bot my favorite color is crimson |
| 118 | +<bot> Noted. |
| 119 | +... many messages later ... |
| 120 | +<user> @bot what's my favorite color? |
| 121 | +<bot> Crimson. |
| 122 | +``` |
| 123 | + |
| 124 | +**Context-aware conversations:** |
| 125 | +``` |
| 126 | +<alice> I'm going to the store |
| 127 | +<bob> Can you get milk? |
| 128 | +<alice> @bot what did bob ask me to get? |
| 129 | +<bot> Milk. |
| 130 | +``` |
| 131 | + |
| 132 | +The bot now maintains full conversational context and can recall information from anywhere in the channel history. |
| 133 | + |
| 134 | +## ⚠️ Breaking Changes |
| 135 | + |
| 136 | +None - this is a backward-compatible release. The memory system is opt-in via environment variables. |
| 137 | + |
| 138 | +## 📊 Performance Impact |
| 139 | + |
| 140 | +- **Storage**: ~1-2KB per message (text + 384-dim vector embedding) |
| 141 | +- **Memory**: ~90MB for embedding model (loaded once on startup) |
| 142 | +- **Response time**: +10-50ms for context retrieval (negligible) |
| 143 | +- **Startup time**: +10-30 seconds on first run (model download) |
| 144 | + |
| 145 | +## 🙏 Credits |
| 146 | + |
| 147 | +Built with: |
| 148 | +- [OpenRouter](https://openrouter.ai/) - LLM API aggregation |
| 149 | +- [transformers.js](https://github.com/xenova/transformers.js) - Embedding model |
| 150 | +- [sqlite-vec](https://github.com/asg017/sqlite-vec) - Vector similarity search |
| 151 | +- [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) - SQLite driver |
| 152 | + |
| 153 | +--- |
| 154 | + |
| 155 | +**Full Changelog**: https://github.com/splinesreticulating/eggdrop-ai/compare/v1.0.0...v2.0.0 |
0 commit comments