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.1.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.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: telegram_retriever-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 635bad6f0ec9547f159d8e7b702737819e393f935de41443b22d9628e6442d46
MD5 f93ff91f2a968c27be485b66797122c1
BLAKE2b-256 0ac27303734984f0caf8cdce52fd7addbd93e9d7b2562c3952ba0457a352a379

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for telegram_retriever-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 545f265b5f533f057c6745beb6fdd7c9674f29b80ff6bea84b1fe50765046a6a
MD5 f16d252a3c9775b2efa9fff201ce6b91
BLAKE2b-256 a3c0f6ace10e33d4b30fd56d0f1df75b076dbbd2a3926ce5d12752ae56b55fa6

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