What’s included
- On-device vector search with optional cloud sync for indexes
- Semantic, keyword, and hybrid retrieval (tune via
alpha) - Multi-index support and privacy-first footprint (Rust core under the hood)
Use cases
- Knowledge base search with cloud backup
- Voice/agent knowledge with persistent indexes
- Personal/edge search with cloud fallback
Install
- JavaScript/TypeScript:
npm install @inferedge/moss - Python:
pip install inferedge-moss
Models
moss-minilm(default): fast, lightweight, great for edge/offlinemoss-mediumlm: higher accuracy with reasonable performance
Client lifecycle
- Create index with docs + model → Load index → Query (
top_k,alpha) → Upsert/delete docs → Delete index when done
Examples (JS/Python)
Common types
DocumentInfo–{ id: string; text: string; metadata?: Record<string,string> }MutationOptions–{ upsert?: boolean }QueryOptions–JavaScript: { topK?: number; embedding?: number[] }·Python: QueryOptions(top_k?: int, alpha?: float, embedding?: Sequence[float])alpha(Python query option) – blend semantic (1.0) vs keyword (0.0); defaults to semantic-heavy
Hybrid search controls
Sample code
- Repo: moss-samples
- JavaScript:
javascript/comprehensive_sample.ts,javascript/load_and_query_sample.ts - Python:
python/comprehensive_sample.py,python/load_and_query_sample.py - Python deps:
pip install -r python/requirements.txt, thenpython path/to/sample.py - Python walkthrough: