langchain-lyrenth
Read the web through Lyrenth from LangChain. A page arrives as clean Markdown instead of raw HTML, typically 80 to 90 percent fewer input tokens for the same page, and carries its canonical source URL so an answer built on it can be attributed.
Pages are served from Lyrenth's standing web index, so when many agents read the same URL it does not become many requests to that website.
pip install langchain-lyrenth
Get a free API key at https://lyrenth.com/signup (2,000 reads a month, no
card). The components read LYRENTH_API_KEY from the environment.
A tool, for an agent
Give an agent the ability to read any page it decides it needs.
from langchain.agents import create_agent
from langchain_lyrenth import LyrenthReadTool
agent = create_agent(
model="openai:gpt-5.5",
tools=[LyrenthReadTool()],
system_prompt="You are a research assistant.",
)
result = agent.invoke({"messages": [
{"role": "user", "content": "What does https://example.com/pricing say?"}
]})
The tool is called read_url, takes a single url, and returns the page as
Markdown with its title and source URL at the top. It implements the async
path too, so it does not block the event loop an agent runs on.
Options: LyrenthReadTool(fresh=True) forces a live re-fetch instead of the
stored copy, and max_tokens=4000 caps a long page at roughly that many
tokens, trimmed at a clean boundary.
A loader, for a pipeline
When the URLs are known ahead of time, load them as Documents.
from langchain_lyrenth import LyrenthLoader
docs = LyrenthLoader([
"https://example.com/a",
"https://example.com/b",
]).load()
docs[0].page_content # the cleaned Markdown
docs[0].metadata # {"source", "title", "description", "word_count"}
lazy_load() streams them one at a time. The same fresh and max_tokens
options apply, and client= reuses an existing lyrenth.Lyrenth client.
Notes
Reads resolve through a shared cache, so a page many callers want is fetched from its origin a minimal number of times. Lyrenth identifies its crawler, honors robots.txt, and does not train foundation models on crawled content; the policy is at https://lyrenth.com/bot.
MIT licensed. Issues and questions: https://github.com/lyrenth/langchain-lyrenth/issues.
Metadata
Release files for langchain-lyrenth 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| langchain_lyrenth-0.2.1.tar.gz | 5.3 kB | Without provenance | Details for langchain_lyrenth-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langchain_lyrenth-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for langchain_lyrenth-0.2.1-py3-none-any.whl |
Total release size: 10.6 kB
Release files / langchain_lyrenth-0.2.1.tar.gz
| Download URL | langchain_lyrenth-0.2.1.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d6a9826daecdeb8c2e100a7b4ac0555fcac3ccc8381c66a50d1af37ad3896b08
|
|
BLAKE2b-256 checksum How to use checksums |
e39c1799233b3e26351e90cc122aeaf919357b1e49e8d6906d3f64af42a84f30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.5
|
Release files / langchain_lyrenth-0.2.1-py3-none-any.whl
| Download URL | langchain_lyrenth-0.2.1-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
12c363d38e457b0d03d464e615a839a8f0e81d516ceef0778cf6b0fc9b51e9a6
|
|
BLAKE2b-256 checksum How to use checksums |
ce6e71cc1dc30ffe3af0e89d9caf40458f690d145e08bfb06e11a8d938dc6b79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.5
|
Security for langchain-lyrenth 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.