Skip to main content
Mako includes a lightweight RAG (Retrieval-Augmented Generation) system with curated knowledge about top projects in the Base ecosystem.

How it works

At startup, the gateway loads JSON files from gateway/src/knowledge/ into an in-memory index. Each file describes a single project with structured metadata.

Entry format

Two retrieval modes

1. Automatic context injection

Before every inference call, the gateway scans the user’s message against 85+ keyword triggers built from each project’s keywords array and name. If keywords match, the gateway injects up to 2 project summaries (~500 tokens) as a system message immediately after the main system prompt. This happens before the model sees the message, so the model has relevant context without needing to call any tool. Matching rules:
  • Keywords are matched as whole words (word-boundary regex) to avoid false positives
  • Short keywords (≤3 chars) require extra context — either a $ prefix or strict word-boundary matching
  • Matches are scored by keyword hit count; the top 2 are injected
  • Project details are truncated to 600 characters to save tokens
The model can also call knowledge_search directly when it needs project information. Parameters: query (required) The search scores entries across multiple fields with weighted relevance: Returns up to 5 results, each including:
If query is empty, the tool returns all entries (name, category, summary only).

Covered projects

The knowledge base currently includes 15+ entries spanning:
  • DeFi — Aerodrome, Moonwell, Morpho, Aave
  • AI Agents — Virtuals, Venice, Clanker
  • Social — Farcaster, Zora
  • Infrastructure — Coinbase Wallet, Smart Wallets, Basescan
  • Memecoins — Notable memecoins on Base

Adding entries

To add a new project, create a JSON file in gateway/src/knowledge/ following the entry format above. The gateway will load it automatically on the next restart — no code changes needed.