What it is, how it works, and why you need it — explained for the Motorica team
Motorica's offline company brain — a searchable collection of 45 facts about your market, your campaigns, your ICP, and what actually works. It lives in plain files on your machine, costs nothing to run, and works without internet.
The KG is like a folder of index cards. Each card is one fact — a campaign with stats, a persona you target, a metric you track, or a summary of your signal landscape.
sources/*.jsonl) — the raw material. 7 files: baseline facts from LeadGrow, 5 signal CSV summaries, and the signal landscape aggregate.entities.jsonl, relationships.jsonl, index.json) — the compiled brain. Regenerated from sources.kg_query.py) — ask a question, get an answer. Search by keyword, list all facts in a domain, or inspect one fact in full detail.kg_index.py) — when new signal data arrives, rebuild the brain from the updated source files. One command.Without the KG, every time you write outreach copy or plan a campaign, you're guessing: What's our ICP again? Which CTA actually converts? How many funded studios are out there? The KG answers these instantly. If you don't query it before a send, you're flying blind. If you don't rebuild it when new signal CSVs arrive, it goes stale and your answers are wrong.
A game's quest journal. Before you take a quest (run a campaign), you open the journal to check: Who's the target? What worked last time? What should I avoid? kg_query.py is the "open journal" button. kg_index.py is the journal updating when a new zone unlocks and fresh intel drops. You'd never walk into a Souls boss without reading the item descriptions first — same deal here.
Three commands cover everything. You don't need to know how the files work internally — you just need to know which question to ask.
| Command | What it does | Example |
|---|---|---|
search "..." | Find anything matching a keyword across all 45 facts | kg_query.py search "funding" |
list <domain> | Show every fact in one category | kg_query.py list signal_landscape |
show <id> | Print one fact in full detail | kg_query.py show motorica |
That's it. No database, no login, no internet. It reads the built files and prints answers to your terminal.
The ICP, the winning angle, the proven CTA — these are all in the KG. Before you write a single line of outreach copy, run kg_query.py show motorica and kg_query.py search "CTA" --domain pattern. If you skip this step, you're drafting from memory, and memory drifts. Two campaigns later, you're selling a different product to a different person and wondering why reply rates dropped.
A basketball playbook. Before you run a play, you don't redraw it from scratch — you flip to the right page. search is the index, list opens a whole section, show zooms into one play. The KG is your playbook. Don't run the play without checking the page.
The KG is not frozen. When new signal CSVs arrive with updated data, you rebuild the brain with one command.
The rebuild is deterministic — same inputs = same outputs. Every time:
sources/*.jsonl fileentities.jsonl, relationships.jsonl, index.jsonTo grow it: drop updated CSV files in sources/, update the numbers in signal-landscape.jsonl, then run:
python knowledge-graph/scripts/kg_index.py
A stale KG is worse than no KG — it feeds you old numbers and you make decisions on bad intel. When fresh signal data lands, rebuild within the hour. When campaign stats change, update the campaign entity and rebuild. The KG is only as good as its last rebuild.
A save file. You wouldn't keep playing from a save from three weeks ago after grinding new gear, new levels, and new map unlocks. The rebuild is the autosave. Run it when the intel changes so the next person who opens the file sees the real state of the world.
The 45 facts are organized into 6 categories. Here's what each one holds and when you'd query it.
| Domain | Count | What it tells you | Query when... |
|---|---|---|---|
client | 1 | ICP, pain points, winning angle, status | Starting any new campaign or copy |
persona | 5 | Who you target: Founder, Director, Manager, C-Level, IC | Segmenting a lead list |
campaign | 3 | Live stats per campaign: sent, replies, reply rate, bounces | Comparing what's working |
pattern | 1 | Proven CTA: reference a specific game character/animation | Writing any outreach copy |
kpi | 30 | Metric definitions — what each KPI means and where it lives | Building reports or dashboards |
signal_landscape | 5 | Market snapshot: qualified studios, funding rounds, hiring signals | Sizing the pipeline or prioritizing outreach |
A character sheet. Client = your class and stats. Personas = the enemy types you're optimized against. Campaigns = your recent battle log. Patterns = the move that keeps landing crits. KPIs = the stat bars you track. Signal landscape = the world map showing where the next quests are.