RugBrain — The Crypto Intelligence Brain That Learns From Every Scan
Hybrid vector+lexical retrieval over scam patterns, live threat feeds, forensic reports, and wallet profiles. Monitors the crypto network live, remembers every scan, learns from past scams. RAG engine for AI agents and developers.
Beta
The retrieval engine behind our crypto intelligence answers. Monitors the crypto network live, remembers every scan, learns from past scams. Hybrid vector+lexical retrieval over 14 collections — scam patterns, forensic reports, wallet profiles, contract audits, transaction patterns, and live threat feeds.
What RugBrain Actually Does
Live Monitoring & Continuous Learning
RugBrain doesn’t just search — it watches. Continuous ingestion pipelines pull from:
- Scanner findings — every high/critical risk scan from RMI gets embedded and indexed in real-time via Redis pub/sub
- Threat intelligence feeds — 11 live incident/advisory sources (CISA, OSV, Immunefi, HackerOne, etc.) ingested nightly
- News & social — 200+ RSS feeds (CoinTelegraph, Decrypt, The Block, X) + CT rundown + market brief
- Wallet profiles — 422k+ curated address labels across Ethereum, BSC, Arbitrum, Polygon, Solana with behavioral features
- Forensic reports — full investigation narratives with tx hashes, wallet clusters, fund flows
- Contract audits — verified audit reports with findings, severity, and code patterns
Three-Pillar Retrieval Architecture
Every query hits three retrieval arms simultaneously:
| Pillar | Method | What It Catches |
|---|---|---|
| Dense (Vector) | qwen3-embedding-8b 2560-dim, cosine | Semantic similarity, concept matching, “what does this pattern look like” |
| Sparse (Lexical) | SPLADE + BM25 | Exact entity matches, address lookups, CVE numbers, contract addresses |
| Entity (Graph) | Neo4j wallet relationships | Wallet clusters, deployer histories, cross-chain identity, fund flows |
Results merge through qwen3-reranker-8B cross-encoder → re-ranked by relevance, not just similarity.
What It Remembers & Learns From
Every scan teaches the system:
- A new honeypot pattern → embedded into
threat_intelcollection - A novel rug-pull vector → added to
transaction_patterns - A malicious deployer → profile updated in
wallet_profileswith behavioral features - A new exploit → forensic narrative in
forensic_reportswith full tx hashes
Pattern recognition improves over time:
- Embedding model fine-tuning on confirmed scam/legit pairs (quarterly)
- Reranker learns from human feedback on search results
- Entity resolution gets sharper as more wallet clusters are confirmed
Collections (14, each with purpose-built chunking)
| Collection | Embedding | Chunking | Retention | Purpose |
|---|---|---|---|---|
threat_intel |
qwen3-8b 2560d | 512/15% recursive | Permanent | Vulnerability patterns, exploit PoCs, 0-day advisories |
scam_patterns |
qwen3-8b 2560d | 400/10% semantic | Permanent | Honeypot signatures, rug-pull vectors, bundle detection rules |
wallet_profiles |
semantic 1024 + features | 128/0% fixed | 365 days | 422k labels + behavioral vectors + cross-chain identity |
known_scams |
qwen3-8b 2560d | 512/15% recursive | Permanent | Confirmed scams with tx hashes, wallet clusters, fund flows |
forensic_reports |
qwen3-8b 2560d | 512/15% recursive | Permanent | Full investigation narratives, evidence, root cause |
contract_audits |
qwen3-8b 2560d | 256/20% code/AST | Permanent | Verified audits, findings, code patterns, severity |
transaction_patterns |
qwen3-8b 2560d | 300/10% semantic | Permanent | MEV vectors, sandwich patterns, oracle manipulation signatures |
market_intel |
qwen3-8b 2560d | 300/10% semantic | 90 days | Token analytics, trending, capital rotation, sentiment |
news_articles |
qwen3-8b 2560d | 512/15% recursive | 30 days | 200+ RSS feeds, CT rundown, market briefs |
rmi_agent_memory |
qwen3-8b 2560d | 512/15% recursive | Permanent | Agent decisions, scan histories, learned patterns |
rmi_community |
qwen3-8b 2560d | 512/15% recursive | Permanent | Community reports, social signals, verified tips |
general |
qwen3-8b 2560d | 512/15% recursive | 30 days | Catch-all for uncategorized ingest |
Technical Architecture
Embedding & Rerank Lanes (Never Mix)
| Lane | Model | Dimension | Endpoint | Purpose |
|---|---|---|---|---|
| Corpus (Deep) | qwen3-embedding-8B | 4096-d | :8004 (DeepInfra) / local fallback | Primary retrieval, document embedding |
| Memory/Legacy | qwen3-embedding-0.6B | 1024-d | :8024 | Wallet profiles, agent memory, fast cache |
| Corpus Rerank | qwen3-reranker-8B | — | :8003 | Cross-encoder reranking for dense results |
| Memory Rerank | qwen3-reranker-0.6B | — | :8030 | Fast reranking for memory lane |
Ingestion Pipeline (Three Live Paths)
- Scanner → RAG (Real-time) — Redis pub/sub on
rmi:rag:ingest+ LPOP polling onrmi:rag:findings_queue→ qwen3-embedding-8b → Qdrantthreat_intel - Nightly News/Social (3 AM UTC) — DataBus news (50 articles), CT rundown (20), market brief, social metrics → parent-doc store + delta tracking
- Seed Pipelines — 13 static vulnerability patterns + 6 historical hacks + threat intel → idempotent UUID v5 upserts
Caching Strategy (L1/L2/L3)
| Layer | Store | What | Retention |
|---|---|---|---|
| L1 | In-process + Redis | Embedding cache, scam-pattern cache, semantic query cache | 24h / 30d / per-entry |
| L2 | Redis | Full doc JSON + index sets | Collection-specific: permanent for patterns/audits, 365d for wallets, 30d for news |
| L3 | Backblaze B2 | Nightly Qdrant snapshots + Redis JSON chunks (≤5MB) + local 7-day cache | Nightly, opt-in HF mirror |
Backup & Permanence
- Qdrant API snapshots → B2
rmi-rag-permanence/qdrant-snapshots/nightly - Redis collections → B2
rag_snapshots/nightly JSON chunks +latest.jsonpointer - Recovery:
permanence.restore_all()for Redis; Qdrant snapshot upload via API
API Reference
rugbrain Service (Port 8012)
| Method | Path | Purpose |
|---|---|---|
| GET | /health | Liveness: Qdrant, Redis, subscriber/poller state |
| GET | /ready | Readiness |
| GET | /api/v1/search | Semantic search over threat_intel (min_similarity=0.4) |
| GET | /api/v1/rag/v2/scam-check | Address scam check — three-pillar search over threat_intel + rmi_community → scam_risk: high/medium/low/unknown + confidence. Rate-limited: free 5/hr, pro 100/hr |
| POST | /api/v1/rag/chunk-solidity | Solidity AST chunking |
| POST | /api/v1/rag/image-analysis | Multimodal image description |
| POST | /api/v1/rag/logo-check | Logo theft detection (perceptual hash) |
| GET | /api/v1/rag/journalism/research | Deep-dive research brief across all collections |
| POST | /api/v1/rag/watch / GET /api/v1/rag/watches | Streaming watch creation/list |
rmi-backend RAG v2 (Port 8000)
| Method | Path | Purpose |
|---|---|---|
| POST | /api/v1/rag/v2/search | Semantic/hybrid search with filters |
| POST | /api/v1/rag/v2/ingest | Document ingestion |
| POST | /api/v1/rag/v2/feedback | Scanner→RAG feedback loop |
| GET | /api/v1/rag/v2/stats | Collection health + active embedder |
| POST | /api/v1/rag/v2/bulk-ingest | Batch ingest (max 500 items) |
Use Cases
For AI Agents (via MCP)
rugbrain_scam_check(address, chain)— instant risk tier with confidencerugbrain_deep_research(query)— investigation brief with citations across all collectionsrugbrain_wallet_profile(address)— behavioral analysis, cluster membership, risk flagsrugbrain_pattern_search(description)— find similar exploits/vectors by natural language
For Developers
# Self-host
git clone https://git.rugmunch.io/RugMunchMedia/rugbrain.git
cd rugbrain
cp .env.example .env # QDRANT_URL, REDIS_PASSWORD, RMI_RAG_API_KEY
docker compose up -d
# Query
curl -H "X-API-Key: $RMI_RAG_API_KEY" \
"http://localhost:8012/api/v1/rag/v2/scam-check?address=0x...&chain=ethereum"
For Security Researchers
- Semantic search over 13 vulnerability patterns + 6 historical hacks + live advisories
- Cross-encoder reranking surfaces the most relevant patterns first
- Entity pillar catches exact wallet/address/contract matches that vector search misses
Current Status & Roadmap
Beta — ingest and retrieval run continuously. HTTP surface evolves between releases.
Honest Gaps (as of 2026-11-02)
- Collections exist but some are still seeding (
threat_intel,wallet_profilesgrowing) - Scanner ingestion idle — rmi-backend not yet publishing to Redis queues (P0)
/api/v1/rag/investigateand/confidenceendpoints under restoration (WIP)- BM25 sparse + cross-encoder rerank wiring validation in progress
- Evaluation pipeline (RAGAS) needs labeled eval set and CI gate
P0 — Make It Real (In Progress)
- Finish seeding all collections with qwen3-embedding-8b at 2560-dim
- Wire rmi-backend scanner → Redis publish so
ingested_countmoves - Recreate configured collections (
scanner,wallet,news,research,scams) - Restore
src/app/packaging → unblock/investigate+/confidence - Consolidate stores: one canonical collection set across rmi-backend and rugbrain
P1 — Retrieval Quality
- Enable cross-encoder rerank on high-traffic endpoints
- BM25 sparse validation end-to-end
- Evaluation pipeline: RAGAS harness + labeled eval set + CI gate
P2 — Entity & Multimodal Expansion
- Neo4j knowledge-graph entity expansion (formalize graph store)
- Image pipeline: multimodal + logo-theft DB
- Contract-code embeddings (320-dim structural+semantic)
- Metrics: query latency, hit rate, collection-size gauges in Prometheus + Grafana
For Web3 Developers — Designing Safe Products
RugBrain is the security awareness layer for your AI agents and development workflows. When you’re building:
- Smart contracts — query
contract_audits+threat_intelfor similar patterns, known vulnerabilities in your language (Solidity, Vyper, Rust, Cairo, Move) - DeFi integrations — check
transaction_patternsfor MEV vectors, oracle manipulation signatures, flash-loan attack vectors - Wallet infrastructure —
wallet_profilesgives you 422k curated labels + behavioral risk flags - Token launches —
scam_patternshas honeypot signatures, rug-pull vectors, bundle detection rules - AI agents — MCP tools give your agents grounded security awareness, not hallucinations
Languages covered: Solidity, Vyper, Rust (Solana/Sui/Move), Cairo (Starknet), Move (Aptos/Sui), Go (Cosmos), TypeScript/JavaScript (frontend safety)
0-day awareness: Live threat feed ingestion (CISA, OSV, Immunefi, HackerOne, GitHub Security Advisories) means your agents know about critical vulnerabilities before they’re widely exploited.