Phase 1: Core Library ████████████████████ 100% ✅
Phase 2: Embeddings/Search ████████████████████ 100% ✅
Phase 3: Extension System ████████████████████ 100% ✅
Phase 4: ContextAI ████████████████████ 100% ✅
Phase 5: Multimodal ████████████████████ 100% ✅ ← NEU!
Phase 6: Multi-Platform 🔮 ZUKUNFT (Optional)
Gesamt: ████████████████████ 100% (CXP Library komplett!)
Text-Features:
cxp build /path output.cxp- CXP-Dateien erstellencxp build --embeddings --model <path>- Mit Embeddingscxp info file.cxp- Statistiken anzeigencxp list file.cxp- Dateien auflistencxp extract file.cxp- Dateien extrahierencxp query file.cxp "term"- Keyword-Suchecxp search file.cxp "query"- Semantische Suche- FastCDC Chunking mit Deduplication
- Zstandard Kompression (85% kleiner als JSON!)
- Binary Embeddings (32x kleiner als float32)
- Int8 Embeddings für Rescoring
- HNSW Index mit Hamming Distance
Multimodal-Features (NEU!):
cxp build --images- Bilder mit embeddencxp search --result-type <text|image|all>- Type-Filteringcxp search --image query.jpg- Suche mit Bild- SigLIP 2 ONNX Integration (512-dim Vektoren)
- Cross-Modal Search (Text ↔ Bild)
- Unified HNSW Index für Text + Bilder
- Automatische Bild-Erkennung (png, jpg, jpeg, gif, webp)
ContextAI-Features:
- Extension System für App-Daten
- SQLite → CXP Migration Tool
- Alle SQLite-Tabellen als Rust Structs
- CRUD Methoden für alle Entitäten
- 15/15 Integration Tests bestanden
- Tauri Backend umbauen (CxpState)
- Frontend Integration (React Components)
- SQLite Code entfernen
lib.rs ✅ Public API, Feature Flags
format.rs ✅ CxpBuilder, CxpReader (ZIP Container)
chunker.rs ✅ FastCDC Content-Defined Chunking
dedup.rs ✅ SHA256 Deduplication
compress.rs ✅ Zstandard Compression
manifest.rs ✅ Manifest mit Stats & FileTypes
error.rs ✅ CxpError Enum
embeddings.rs ✅ ONNX Runtime Engine (ort 2.0.0-rc.10)
embeddings_tract.rs ✅ Tract Engine für WASM (tract-onnx 0.22)
index.rs ✅ HNSW Index (usearch 2.15+)
semantic.rs ✅ Embeddings Storage & Serialization
extensions.rs ✅ Extension System
contextai.rs ✅ ContextAI Extension
multimodal.rs ✅ NEU: SigLIP 2 Multimodal Engine
unified_index.rs ✅ NEU: Cross-Modal HNSW Index
Ein offenes, universelles Datenformat für KI-Anwendungen:
- $0 Kosten - Komplett lokal, keine API-Calls
- Überall lauffähig - Rust, WASM, Node.js, Python
- Ersetzt SQLite - Eine Datei statt Datenbank
- Multi-KI Ready - Claude, GPT, Gemini, Llama...
- Zukunftssicher - Erweiterbar für neue Use Cases
- Open Standard - Jeder kann es nutzen/implementieren
CXP wird das "PDF für KI" - ein universelles Format das:
- Jede KI lesen kann
- Semantische Suche built-in hat
- Komplette App-States speichern kann
- Portabel und offline funktioniert
- Ein offener Standard werden kann
ContextAI App - SQLite wird komplett ersetzt durch CXP!
Vorher (SQLite): Nachher (CXP):
├── 7 Tabellen ├── 1 Datei: context.cxp
├── Keyword-Suche ├── Semantische Suche
├── App-gebunden ├── Portabel
└── Nicht teilbar └── Einfach kopieren/teilen
Alle deine Dokumente, Notizen, Code in einer .cxp Datei
→ Frag jede KI Fragen über DEINE Daten
→ Lokal, privat, keine Cloud
my-project.cxp
→ Enthält komplette Codebase mit Embeddings
→ Cursor, Windsurf, Claude Code können es laden
→ "Versteh mein Projekt" in einer Datei
team-knowledge.cxp
→ Team teilt Wissen in einer Datei
→ Neue Mitarbeiter: Datei laden → KI kennt alles
→ Kein Onboarding-Chaos mehr
Alle Apps speichern in .cxp
→ Deine Daten gehören DIR
→ Wechsel zwischen KIs/Apps ohne Datenverlust
→ Interoperabilität zwischen Tools
CXP läuft überall:
cxp/
├── cxp-core/ # Rust Core Library
│ ├── src/
│ │ ├── lib.rs # Public API
│ │ ├── format.rs # CXP Read/Write
│ │ ├── chunker.rs # FastCDC
│ │ ├── embeddings.rs # ONNX Runtime
│ │ ├── index.rs # HNSW Search
│ │ ├── quantize.rs # Binary/Int8
│ │ └── extensions.rs # Namespace System
│ └── Cargo.toml
│
├── cxp-wasm/ # WebAssembly Build
│ └── (Browser, Deno, Cloudflare Workers)
│
├── cxp-node/ # Node.js Bindings (napi-rs)
│ └── (npm package: @cxp/core)
│
├── cxp-python/ # Python Bindings (PyO3)
│ └── (pip package: cxp)
│
├── cxp-cli/ # Standalone CLI
│ └── cxp build, cxp query, cxp export
│
└── schemas/ # FlatBuffers Schemas
├── manifest.fbs
├── embeddings.fbs
└── extensions/
└── contextai.fbs
| Platform | Runtime | Use Case |
|---|---|---|
| Tauri/Desktop | Rust Native | ContextAI App |
| Browser | WASM | Web Apps, PWAs |
| Node.js | napi-rs | CLI Tools, Servers |
| Python | PyO3 | Data Science, ML |
| Deno | WASM | Edge Functions |
| Mobile | Rust FFI | iOS/Android Apps |
files, conversations, chat_messages, context_log,
user_habits, habit_history, watched_folders,
browser_history, custom_dictionarycontext.cxp (ZIP Container)
├── core/ # Standard CXP
│ ├── manifest.fbs # Metadata, Version, Stats
│ ├── embeddings/
│ │ ├── binary.bin # Binary Embeddings (48B/vec)
│ │ ├── int8.bin # Int8 für Rescoring
│ │ └── index.hnsw # HNSW Index
│ ├── chunks/
│ │ └── *.zst # Zstandard komprimiert
│ └── file_map.msgpack # Datei → Chunks
│
└── contextai/ # ContextAI Extension
├── conversations/
│ ├── index.msgpack # Conversation List
│ └── conv_*.msgpack # Individual Conversations
├── habits.msgpack # User Preferences
├── dictionary.msgpack # Custom Terms
├── watched_folders.msgpack
└── settings.msgpack # App Settings
1. CXP Library implementieren
2. ContextAI: SQLite → CXP Adapter
3. Migration Tool: SQLite → CXP Export
4. SQLite Code entfernen
5. Nur noch CXP
| Modell | Size | Dims | Besonderheit |
|---|---|---|---|
| EmbeddingGemma | 308M / ~200MB RAM | 768 (MRL: 512/256/128) | Best-in-class für On-Device, int4 quantized |
| all-MiniLM-L6-v2 | 22M / ~90MB | 384 | Bewährt, schnell |
| BGE-small | 33M | 384 | Multilingual |
Breakthrough: EmbeddingGemma mit Matryoshka (MRL) erlaubt flexible Dimensionen + int4 Quantisierung = 32x kleinere Vektoren!
float32 (384 dims) = 1.5 KB pro Vector
int8 (384 dims) = 384 Bytes (4x kleiner)
binary (384 dims) = 48 Bytes (32x kleiner!)
Strategie:
- Binary Search (48 Bytes) für Vorfilterung
- int8 Rescoring für Top-100
- Optional: Reranking für Top-10
Ergebnis: 95% Qualität bei 32x weniger Speicher!
- Transformers.js v3 mit WebGPU: 64x schneller als WASM!
- Läuft direkt im Browser, keine Server-Kosten
- 70% Browser-Support (Chrome, Edge, Firefox)
- Fallback auf WASM für ältere Browser
- EdgeVec (Rust/WASM): 148KB Bundle, sub-ms Search bei 100k Vectors
- hnswlib-wasm: Browser HNSW mit IndexedDB Persistenz
- USearch: Cross-platform, SIMD-optimiert
| Format | vs JSON | Zero-Copy | Use-Case |
|---|---|---|---|
| FlatBuffers | 80% kleiner | JA | Manifest, schneller Zugriff |
| MessagePack | 70% kleiner | Nein | Flexible Daten |
| Protobuf | 80% kleiner | Nein | Embeddings |
Neu: FlatBuffers für Manifest = Zero-Copy Zugriff ohne Parsing!
- FastCDC mit Gear Hash: O(log N) Chunking
- HOPE Metric: Semantische Unabhängigkeit optimieren
- Hashless CDC: Noch schneller, keine Rolling Hashes
- Halbiert JPEG-XL, FLAC, H.264
- Text: 1/3 der zpaq-Größe
- Aber: Zu compute-intensiv für $0-Ziel
contextpack.cxp (ZIP Container)
├── manifest.fbs # FlatBuffers (Zero-Copy, 5-15KB)
├── embeddings/
│ ├── binary.bin # Binary Embeddings (48B/vector) - Primary
│ ├── int8.bin # Int8 für Rescoring (384B/vector) - Optional
│ └── index.hnsw # HNSW Index (WASM-kompatibel)
├── chunks/
│ └── *.zst # Zstandard komprimiert
├── file_map.msgpack # Datei → Chunks
├── keywords.fst # FST statt Trie (kleiner, schneller)
└── meta.cbor # Zusätzliche Metadaten
Original CXP (Spec): 170MB für 500MB Input
CXP 2.0 (Binary Emb): ~50MB für 500MB Input (70% kleiner!)
Input Files → FastCDC (Gear Hash) → SHA256 Dedup → Chunks
- Rust native
- 100% lokal, keine Dependencies außer Crypto
Chunks → ONNX Runtime → Binary Quantization
- Desktop: ONNX Runtime (native)
- Browser: WebGPU oder WASM
- Model: EmbeddingGemma (200MB, On-Demand)
Binary Embeddings → HNSW Build → .hnsw File
- usearch (Rust native)
- WASM-kompatibel für Browser
Query → Embed → Binary HNSW Search → Int8 Rescore → Top-K
- Alles lokal!
- Keine Server, keine API-Kosten
Lade zuerst: manifest.fbs (5KB) + binary.bin Header
Dann on-demand: Chunks nur wenn gebraucht
→ Instant Start, selbst für GB-große CXP-Dateien
Während User tippt → Query Embedding berechnen
Binary Search startet sofort → Latenz maskiert
Original: data.cxp (50MB)
Update: delta.cxp (500KB) - nur geänderte Chunks
Merge: Lazy, on-demand
CXP ist eine Datei → Torrent, IPFS, lokales Netzwerk
Kein Server nötig für Sharing
Images: CLIP ONNX (lokal)
Audio: Whisper ONNX (lokal) → Text → Embedding
PDF: pdf.js → Text → Embedding
Alles $0!
Lokal: Binary Search + Int8 Rescore (95% accuracy)
Optional: Claude für Top-3 Ergebnisse ($0.01/query)
→ 95% der Queries komplett kostenlos
| Ansatz | CO2/Query (geschätzt) |
|---|---|
| GPT-4 API | ~4.5g CO2 |
| Claude API | ~2-3g CO2 |
| CXP (lokal) | ~0.01g CO2 |
Faktor 200-400x weniger CO2 durch lokale Verarbeitung!
Gewählt: EmbeddingGemma (Google, 2025)
- 308M Parameter, ~200MB
- 768 dims (MRL: flexible 512/256/128)
- int4 quantized out-of-the-box
- Best-in-class für On-Device
- Multilingual (100+ Sprachen)
- On-Demand Download (nicht bundled)
Gewählt: Binary + Int8 Hybrid
- Binary für HNSW Index (schnell, klein)
- Int8 für Rescoring (bessere Präzision)
- ~3% Qualitätsverlust, 32x Speicherersparnis
Gewählt:
- Manifest: FlatBuffers (Zero-Copy)
- File Map: MessagePack (flexibel)
- Embeddings: Raw Binary (effizient)
Gewählt: HNSW via usearch
- Sub-ms bei 100k Vectors
- Rust native + WASM Support
- Rust Workspace Setup (cxp-core, cxp-cli)
- MessagePack für Manifest (statt FlatBuffers - einfacher)
- FastCDC Chunking (Gear Hash)
- SHA256 Deduplication
- Zstandard Compression
- ZIP Container Read/Write
- CLI:
cxp build,cxp info,cxp list,cxp extract
- ONNX Runtime Integration (
ort = "2.0.0-rc.10") - WASM-Alternative mit tract-onnx (
tract-onnx = "0.22") - Model Support (all-MiniLM-L6-v2, EmbeddingGemma)
- Binary Quantization (float32 → binary, 32x kleiner!)
- Int8 Quantization für Rescoring (4x kleiner)
- HNSW Index Build (
usearch = "2.15") - Hamming Distance für Binary Embeddings
- 15/15 Integration Tests bestanden
- Query Engine:
cxp query file.cxp "search term"(Keyword-Suche) - Semantic Search:
cxp search file.cxp "query"(mit Embeddings) - Embeddings in CXP-Datei integrieren (semantic.rs)
- EmbeddingStore für Binary + Int8 Serialization
- Extension Trait & ExtensionManager
- Namespace System für Extensions
- ContextAI Extension Schema (contextai.rs)
- Conversations Storage (mit ChatMessages)
- Habits/Dictionary/Settings Storage
- WatchedFolders Storage
- CxpBuilder.add_extension() Integration
- CxpReader.list_extensions() / read_extension()
- Dokumentation: EXTENSIONS.md
- SQLite → CXP Migration Tool (
cxp migrate) - Tauri Commands für CXP (6 Commands implementiert)
create_cxp_from_folder- CXP aus Ordner erstellenopen_cxp_file- CXP öffnen und Metadaten lesensearch_cxp- Keyword-Suche in CXPmigrate_sqlite_to_cxp- SQLite Migrationextract_file_from_cxp- Datei extrahierenlist_cxp_files- Dateien auflisten
- Frontend anpassen (React Components)
- SQLite Code entfernen (nach vollständiger Migration)
- Testing & Bug Fixes
Nur relevant wenn CXP als Open Source veröffentlicht wird
- WASM Build (wasm-pack) - tract-onnx Grundlage vorhanden!
- Node.js Bindings (napi-rs)
- Python Bindings (PyO3)
- npm/pip Package Publishing
[workspace]
members = ["cxp-core", "cxp-cli"]
[workspace.dependencies]
# Core
fastcdc = "3.1"
zstd = "0.13"
sha2 = "0.10"
zip = "2.2"
rayon = "1.10"
# Serialization
flatbuffers = "24.12"
rmp-serde = "1.3"
serde = { version = "1", features = ["derive"] }
serde_json = "1.0"
# Error Handling
thiserror = "2.0"
anyhow = "1.0"
# Logging
tracing = "0.1"
# File System
walkdir = "2.5"
# Misc
chrono = "0.4"
uuid = { version = "1.11", features = ["v4"] }
hex = "0.4"
# Embeddings (optional) - NATIVE (schnell)
ort = { version = "2.0.0-rc.10", optional = true }
ndarray = { version = "0.16", optional = true }
tokenizers = { version = "0.21", optional = true }
num_cpus = { version = "1.16", optional = true }
# Embeddings (optional) - WASM KOMPATIBEL (portabel)
tract-onnx = { version = "0.22", optional = true }
# Search (optional)
usearch = { version = "2.15", optional = true }
[features]
default = []
embeddings = ["ort", "ndarray", "tokenizers", "num_cpus"]
embeddings-wasm = ["tract-onnx", "ndarray", "tokenizers"]
search = ["usearch"]- Vision: CXP als universelles KI-Datenformat (Potenzial für Standard)
- Model: EmbeddingGemma (200MB, On-Demand Download)
- Plattform: Multi-Platform (Rust + WASM + Node + Python)
- Manifest: FlatBuffers (Zero-Copy)
- ContextAI: SQLite wird komplett durch CXP ersetzt
- Extension System: Namespaces für App-spezifische Daten
├── Private GitHub Repository
├── Kein öffentlicher Code
├── Fokus auf Bauen, nicht Marketing
└── Niemand sieht was du machst
├── Twitter/X: "Building something new..."
├── Screenshots & Demo Videos
├── Waitlist aufbauen
├── KEIN Code zeigen
└── Interesse wecken
├── ContextAI App = Closed Source
├── CXP Format Spec = Noch nicht veröffentlichen
├── User können App nutzen
└── Format bleibt "Black Box" fürs Erste
Wenn du bereit bist:
├── CXP Spec unter AGPL-3.0 veröffentlichen
├── Commercial License für Firmen anbieten
├── Community aufbauen
└── Standard-Adoption anstreben
ODER proprietär bleiben - du entscheidest später
✓ Maximaler Schutz während du baust
✓ Kein Stress wegen Konkurrenz
✓ Flexibilität für später
✓ Hype aufbauen ohne Code zu zeigen
✓ Du behältst alle Optionen
/Users/einarjaeger/Documents/GitHub/context Ai App
/Users/einarjaeger/Documents/GitHub/cpx.datei typ/
├── cxp-core/ # Rust Core Library
├── cxp-cli/ # CLI Tool
├── cxp-wasm/ # WASM Build
├── cxp-node/ # Node.js Bindings
├── cxp-python/ # Python Bindings
├── schemas/ # FlatBuffers Schemas
├── docs/ # Spezifikation & Docs
│ └── SPEC.md # Offizielle CXP Spezifikation
├── examples/ # Beispiele
├── CXP-2.0-PLAN.md # Dieser Plan
└── cpx.newdatatyp.md # Original Spec
- Binary & Scalar Embedding Quantization - HuggingFace
- Matryoshka Embeddings - Vespa
- Voyage AI Quantization
Erstellt: 2025-12-26 Status: Ready for Implementation