Repository navigation
Feature/collab topic thread context - #3284
Open
ibrahimmahaba wants to merge 10 commits into
Open
ibrahimmahaba wants to merge 10 commits into
ibrahimmahaba wants to merge 10 commits into
Conversation
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
ibrahimmahaba
requested review from
kunal0137,
ryanweiler92 and
themaherkhalil
November 6, 2026 14:28
SearchMail inside topics now also searches message text through the mailbox search, scoped to the topic's conversations, with the rules gate applied to every match. Topic chats default SearchMail to the chat's topics, the topic brief states the thread count, and BrainGetRelatedItems is an agent tool (RelatedThreads). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…g words only The topic search reads candidate messages (mailbox hits, with related words when none holds every word, plus the newest) and a model picks the passages that answer the question, each with a quote that is verified against the message. Falls back to word matching without a model. Results report timings and counts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The classifier is a Jev (TypeSafe) model that only answers typed questions, so the free-form relevance judge now uses the text model and skips TypeSafe engines. A failed judge reports its reason in the search note. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Question and filler words no longer become search words, the mailbox hits are ranked by subject and body preview before the read cap, a short screening call picks the likeliest messages for the full judge, the judge is stricter, and the assistant is told not to work out dates. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Model calls are logged against the room of the calling thread, so judge responses showed up in the owner's chat and in the assistant's own context. Run them on a pool thread, and report which messages the judge saw. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…n as asked The classifier scores each message of the topic's conversations against the unsplit question; the text model quotes the likeliest. Falls back to the judged and word searches. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…e failed Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… prefer the higher score Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- keep the wider question-word list to the body search so subject, summary and people matching behaves as before - count conversations Graph could not list and report a partial search, or fail over to the fallbacks when none could be read - do not swallow login errors when resolving the chat's topics, and log other failures Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…n paging COLLAB_TOPIC_SEARCH_MAX_MESSAGES (200), COLLAB_TOPIC_SEARCH_PER_CONVERSATION (25) and COLLAB_TOPIC_SEARCH_THREADS (6) in RDF_Map.prop; defaults apply when unset or not a number, and values are kept within a safe range. Graph conversations are followed page by page up to the per-conversation limit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ibrahimmahaba
force-pushed
the
feature/collab-topic-thread-context
branch
from
November 6, 2026 14:38
a7b2770 to
f99ca74
Compare
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Topic chats: find facts that only appear in the body of a topic's email threads
Problem
SearchMailonly matched a thread's subject, summary and people. In a topic chat, a fact that appearsonly in a message body (a date, a code, a decision) could not be found, and the assistant answered
"not found" or guessed from unrelated threads. Chats that belong to a topic also searched all of the
owner's mail instead of the topic.
What this changes
In a topic chat,
SearchMailnow reads the message text of the topic's own threads and returns thepassage that answers the question, with a quote, who wrote it, the date and a confidence.
allTopicsopts out;message text is then not searched.
No words are split or dropped.
including ones that were never imported (Graph
$batch, 10 conversations per call, paged).before any model sees a message.
COLLAB_CLASSIFIER_ENGINE_ID(a Jev /ITypeSafeEnginemodel)answers "does this message itself answer the question?" as a probability, in parallel.
COLLAB_LLM_ENGINE_IDreads the top 10 in batches of 4 (parallel) andreturns relevant / confidence / quote / reason. A quote that is not in the message text is discarded.
bodySearch.stats(mode, counts,classifiedTop, timings) and anote.Also: topic briefs now show the thread count, the
RelatedThreadsagent tool is added, and the prompt tellsthe agent to pass the question as asked, answer only from quoted text, and not compute dates itself.
Fallbacks
partialstats.conversationsUnread;partial. If none can be read, falls backunavailable; the metadata results are still returnedSemossPixelException(login/permission) is always rethrown, never swallowed.Configuration (
RDF_Map.prop, all optional)COLLAB_TOPIC_SEARCH_MAX_MESSAGESCOLLAB_TOPIC_SEARCH_PER_CONVERSATIONCOLLAB_TOPIC_SEARCH_THREADSUnset or non-numeric values use the default; out-of-range values are clamped.
Privacy and safety
Insight, so raw model JSON is never loggedinto the owner's chat room or the agent's context.
$filtervalues are quote-escaped.Compatibility
searchAlland non-topic search behave as before. The wider question-word list is applied only to thebody search words, not to the subject/summary/people match.
BrainMessageSource.conversationMessagesis a new default method (returns null), so other sources areunaffected. The fixture source (
COLLABORATION_FIXTURE_MAIL) implements it for offline testing.Files
11 files, about +2,176 / -36. Main changes:
BrainTopicJudge(new): classifier + text-model search, fallbacks, settingsBrainTopicBodySearch(new): word-based fallback and shared context/gate/result typesBrainThreadFinder: multi-topic search, body-search integration,QUESTION_WORDSBrainGraphMessageSource,BrainFixtureMessageSource,BrainMessageSource:conversationMessagesBrainSearchThreadsReactor: topic default,allTopics, parameter descriptionCollaborationPrompts,CollaborationAgentTools,BrainTopicBrief,BrainGetRelatedItemsReactorHow it was tested
Manually in the local Tomcat + UI against a fixture mailbox (~440 messages), with a topic of 40 messages whose
fact appears only in a message body and contradicts other threads. Question:
"What is the new date for the order-routing cutover".
SearchMailcall, quoted the right message, and the agent answered from it.classifyabout 4s for 40 messages,judgeabout 5s, about 10s total.$batchand paging with bodies, topics largerthan the 200-message cap, and the never-ingest sender test on a real mailbox.
Known limitations
COLLAB_TOPIC_SEARCH_MAX_MESSAGESmessages of a topic are classified.conversationIdfilter is used, sothe per-conversation limit is applied to an unspecified subset when a conversation is longer.
final decision.
Reviewer notes