Skip to main content

A Human-in-the-Loop retriever for LangChain that pauses execution to wait for a Telegram reply.

Project description

telegram-retriever

License: MIT Python 3.9+

telegram-retriever is a lightweight Python library designed to integrate "Human-in-the-Loop" capabilities into LangChain workflows.

Unlike standard retrievers that search databases, this tool allows an LLM agent to pause execution, send a query to a specific Telegram user, and synchronously wait for a text-based reply. The user's reply is returned to the agent as the retrieved context.

Key Features

  • Interactive Retrieval: The invoke() method blocks until a human replies.
  • Strict Threading: Validates that the incoming message is an explicit "Reply To" the bot's question.
  • Zero Infrastructure: Uses Long Polling. No webhooks, public IPs, or databases required.
  • Text-Only: Filters out stickers, photos, and voice notes to ensure clean LLM input.

Installation

pip install telegram-retriever

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

telegram_retriever-0.1.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

telegram_retriever-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file telegram_retriever-0.1.0.tar.gz.

File metadata

  • Download URL: telegram_retriever-0.1.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for telegram_retriever-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8b3d7070a0e2e690dd369e5e419971b6d6cbd264288fc37857f386d9bbf8d5ad
MD5 0237e17a0714c998aca5d91807bfca5d
BLAKE2b-256 985c9cd18cf9d5a2d0f0d48075cd0fb51d0bb9dad17d8d2e82b388f064a78ca1

See more details on using hashes here.

File details

Details for the file telegram_retriever-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for telegram_retriever-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a5cfd238e4b1c691c02dbd596a50578de62012e1e0450bc30d8dfb384b289e6
MD5 c11a976b0d29a312fe43cb2da50214d0
BLAKE2b-256 a5844d3cb71b3a8ccaca2d8ea00f1f57335aced33e4dd507dd776f488ae40e89

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page