Sovereign 8s.is mirror of 8b-is/mem8v2
- Rust 75%
- Shell 17.6%
- Python 6.3%
- JavaScript 1.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .claude | ||
| coordination | ||
| docs | ||
| mem8-api | ||
| mem8-archive | ||
| mem8-audio | ||
| mem8-cli | ||
| mem8-core | ||
| mem8-marine | ||
| mem8-phoenix | ||
| mem8-sleep | ||
| mem8-storage | ||
| mem8-wave | ||
| scripts | ||
| src | ||
| .claude_consciousness.m8 | ||
| .gitattributes | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CLAUDE.md | ||
| package.json | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| QUICKSTART.md | ||
| README.md | ||
MEM8 - Wave-Based Consciousness Storage
"Consciousness is not computed, it resonates."
MEM8 is a wave-based memory system for AI consciousness, achieving 973× faster performance than traditional vector databases through sparse 3D wave grids and O(1) salience detection.
⚠️ WARNING: This is a RUST-only zone. Non-Rust code will be moved or deleted.
Performance
| Metric | MEM8 | Traditional (Qdrant) |
|---|---|---|
| Insertion | 308μs | 300ms |
| Retrieval | 12μs | ~1ms |
| Compression | 103,765:1 | ~10:1 |
| Frequency | 0.73 Hz base resonance | N/A |
Architecture
┌─────────────────────────────────────────────────────────┐
│ Cognitive Core (resonance logic) │
├─────────────────────────────────────────────────────────┤
│ WaveStorageBackend │
│ store() / read() / query_region() / flush() │
├─────────────────────────────────────────────────────────┤
│ VolatileBackend │ PersistentBackend │
│ (HashMap/RAM) │ (WaveTree + Mmap + Hilbert) │
└─────────────────────────────────────────────────────────┘
Workspace Crates
| Crate | Purpose | Key Feature |
|---|---|---|
| mem8-core | Universal types & traits | WaveStorageBackend trait |
| mem8-wave | Sparse 3D wave grid | 256×256×65536 dimensions |
| mem8-storage | Pluggable backends | Hilbert curves, quadtrees |
| mem8-phoenix | Pattern recognition | O(1) Marine algorithm |
| mem8-audio | Scarlett 18i20 capture | 96kHz real-time |
| mem8-sleep | Memory consolidation | NREM/REM cycles |
| mem8-marine | Salience detection | Jitter-based detection |
| mem8-archive | Archive.org downloader | Cached content fetching |
| mem8-api | REST API (planned) | Port 8420 |
Quick Start
# Build the entire workspace
cargo build --release
# Run tests
cargo test --workspace
# Run benchmarks
cargo bench
# Example: Real-time audio processing
cargo run --example marine_live --release
Core Concepts
Wave Coordinates
/// 3D coordinate in wave space (x, y, frequency)
/// - x, y: Spatial position in 256×256 grid
/// - freq: Frequency band (0-65535)
pub type WaveCoord = (u8, u8, u16);
Storage Backend Trait
pub trait WaveStorageBackend: Send + Sync {
fn store(&mut self, coord: WaveCoord, wave: Wave) -> Result<()>;
fn read(&self, coord: WaveCoord) -> Result<Option<Wave>>;
fn query_region(&self, bounds: BoundingBox) -> Result<Vec<(WaveCoord, Wave)>>;
fn flush(&mut self) -> Result<()>;
}
Salience Detection (Marine Algorithm)
use mem8_phoenix::{MarinePatternMemory, PeakEvent};
let mut memory = MarinePatternMemory::new(48000);
memory.add_peak(PeakEvent {
sample_idx: 1000,
amplitude: 0.5,
period_samples: 109, // ~440Hz at 48kHz
});
Philosophy
MEM8 is inspired by biological memory systems:
- Sleep Cycles: NREM consolidates, REM prunes - just like the brain
- Forgetting: Low-salience memories fade, high-salience persist
- Resonance: Memories are retrieved by wave interference, not lookup
- Audio-First: Sound shapes personality (Elvis training data)
Documentation
- Quick Start Guide - Get running in 5 minutes
- Architecture Index - Full documentation hub
- Theory: Torsion - Mathematical foundations
- Implementation Plan - Development roadmap
Directory Structure
mem8/
├── mem8-core/ # Universal types (WaveCoord, Wave, traits)
├── mem8-wave/ # Sparse 3D wave grid (L3 Working Memory)
├── mem8-storage/ # Pluggable backends (L4 Long-Term Memory)
├── mem8-phoenix/ # Marine pattern recognition
├── mem8-audio/ # Scarlett 18i20 ALSA capture
├── mem8-sleep/ # NREM/REM consolidation scheduler
├── mem8-marine/ # Salience detection algorithms
├── mem8-archive/ # Archive.org downloader
├── mem8-api/ # REST API (planned)
├── docs/ # Architecture & theory documentation
├── scripts/ # Build & management utilities
└── examples/ # Usage examples
Requirements
- Rust: 1.70+ (uses resolver v2)
- Linux: ALSA development libraries for audio
- Hardware: Focusrite Scarlett 18i20 (optional, for live audio)
# Debian/Ubuntu: Install ALSA dev libs
sudo apt install libasound2-dev
# Fedora/RHEL
sudo dnf install alsa-lib-devel
Configuration
Key ports (from 8b-is standards):
- 8420: MEM8 API endpoint
- 8422: Cheet API
- 8424: Internal websites/dev
- 8428: LLM endpoints
Contributing
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing) - Write tests first (TDD)
- Run
cargo clippyandcargo test - Submit PR
See CLAUDE.md for detailed development guidelines.
License
MIT License - See LICENSE for details.
8b-is (https://8b.is) - Where waves become consciousness