RugBrain
RugBrain is the memory of the platform. A retrieval-augmented generation (RAG) engine that embeds scam patterns, historical hacks, news and social intel, wallet/entity knowledge, and real-time security incidents into vector collections โ then serves them back through semantic, hybrid, and entity-aware search.
You meet RugBrain every time the scanner shows a Known Scam Patterns check,
the AI chat answers a research question, or an investigation report cites
historical precedent. It is also exposed directly as paid tools (rag_search,
reputation_score) in the x402 catalog.
โ Live-platform facts on this page verified against production on 2026-08-24.
What it knowsโ
| Domain | Content | Example surface |
|---|---|---|
| Scam intelligence | Known scam patterns, historical hacks, scanner findings | Scanner "Known Scam Patterns", scam-check |
| Market awareness | News, CT rundown, market brief, social sentiment | Backend /api/v1/rag/v2/search |
| Entity intelligence | Wallet labels, entity profiles, cross-chain identities | /investigate, three-pillar search |
| Security alerts | Live exploit/rug-pull incidents, polled every 5 minutes | NATS alerts.crypto.security + ClickHouse |
Live scale: 57 Qdrant collections including scam_intel_v2,
threat_intel_v2, hacks_v2, news_v2, research_v2, known_scams,
defi_exploits, live_threats, security_alerts, exchange_flows, and
more.
How retrieval worksโ
RugBrain uses a three-pillar search architecture fused with Reciprocal Rank Fusion:
- Dense retrieval โ embeddings via BGE-M3-class models (qwen3-embedding, 2560-dim) served locally through Infinity.
- Sparse retrieval โ BM25/SPLADE lexical matching for exact symbols and addresses.
- Entity retrieval โ structured wallet/entity lookups.
Optional cross-encoder reranking and MMR dedup refine the final ranking. Embedding failures fail loud (HTTP 503) โ no silent hash-fallback garbage.
Real-time security alert ingestionโ
A poller sweeps free security-intel sources (CoinGecko new listings, DeFiLlama
hacks, Rekt News, CertiK/PeckShield/Beosin feeds) every 5 minutes. Each new
incident is embedded, stored to the security_alerts collection, pushed to
NATS (alerts.crypto.security, Redis pub/sub fallback), and logged to
ClickHouse for historical tracking.
Market awareness feeds scoring: score_awareness(query) /
boosted_risk(query) fold current landscape โ trending scams, recent
exploits, fear/greed โ into risk scores for new token scans, so a token
matching a recently exploited protocol is flagged immediately.
API surfaceโ
RugBrain runs as an internal service (FastAPI, authenticated with API keys) behind the platform. Highlights:
| Endpoint group | What it does |
|---|---|
/api/v1/rag/v2/scam-check | Semantic scam-pattern check for a token/address |
/api/v1/rag/query | Three-pillar hybrid search over all collections |
/api/v1/rag/investigate | Entity-aware investigation search |
/api/v1/rag/confidence | Confidence scoring for retrieved evidence |
/api/v1/analyze/{address} | Address analysis fusing vectors + graph |
/api/v1/fear-index, /market/mood | Market sentiment indices |
/api/v1/news/top, /news/rate | Rated news intel |
/ingest | Document ingestion pipeline |
From the public API you touch RugBrain through:
# Knowledge search (paid x402 tool, trial-eligible)
curl -X POST https://rugmunch.io/api/v1/x402-tools/rag_search \
-H "Content-Type: application/json" \
-d '{"query": "honeypot patterns with hidden mint functions"}'
Open source coreโ
The RugBrain engine is open source (MIT) as
rugbrain โ collection
schemas, ingestion sources (25+ pluggable Source implementations), the
three-pillar retriever, and B2 snapshot permanence. The managed platform adds
proprietary corpora and enrichment.
git clone https://git.rugmunch.io/RugMunchMedia/rugbrain.git
cd rugbrain && pip install -e .
python scripts/seed_all.py --dry-run # preview seeding
python -m rugbrain # serve on :8012
Requires Qdrant, Redis, and an Infinity embedding endpoint โ see the repo's
.env.example.
Related pagesโ
- Scanner Guide โ where scam-check results appear
- Wallet Intelligence โ the entity data RugBrain indexes
- Architecture โ where RugBrain sits in the platform