Skip to content

Incremental engine for long horizon agents 🌟 Star if you like it!

fix(examples): the Discord FAQ example's limits say the LLM picks among nearby questions, not pairs (#2807)

jerryqu-coco54b178302f06
diff --git a/docs/src/content/example-posts/discord-support-faq.md b/docs/src/content/example-posts/discord-support-faq.md
index e75537d9..f56d6e32 100644
--- a/docs/src/content/example-posts/discord-support-faq.md
+++ b/docs/src/content/example-posts/discord-support-faq.md
@@ -175,7 +175,7 @@ The two levels of memoization do different jobs:
## Phase 2: merge questions asked in other words
-![Phase 2: a single _resolve_questions pass; the set of extracted questions from every thread is deduplicated by embedding similarity plus LLM confirmation into a canonical-question map](https://cocoindex.io/blobs/docs-v1/img/examples/discord-support-faq/stage-phase2-dark.svg)
+![Phase 2: a single _resolve_questions pass; the set of extracted questions from every thread is grouped into a canonical-question map: embeddings find each question's close candidates, and an LLM picks the one it matches, if any](https://cocoindex.io/blobs/docs-v1/img/examples/discord-support-faq/stage-phase2-dark.svg)
The seeded forum has three posts about long video uploads that never finish behind a proxy, each worded differently. [`resolve_entities`](/docs/ops/entity_resolution/) embeds every extracted question and, for each one, finds the close candidates within `max_distance`; `LlmPairResolver` then picks which candidate it matches, if any. The result maps every question to its group's canonical one.
@@ -364,7 +364,7 @@ To correct an answer, **reply with the correction rather than editing the messag
## Limits
- **The answers are written by an LLM,** so they can lose details from individual posts, or be wrong. The links back let anyone check.
-- **Merging is the LLM's judgment too,** made on pairs of questions: each question is compared with a group's representative question, so a group held together by one post's wording can split when that post is deleted.
+- **Merging is the LLM's judgment too:** for each question, it sees the representative questions of the groups near it and picks the one that asks the same thing, if any. A question is compared only with those representatives, so a group held together by one post's wording can split when that post is deleted.
- **One Markdown file suits a small knowledge base.** For a large one, the same pipeline can declare each entry as a row in a vector store or database instead of a section of `FAQ.md`.
## Run it
diff --git a/examples/discord_support_faq/README.md b/examples/discord_support_faq/README.md
index 38a1ba0d..331a1321 100644
--- a/examples/discord_support_faq/README.md
+++ b/examples/discord_support_faq/README.md
@@ -23,7 +23,7 @@ Messages outside a thread are skipped: there, a question and its answer are sepa
Runs are incremental. A thread goes back to the LLM only when it gets a reply, loses a message, or is renamed. Closing, locking or retagging one reruns it, but its question and answer aren't extracted again, since the text the LLM reads is the same (the tags are left out of it; the **Solved** tag is read from the thread itself). An answer written from several threads is written again only when one of those threads changes (a retag included, since that answer names the thread tagged **Solved**) or the entry's question does, so a change to one post leaves every other entry's answer alone. A deleted thread drops out of the FAQ. The channel only picks the fields the thread's text and links read (`MESSAGE_FIELDS` and `THREAD_FIELDS` in [`main.py`](main.py)), so a reaction or someone joining a thread doesn't read anything again.
-The answers are written by an LLM, so they can lose details from individual posts, or be wrong; the links back let anyone check. Merging is the LLM's judgment too, made on pairs of questions: each question is compared with a group's representative question, so a group held together by one post's wording can split when that post is deleted. One Markdown file suits a small knowledge base. For a large one, the same pipeline can declare each entry as a row in a vector store or database instead of a section of `FAQ.md`.
+The answers are written by an LLM, so they can lose details from individual posts, or be wrong; the links back let anyone check. Merging is the LLM's judgment too: for each question, it sees the representative questions of the groups near it and picks the one that asks the same thing, if any. A question is compared only with those representatives, so a group held together by one post's wording can split when that post is deleted. One Markdown file suits a small knowledge base. For a large one, the same pipeline can declare each entry as a row in a vector store or database instead of a section of `FAQ.md`.
To correct an answer, **reply with the correction rather than editing the message**. Discord reports no change on a thread when a message inside it is edited, so the edit is read the next time the thread changes in one of the ways above. See [The gap inside threads](https://cocoindex.io/docs/connectors/discord/#the-gap-inside-threads).