|
| 1 | +# Matrix — Neural Task Intelligence |
| 2 | + |
| 3 | +**Describe what you want to do. Matrix finds the right skill, tool, or agent.** |
| 4 | + |
| 5 | +Matrix is a trained neural retrieval model that searches 100,000+ AI capabilities — skills, tools, agents, and apps — using semantic understanding rather than keyword matching. |
| 6 | + |
| 7 | +## Try It |
| 8 | + |
| 9 | +**Web:** [matrix.hyper.space](https://matrix.hyper.space) |
| 10 | + |
| 11 | +**CLI:** |
| 12 | +```bash |
| 13 | +hyperspace search matrix "deploy my app to kubernetes with monitoring" |
| 14 | +``` |
| 15 | + |
| 16 | +**API:** |
| 17 | +```bash |
| 18 | +curl -X POST https://matrix.hyper.space/api/search \ |
| 19 | + -d '{"query": "optimize SQL queries", "top_k": 10}' |
| 20 | +``` |
| 21 | + |
| 22 | +## Architecture |
| 23 | + |
| 24 | +``` |
| 25 | +┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ |
| 26 | +│ MATRIX │ │ Users │ │ Feedback │ │ Retrain │ │ Better │ |
| 27 | +│ deployed │──▶│ search │──▶│ 👍 👎 │──▶│ on real │──▶│ results │ |
| 28 | +│ everywhere │ │ tasks │ │ outcomes │ │ usage │ │ │ |
| 29 | +└──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘ └──────┬───────┘ |
| 30 | + │ |
| 31 | + compounds: more users → more signal → smarter model │ |
| 32 | + ╰──────────────────────────────────────────────────────▶ ♻ │ |
| 33 | +``` |
| 34 | + |
| 35 | +## Model |
| 36 | + |
| 37 | +- **Backbone:** Qwen2.5-1.5B (frozen) |
| 38 | +- **Retrieval head:** ColBERT 128-dim with distillation from text-embedding-3-small |
| 39 | +- **Training:** 189K samples (139K synthetic + 50K hard-negative triplets), 30 epochs on H100 |
| 40 | +- **Capabilities indexed:** 66,016 (21K tools + 43K skills + 1.2K agents + 50 mobile apps) |
| 41 | +- **Domains:** code, web, data, infra, docs, agents, mobile, blockchain |
| 42 | + |
| 43 | +## Search Pipeline (Hybrid RRF) |
| 44 | + |
| 45 | +Production search uses Reciprocal Rank Fusion combining: |
| 46 | +1. **Vector search** — OpenAI text-embedding-3-small (1536-dim, pgvector) |
| 47 | +2. **Full-text search** — PostgreSQL tsvector + BM25 + pg_trgm |
| 48 | +3. **Neural routing** — Matrix-2 ColBERT domain classification |
| 49 | + |
| 50 | +Results are fused using RRF (k=60), same approach as [qmd](https://github.com/tobi/qmd). |
| 51 | + |
| 52 | +## P2P Integration |
| 53 | + |
| 54 | +Matrix is the 9th primitive in the [Hyperspace Gossiping Agents Protocol](https://protocol.hyper.space): |
| 55 | + |
| 56 | +``` |
| 57 | +/hyperspace/matrix/1.0.0 |
| 58 | +
|
| 59 | +Gossip topics: |
| 60 | + hyperspace/matrix/feedback — user votes from all nodes |
| 61 | + hyperspace/matrix/discovery — new skills gossipped |
| 62 | + hyperspace/matrix/model — weight updates after retraining |
| 63 | +``` |
| 64 | + |
| 65 | +Every node can run Matrix locally (~4GB VRAM). Feedback from all nodes aggregates into training data via gossip. The model improves from the network, for the network. |
| 66 | + |
| 67 | +## Training |
| 68 | + |
| 69 | +```bash |
| 70 | +# Generate distillation data (mines hard negatives from OpenAI embeddings) |
| 71 | +python3 train_v5_fast.py --epochs 30 --batch-size 1024 --lr 2e-4 |
| 72 | + |
| 73 | +# v5 results: loss 1.93 → 0.155 in 93 min on H100 |
| 74 | +# distill_loss: 0.86 → 0.30 (ColBERT aligned 70% with OpenAI) |
| 75 | +# contrastive_loss: 0.05 → 0.01 (strong discrimination) |
| 76 | +``` |
| 77 | + |
| 78 | +## Experiment Log |
| 79 | + |
| 80 | +| Version | Date | Capabilities | Retrieval Quality | Notes | |
| 81 | +|---------|------|-------------|-------------------|-------| |
| 82 | +| v2 | 2026-02-11 | 31,900 | 53.9% ret@1 | First working retrieval | |
| 83 | +| v3 | 2026-02-28 | 66,016 | 5.9% ret@1 | 2x capability space, quality dropped | |
| 84 | +| v4 | 2026-03-08 | 66,016 | 19.1% ret@1 | 30 epochs, but _orig_mod bug in deploy | |
| 85 | +| v5 | 2026-03-19 | 66,016 | TBD | Distilled from OpenAI, 93 min H100 | |
| 86 | + |
| 87 | +## License |
| 88 | + |
| 89 | +Part of the [Hyperspace](https://hyper.space) open network. |
0 commit comments