Skip to content

Semantic (vector) search over messages #82

Open

Description

@neoromantic

tg messages search is full-text only (FTS5): it finds messages that contain the query's words. An agent asking "where did we agree on the deadline" or "messages about the apartment" needs messages that mean the same thing in other words, including across Russian and English.

Proposed:

  • tg messages search --semantic "<query>" [--chat <peer>] [--limit N] ranks messages by meaning, and a hybrid mode combines it with the FTS5 match.
  • Embeddings are stored per account in its cache (for example with sqlite-vec) or in a separate file next to it, so turning the feature off removes them.
  • Embedding happens in the background (the daemon, or tg messages embed), only for chats the user opts in, with progress in tg status.
  • The embedding model is configurable: a local model by default so message text never leaves the machine, an API provider only when the user sets one up.

Questions:

Done when --semantic finds a paraphrased message that FTS5 misses in an e2e test on made-up data, the storage cost is measured, and the docs say where the text goes.

Activity

  1. added
    enhancement
    on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions