Skip to content

Memoir: Promptless Conversation Flaggers

A small Python module that replaces streaming prompt chains with boolean flaggers built on sentence embeddings, so a conversational agent can tell when a user is saying goodbye without asking an LLM.

2024Machine LearningAI

Pythonsentence-transformersall-MiniLM-L6-v2NumPyjoblib

Project Brief ​

Objective

To replace the streaming prompt chains that assist a conversational agent in real time with queues of boolean flaggers, each deciding from the vector embedding of a message rather than from another LLM call.

Motif

Asking a language model "is the user leaving?" on every turn is slow and costly for a yes-or-no answer. A handful of example sentences and one small encoder answer it in milliseconds, which makes it one of the control pieces for conversational agents like Tom.

System Architecture ​

Each flagger, an Ember, stores two small corpora: target phrases (what the flag looks for) and contrast phrases (what it should not fire on). A message is encoded once and compared with both sets. Whichever side is more similar on average gives the boolean answer, and the two means, normalised, give the probabilities. Every flagger shares one encoder, so adding another costs only its examples. A command-line tool adds, lists and runs saved flaggers; the bundled example, StopButton, tells farewells from greetings.

Progression ​

TODO ​

Required Knowledge ​

Extensions ​

The README's open item is a queue in the command-line tool, so several flaggers can run on each message as it streams in. Beyond that, the observations could feed back into the corpora: messages a flagger was sure about become new examples. More on the reasoning in my post on the stop button (opens in new tab).

Posts

No posts for this project yet. Come back later.