A simple HTTP server that provides a visual web interface to browse and search your memory database.
# Windows
.\scripts\start-web-server.ps1 -MemoryDb "C:/path/to/memory.db" -Port 3000# Set environment variable
export MEMORY_DB="/path/to/memory.db" # Linux/Mac
$env:MEMORY_DB = "C:/path/to/memory.db" # Windows PowerShell
# Start server
node dist/web-server.js
# Optional: Custom port
WEB_PORT=3001 node dist/web-server.js- 🎨 Beautiful gradient UI with card-based layout
- 🔍 Real-time search across all memory content
- 🏷️ Interactive tag cloud with click-to-filter
- 📊 Live statistics (total memories, database size, etc.)
- 📱 Responsive design for mobile and desktop
- Full-text search across memory content
- Filter by tags (click any tag in the cloud)
- Combine search with tag filters
- Clear filters with one click
- Click any memory card to see full content
- View metadata: ID, creation date, hash
- See all associated tags
- Expandable content for long memories
The server provides a RESTful API:
Retrieve memories with optional filters.
Query Parameters:
limit(number): Max results (default: 100, max: 10000)query(string): Search texttag(string): Filter by tag
Example:
curl "http://localhost:3000/api/memories?limit=50&query=azure"Response:
{
"memories": [...],
"count": 25,
"limit": 50
}Get database statistics.
Example:
curl "http://localhost:3000/api/stats"Response:
{
"totalMemories": 1234,
"totalTags": 89,
"databaseSize": "2.5 MB",
"oldestMemory": "2025-01-15T10:30:00.000Z",
"newestMemory": "2025-10-10T05:07:28.786Z"
}Get a specific memory by hash.
Example:
curl "http://localhost:3000/api/memory/abc123def456"Response:
{
"id": 42,
"content": "Memory content here...",
"tags": ["azure", "typescript"],
"createdAt": "2025-10-09T17:22:43.940Z",
"hash": "abc123def456..."
}| Variable | Default | Description |
|---|---|---|
MEMORY_DB |
./memory.db |
Path to SQLite database |
WEB_PORT |
3000 |
HTTP server port |
.\scripts\start-web-server.ps1 `
-MemoryDb "C:/path/to/memory.db" `
-Port 3001The server includes comprehensive error handling:
❌ Error: Port 3000 is already in use
Try a different port: WEB_PORT=3001 node dist/web-server.js
Solution: Use a different port
❌ Error: Database not found at: ./memory.db
Solution: Set MEMORY_DB to the correct path
❌ Failed to initialize database: SQLITE_ERROR
Solution: Check database file permissions and integrity
All requests are logged with timestamps:
[2025-10-10T05:07:28.786Z] GET /
[2025-10-10T05:07:28.834Z] GET /api/stats
[2025-10-10T05:07:28.865Z] GET /api/memories?limit=1000
Press Ctrl+C to gracefully shutdown:
🛑 Shutting down gracefully...
✓ HTTP server closed
✓ Database connection closed
👋 Goodbye!
The server ensures:
- HTTP connections are closed
- Database connections are properly released
- No data corruption during shutdown
- 5-second timeout for forced shutdown if needed
This server is designed for local development use:
- No authentication
- No HTTPS
- CORS enabled for all origins
- Binds to all interfaces (0.0.0.0)
Do NOT expose to the internet without adding:
- Authentication (JWT, OAuth, etc.)
- HTTPS/TLS encryption
- Rate limiting
- Input sanitization
- Firewall rules
- Check if port is in use:
netstat -ano | findstr :3000 - Try a different port:
-Port 3001 - Check database path is correct
- Verify database file is readable
- Check firewall settings
- Try
http://127.0.0.1:3000instead oflocalhost - Check server logs for errors
- Verify server is still running
- Check database actually has memories (use CLI tools)
- Check browser console for JavaScript errors
- Check API endpoint in network tab
- Try refreshing the page
- Reduce search limit (default is 1000)
- Filter by tags to reduce result set
- Consider pagination for large databases
- Sub-millisecond API response times
- 2,000-10,000 ops/sec SQLite with FTS5
- Handles 10,000+ memories smoothly
- Memory-efficient streaming responses
- Optimized prepared statements
Tested and working on:
- ✅ Chrome/Edge 90+
- ✅ Firefox 88+
- ✅ Safari 14+
- ✅ Mobile browsers (iOS Safari, Chrome Android)
src/
web-server.ts # HTTP server implementation
web/
memory-browser.html # Single-page web UI
scripts/
start-web-server.ps1 # PowerShell launcher script
npm run build# Start server
npm run web
# Or with custom config
MEMORY_DB=./test.db WEB_PORT=3001 npm run webPlanned features:
- Pagination for large result sets
- Export filtered results to JSON
- Dark mode toggle
- Authentication/authorization
- HTTPS support
- WebSocket for live updates
- Memory editing interface
- Relationship graph visualization
- Advanced filters (date range, multiple tags)
- Keyboard shortcuts