#10670·agno

[Bug] LLMsTxtReader repeats linked pages and spends max_urls on duplicate entries

Author: lakers-abingCreated Sep 30, 2026Updated Sep 30, 2026

Description

LLMsTxtReader.read() and async_read() slice parsed link entries before fetching them. Repeated links therefore consume max_urls, trigger repeated HTTP requests, and produce duplicate documents. With links A, A, B and max_urls=2, only A is ingested (twice); B is skipped.

Reproduction

No live server or model credentials are needed:

python
from unittest.mock import patch
from agno.knowledge.reader.llms_txt_reader import LLMsTxtReader

index_url = "https://example.com/llms.txt"
index = "## Docs\n- [A](/a)\n- [A again](/a)\n- [B](/b)"
reader = LLMsTxtReader(max_urls=2, chunk=False)
with patch.object(reader, "fetch_url", side_effect=lambda url: index if url == index_url else url) as fetch:
    documents = reader.read(index_url)
    print([doc.meta_data["url"] for doc in documents])
    print([call.args[0] for call in fetch.call_args_list])

Actual document URLs: [/a, /a] (absolute URLs). Expected: [/a, /b], with each distinct linked page fetched once. Async reads have the same selection behavior.

Deduplicate resolved URLs before applying the limit, keeping the first entry's title, section, description, and order. Keep parse_llms_txt() unchanged so index tools can still display a page in multiple sections.

Reproduced on upstream main 4db4180ad9354c3cb5cd94a1d8cfcca4170b32db, macOS ARM64, Python 3.12.14. Offline regression tests exercise real HTTP client response handling via httpx.MockTransport: four fail before the fix, while five controls pass.

AI disclosure: Codex investigated this behavior at the account holder's direction. No independent human code review or real-world production incident is claimed. I intend to submit the focused fix and regression tests.