6. Find Super Facts

Purpose: Discover cross-entry fact correlations by dispatching FIND_SUPER_FACTS jobs to the worker-facts queue, building the super-fact link graph for cross-topic discovery.

Prerequisites:

  • .env.local has UPSTASH_REDIS_REST_URL, UPSTASH_REDIS_REST_TOKEN, and API key for the routed model (see available models)
  • worker-facts is running and configured to handle FIND_SUPER_FACTS messages
  • Validated facts exist across multiple topic categories

Cost / Duration: ~$2-$20 depending on fact pair count | 1-3 hours

Prompt

I need to find super facts -- cross-entry correlations between facts across
different entities and topics.

### Step 1: Verify worker is running

Check that `worker-facts` is running and can handle `FIND_SUPER_FACTS` messages:

```bash
curl http://localhost:8080/health
```

If the worker is not running, start it first.

### Step 2: Enqueue super fact discovery job

```bash
bun -e "
import { getQueueClient } from './packages/queue/src/index.ts';
const queue = getQueueClient();
await queue.enqueueJSON({ type: 'FIND_SUPER_FACTS', payload: {} });
console.log('Enqueued FIND_SUPER_FACTS job');
process.exit(0);
"
```

### Step 3: Monitor processing

Watch the worker logs for "Processing FIND_SUPER_FACTS" messages. The worker
analyzes fact overlaps across entries and writes correlations to `super_fact_links`.

### Step 4: Verify results

Check how many super fact links were created:

```sql
SELECT COUNT(*) FROM super_fact_links;
```

Report the count and a sample of the links found.

If zero links were found, the corpus may be too narrow -- advise on seeding
more diverse topics first.

Verification

  • Worker is running and handling FIND_SUPER_FACTS messages
  • Job was enqueued successfully
  • New rows appear in super_fact_links table
  • Links connect facts across different entities and topics
  • No timeout errors during correlation analysis

Back to index