Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ instruction file) — the content is self-contained.
spelling variants like `wan animate` vs `wananimate`, author + time
filtering.
- Gotchas — most importantly that `fts` (full-text search) **times out**
on this table, so use `ilike` only.
on this table, and very broad all-channel `or=(...)` searches can also
time out. Start with `daily_summaries` and narrow `ilike` filters, then
widen.
- A "best practices for X" recipe: hit `daily_summaries` first, then
Kijai-by-author, then topic channels, then cross-check
[wanx-troopers.github.io](https://wanx-troopers.github.io/).
Expand Down
20 changes: 20 additions & 0 deletions hivemind/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ These names come up repeatedly with authoritative answers — weight their messa
## Query patterns (PostgREST)

Always URL-encode spaces (`%20`). Use `Accept: application/json` implicitly.
Prefer `curl --get --data-urlencode` for anything with parentheses, spaces, or
multiple filters; hand-built URLs are easy to get subtly wrong.

### 1. Basic substring search

Expand All @@ -91,6 +93,20 @@ asterisks are SQL `%` wildcards.
&channel_name=in.(daily_summaries,wan_comfyui,wan_chatter,wan_gens,resources,wan_resources)
```

For first-pass research, use `daily_summaries` as a narrow equality filter
before broadening. It is faster and usually more useful than a wide OR across
all channels:

```bash
curl -sG "https://ujlwuvkrxlvoswwkerdf.supabase.co/rest/v1/message_feed" \
-H "apikey: sb_publishable_O38oPBafrBoFrpi_rlWJvA_UJrulFsx" \
--data-urlencode "select=content,author_name,channel_name,created_at" \
--data-urlencode "channel_name=eq.daily_summaries" \
--data-urlencode "content=ilike.*VACE*" \
--data-urlencode "order=created_at.desc" \
--data-urlencode "limit=10"
```

### 3. Compose AND across multiple content terms

Repeat the `content=ilike.*X*` filter — PostgREST ANDs duplicate keys:
Expand Down Expand Up @@ -142,6 +158,10 @@ then `Content-Range` header has `start-end/total`.

- **`fts` / full-text search** (`content=fts.foo`) — **times out** on this table.
Stick with `ilike`.
- Very broad `or=(...)` searches across all channels can also time out,
especially with many spelling variants. If this happens, narrow first by
`channel_name=eq.daily_summaries`, use one or two `content=ilike.*term*`
filters, and only then widen to topic channels.
- `reactions` is mostly `null` — you can't rank by popularity.
- No pagination cursor — use `offset=N` with `limit` if you need to page back.
- Messages are imported in batches; very recent (last few minutes) messages may
Expand Down