Commit Graph

66 Commits

Author SHA1 Message Date
Lauren Hirata Singh 2276580e29 Name every llms.txt section index correctly so all are served (#5518)
## Why

Coverage fell from ~100% to **57%** after #5514. This is my regression,
and the cause is a Mintlify behavior I assumed rather than tested.

**Mintlify serves the exact filename `llms.txt` at any path, and 404s on
anything else.** The numbered variants my split produced were never
reachable:

| URL | status |
|---|---|
| `/oss/python/llms.txt` | 200 |
| `/oss/python/llms-2.txt` | **404** |
| `/oss/python/llms-3.txt` | **404** |
| `/langsmith/smith-api/llms.txt` | 200 |
| `/langsmith/smith-api/llms-2.txt` | **404** |

Only 4 of 9 section indexes were reachable. That left 1,229 visible
links — 1,112 across the four served files plus 117 inline in the root —
which is exactly what the audit reported: 883 sitemap pages plus 346
links not in the sitemap. The other **802 pages did not exist as far as
any agent was concerned**.

Confirmed the rule is filename-based, not path-based:
`.well-known/security.txt` is in the build and 404s, while
`/oss/python/llms.txt` byte-matches the file my build produced, so
Mintlify is serving my static file by name.

## What changed

Sections now split **by directory** rather than by filename. Every index
is written as `<prefix>/llms.txt`.

An oversized section sheds its heaviest child directories into their own
indexes until the remainder fits, instead of giving every child its own
file — a naive recursive split produced 109 files, most of them a single
page. Descriptions are also dropped from section indexes, which roughly
halves each entry; the root keeps them, since it has room.

| | before | after |
|---|---|---|
| root | 16,449 chars | 21,656 chars |
| section indexes | 9 (5 unreachable) | 56 (all reachable) |
| largest section | 40,101 | 42,263 |
| pages indexed | 2,038 (1,229 visible) | 2,038 |

All 56 are named `llms.txt`, none exceed 50,000 characters, and each is
one hop from the root so the coverage walker still reaches everything.

## The real gap

Every guard I added in #5514 checked **local files**, and nothing
checked they were **served**. The build-time validator passed happily
while a third of the index was unreachable in production.

`scripts/check_llms_urls.py` now verifies each section index returns 200
before it samples page URLs. Run against production today it correctly
reports 52 of 56 unserved, because the new paths are not deployed yet —
that is the check working. A unit test asserts no index is ever named
`llms-N.txt`.

## Still open: LLMS Full Size (a Mintlify routing issue, not a repo one)

The custom `llms-full.txt` **is** being picked up — Mintlify just serves
it on the wrong route. Probing all four endpoints:

| Route | Bytes | Whose |
|---|---:|---|
| `/llms.txt` | 16,449 | ours |
| `/.well-known/llms.txt` | 99,940 | Mintlify's, **truncated** |
| `/llms-full.txt` | 15,101,956 | Mintlify's |
| `/.well-known/llms-full.txt` | 6,246,717 | ours |

The override is applied to exactly one route per file, and they are
crossed. Verified by content rather than size:
`/.well-known/llms-full.txt` opens with `# Docs by LangChain`, while
`/.well-known/llms.txt` still ends with `_Note: this index was truncated
to stay under 100,000 characters; 569 pages and 3 OpenAPI specs
omitted._`. Neither `.well-known` file exists in our build (it contains
only `security.txt`), so both are served by Mintlify's own routing.

Two consequences:

1. **`LLMS Full Size` will keep failing** while the check reads
`/llms-full.txt`, because that route serves Mintlify's 15.1 MB file
regardless of the custom one. Nothing in this repo changes that.
2. **`/.well-known/llms.txt` serves a truncated index** that omits 569
pages, so any agent following the `.well-known` convention gets the
pre-fix file even though the root is correct.

This looks like a Mintlify bug and needs a support ticket, not a code
change here. Their documentation does not describe how custom files
interact with the `.well-known` mirrors. Separately, **no target size
for `llms-full.txt` is documented** by AFDocs or Mintlify, so even with
the routing fixed I cannot say whether 6.2 MB clears the bar.

## Other checks

- **Markdown Content Parity** (warning): unchanged diagnosis, not a
content defect. The only substantive gap is OpenAPI pages, where the
markdown is *richer* than the HTML. Set both parity thresholds to 0 for
informational mode.
- **LLMS TXT Directive Html** (1 of 15 pages), **Page Size Html** (1
page at 59K markdown from 1,195K HTML, 98% boilerplate), **Redirect
Behavior** (1 cross-host redirect): all single-page warnings in
Mintlify-controlled chrome or intentional `reference.langchain.com`
redirects. No repo change proposed.
- **Content Structure** and **Authentication**: skipped, not failures.
Both score 100.

## Validation

- 215 tests pass (1 new)
- `make lint` clean, `make broken-links` clean
- 56 section indexes, 0 named `llms-N.txt`, 0 over 50,000 chars
- 2,038 pages indexed, verified no duplicates and none lost

## AI disclosure

Authored with Claude Code (Claude Opus 5). The serving rule was
established by probing production rather than inferred, after the
previous PR shipped on an untested assumption about exactly this.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 12:49:55 -07:00
Lauren Hirata Singh 5b4af66dff Split llms.txt and llms-full.txt into nested, right-sized corpora (#5514)
## Why

Follow-up to #5504. The custom `llms.txt` that PR added was 286,685
characters, which fails the AFDocs `llms-txt-size` check. This is my
regression: I chose a single large file because I could not verify at
the time whether the checker followed nested indexes. It does — the
check output and the AFDocs reference both specify the nested shape.

## LLMS TXT Size — fail → pass

**Authoritative thresholds** (from the [AFDocs check
reference](https://afdocs.dev/checks/content-discoverability)):

| Result | Condition |
|---|---|
| Pass | Under **50,000** characters |
| Warn | 50,000–100,000 |
| Fail | Over 100,000 |

Note the pass bar is 50 K, not 100 K.

**Size is not the only cost.** An oversized index triggers the AFDocs
[index truncation
coefficient](https://afdocs.dev/agent-score-calculation#index-truncation-coefficient),
which discounts `llms-txt-valid`, `llms-txt-links-resolve`,
`llms-txt-links-markdown`, and `llms-txt-coverage` in proportion to the
visible fraction. At 286,685 characters that is roughly **0.35** — four
*passing* checks were contributing about a third of their weight. Fixing
size restores them to 1.0, so this is worth more than the single failing
check.

### What changed

`_generate_llms_txt` in `pipeline/core/builder.py` now emits a root
index plus section indexes.

Root: **16,449 characters** (was 286,685), listing 9 section indexes and
the 117 pages belonging to no large section.

| File | chars | entries |
|---|---:|---:|
| `/llms.txt` (root) | 16,449 | 117 inline + 9 section links |
| `/oss/python/llms.txt` | 39,983 | 236 |
| `/oss/python/llms-2.txt` | 40,101 | 255 |
| `/oss/python/llms-3.txt` | 5,310 | 47 |
| `/oss/javascript/llms.txt` | 39,957 | 236 |
| `/oss/javascript/llms-2.txt` | 15,778 | 121 |
| `/langsmith/llms.txt` | 39,999 | 271 |
| `/langsmith/llms-2.txt` | 30,851 | 219 |
| `/langsmith/smith-api/llms.txt` | 40,018 | 369 |
| `/langsmith/smith-api/llms-2.txt` | 20,214 | 167 |

Section files target 40 K rather than 50 K so they do not drift over the
threshold as pages are added between splits.

### Three constraints this is built around

- **Coverage must not regress.** AFDocs's coverage walker descends
*exactly one level* into linked `.txt` files, and treats `.txt` files
found at that depth as "omitted subtrees" whose pages leave the coverage
denominator. Every section index is therefore one hop from the root and
contains **zero** further `.txt` links, so all 2,038 pages stay directly
verified. Coverage is currently ~100% and stays there.
- **Link sampling must still see pages.** A root containing only `.txt`
links could starve `llms-txt-links-markdown` and
`llms-txt-links-resolve`. The root keeps 117 real `.md` links (the small
sections, inlined rather than split out) so both checks sample real
pages from the canonical file.
- **Section paths are derived, not hardcoded.** Each section's directory
comes from the deepest directory shared by its pages. An earlier
hardcoded map would have inlined the 60 K OpenAPI group into the root,
defeating the split.

### Verification

- 2,038 `.md` entries across root and sections, **0 duplicates, 0 pages
lost**
- Every file under 50,000 characters
- 0 nested `.txt` links inside section files
- 207 tests pass (1 new, covering root size, one-hop depth, no deeper
nesting, and exact page conservation)
- `make lint` clean, `make broken-links` clean

## Also in this PR

### LLMS Full Size — split into per-language corpora

The combined corpus was 15,050,368 characters. Roughly half was the
Python and TypeScript renders of the same documentation, so the build
now emits three corpora, with the root pointing at the other two:

| File | chars |
|---|---:|
| `/llms-full.txt` | 6,246,717 |
| `/oss/python/llms-full.txt` | 6,801,843 |
| `/oss/javascript/llms-full.txt` | 4,655,598 |

Root is **down 58.5%** from what the check currently sees.

**This requires expanding snippets ourselves.** Mintlify expands snippet
imports at render, so a corpus assembled from the raw build tree would
silently lose content from the 308 pages that import one. Verified page
by page against the published corpus: expansion lands 8–10% *under*
Mintlify's for snippet-heavy pages (`deepagents/customization` 139,256
vs 152,958; `langchain/agents` 64,279 vs 67,990), and only 7 of 1,525
shared pages come out more than 30% larger — all pages that have
genuinely grown since that snapshot.

The combined total exceeds Mintlify's because this covers every built
page (2,038) rather than only the sitemap subset (1,586). The extra
pages are integration pages that are reachable but not in navigation,
which `llms.txt` already indexes; excluding them here would make the two
files disagree about what exists.

Both custom files open with the site title as an H1, which Mintlify
requires of a custom `llms.txt` or `llms-full.txt` and which `LLMS Full
Valid` checks.

**Two caveats worth weighing at review.** This replaces a
Mintlify-maintained, auto-updating artifact with a generator in this
repo, so snippet-expansion correctness is now our problem. And the
expected range is still undocumented by both AFDocs and Mintlify — 6.2
MB is a large reduction, but whether it clears the bar is unverified
until this deploys.

### Correction to #5504

That PR's description claims the base64 removal roughly halved
`llms-full.txt`. **That was inferred, not measured, and it is wrong** —
the live file contains zero base64 and is unchanged in size, so Mintlify
never included data URIs there. The base64 work was still worth doing:
it cut the served `google_imagen` page from 6.69 MB to 7.6 KB, confirmed
live. I have not edited the merged PR body; say the word and I will.

### Markdown Content Parity — warning, no change recommended

Not a content defect. Regular pages differ by 0.7–3.9%, all UI chrome
("skip to main content", "was this page helpful"). The only substantial
gaps are OpenAPI pages, where the **markdown is richer than the HTML**
(175 words vs 55) because the html-only tokens are interactive
API-playground widgets with no markdown equivalent. Per the check's own
guidance, set `--parity-pass-threshold` and `--parity-warn-threshold` to
`0` for informational mode. Trimming markdown to match HTML would make
things worse for agents.

### Content Structure and Authentication — skipped, not failures

Both score 100. `Tabbed Content Serialization` is skipped because no
tabbed content was found in the sample; `Auth Alternative Access`
because all pages are public. Nothing to fix.

## Keeping it correct

Generating our own indexes removes the staleness problem outright. They
rebuild from source on every `make build`, `build/` is gitignored so
nothing can rot in the tree, `publish.yml` builds before deploying, and
new pages are picked up by walking the build tree with no registration
step. That is strictly fresher than what it replaces: Mintlify's
`llms-full.txt` was serving with `age: 25126` against a 24-hour cache
and did not contain pages that were already live.

What it does introduce is **correctness drift**, which nothing would
have noticed. Two guards for the two ways it can happen.

**Build-time validation** (`_validate_llms_indexes`) fails the build
when the emitted files break an invariant agents depend on:

- root `llms.txt` over 50,000 characters
- any section index over the same threshold
- a section index linking to further `.txt` files, which would push
those pages out of the coverage denominator
- a page listed in two indexes, or a page count that disagrees with what
was built

This runs wherever `make build` runs, so CI already covers it through
the link-checking job. Five unit tests exercise each failure mode — a
validator that cannot fail is not a guard.

**A weekly workflow** (`.github/workflows/check-llms-urls.yml`) covers
what no local check can. The API reference URLs are derived by
reproducing Mintlify's slug rules, which is not a published contract,
and a change on their side only surfaces against the deployed site.
`scripts/check_llms_urls.py` samples those URLs, reports any that stop
resolving, and names the two functions to fix. This is the guard that
would have caught the 47 fabricated URLs in #5504.

Worth noting: running the checker before shipping it caught a flaw in
the checker itself. Concurrent HEAD requests reported two healthy pages
as broken, so it now retries and falls back to GET. It is stable across
repeated runs at different seeds.

## Review notes

The one thing I could not verify locally is that Mintlify serves nested
`.txt` files from the build directory. Strong indirect evidence:
`/langsmith/langsmith-platform-openapi.json` returns 200 today, so
nested static assets are served, and nested `llms.txt` paths are not on
Mintlify's reserved-path list. **Worth confirming after deploy** that
`https://docs.langchain.com/oss/python/llms.txt` returns 200 — if it
does not, coverage would fall back to the root's 117 links and the split
should be reverted.

## AI disclosure

Authored with Claude Code (Claude Opus 5). Thresholds were read from the
AFDocs published check reference rather than assumed, and page
conservation was verified programmatically across all ten generated
files.

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 11:55:08 -07:00
Lauren Hirata Singh 0bbb59debd Cut agent-facing page weight: extract base64 images, uncapped llms.txt, split SmithDB migration guide (#5504)
## Why

An agent-readiness audit of docs.langchain.com flagged failures in page
size, llms.txt coverage, and llms-full.txt size. Investigating those
turned up three problems that also affect human readers, and two
reported failures that turned out not to be real.

## What changed

### 1. Extracted 7.9 MB of base64 images out of the markdown

Eight integration pages embedded images as base64 data URIs directly in
their markdown. `google_imagen.mdx` was 6,685,937 characters, of which
6,680,932 were four PNG blobs; two of the four were byte-identical. It
served as a **6.69 MB response**.

That bloat dominated the agent-facing corpus: `llms-full.txt` is 15.1 MB
and this base64 was roughly half of it.

Nine rendered images now live under `src/images/integrations/`, deduped
and recompressed where the source was a photo. **Diagrams and charts
stay byte-identical PNGs** so their text stays crisp. Two blobs sat
inside ```` ```html ```` fences as literal `plt_img_base64()` output
rather than rendered images; those are truncated in place so the example
still shows the shape of a data URI without 52 KB of payload.

Markdown removed: 7,881,055 chars. Images added: 1.08 MB. Build output
drops 30.1 MB → 22.8 MB.

### 2. Custom llms.txt so the index is not truncated

The generated `llms.txt` was capped at 100,000 characters and said so in
its own last line:

> `_Note: this index was truncated to stay under 100,000 characters; 569
pages and 3 OpenAPI specs omitted._`

Coverage was 970 of 1,536 sitemap pages (63%). **This was not a
navigation problem** — 166 of the omitted pages are already in
`docs.json`, including most self-hosted and admin documentation. They
were simply past the cutoff.

Mintlify's docs state that a custom `llms.txt` at the project root
overrides the generated file and is uncapped, so the build now emits
one. **2,038 pages indexed, up from 970.**

OpenAPI endpoint pages never exist as MDX (Mintlify renders them at
deploy time), so they are derived from the specs referenced in
`docs.json`. Deriving them correctly took three passes — see the review
note below.

### 3. Split the SmithDB SDK migration guide by API area

At **514,135 characters served** this was the largest page on the site
by a factor of three. It reads as 9 KB of source because the bulk
arrives through 292 nested snippet imports, so neither file-size checks
nor the audit's page sample ever flagged it.

The guide keeps its URL as an overview (context, deprecation dates,
minimum SDK versions, exceptions, discontinued methods) plus a card
group linking to six per-area pages. Worst page: **514 K → ~150 K**.

Runs are split across two pages rather than one: `runs-query` alone
expands to 110 K, so grouping it with retrieve and get-URL would have
left a ~251 K page and largely defeated the split.

## Areas needing careful review

- **The embedded agent prompt.** The guide told coding agents to fetch
the single `.md` as the source of truth. The split would have silently
broken that, so the prompt now lists the per-area URLs. Worth a read to
confirm it still reads correctly to an agent.
- **Anchor links.** Three snippets deep-linked to `#runs-query` and
`#traces-query` and described them as appearing "above". Those now point
at the area pages. **`make broken-links` does not catch this** — it
validates paths, not anchors. `#exceptions` and `#about-self-hosted`
still resolve, since both sections stay on the overview.
- **Card descriptions and area prose** on the six new pages are newly
written. Each factual claim was checked against the snippets
(`list_runs`→`runs.query`, `read_run`→`runs.retrieve`, `get_run_url`).

## Found in self-review

A self-audit pass caught defects in my own earlier commits, fixed in
4cfe5f5:

- **47 fabricated API URLs in llms.txt.** The slug rule was wrong twice:
underscores were collapsed to hyphens (the spec carries both
`annotation-queues` and `annotation_queues` as distinct tags rendering
to different directories), and `x-hidden` operations were emitted
despite Mintlify rendering no page for them. Plus apostrophes became
separators, and duplicate summaries were dropped rather than given
Mintlify's numeric suffix. Derived URLs now match the production sitemap
exactly: **599 derived, 599 present, 0 fabricated.**
- **An upscaled image.** `sips -Z` enlarges images smaller than the
target, so a 602×800 photo became 770×1024 — inventing pixels.
Regenerated at native size, and smaller on disk.

Three regression tests cover the tag-slug rule, apostrophe handling, and
hidden/duplicate operations.

## Two reported failures that are not real

- **Markdown URL support (reported 87%)**: not reproducible. 120 random
sitemap URLs all return 200 for `.md`; 60/60 for HTML.
`/oss/langchain/models` 404s for both HTML and `.md` because that URL
does not exist — the canonical is `/oss/python/langchain/models`. No
change made.
- **Content parity (reported 2 of 14 pages)**: not a defect. Regular
pages differ by 0.7–3.9%, all UI chrome. The only >10% gaps are OpenAPI
pages, where the **markdown is richer than the HTML** (175 words vs 55)
— the html-only tokens are API-playground widgets. No change made.

## Not included

Changelog splitting is deliberately out of scope. Measured growth
(self-hosted ~22 KB/month) means no humane time boundary holds 100 KB,
and changelogs are the page type where truncation degrades gracefully
since they are reverse-chronological.

## Validation

- `make build` clean
- `make lint` and `make lint_prose` clean on all touched files
- `make broken-links`: no broken links
- 206 tests pass (3 new)
- 45 random derived API URLs re-checked against production: all 200
- llms.txt: 0 malformed entries, 0 empty titles, 0 duplicate URLs across
2,038 lines

## AI disclosure

Authored with Claude Code (Claude Opus 5). All findings were verified
against the live site, the OpenAPI specs, and production sitemap rather
than asserted; the self-review section above documents defects it caught
in its own earlier work.

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-13 16:25:01 -07:00
Christian Bromann e1f0057791 fix(mda): stop serving unversioned MDA pages outside nav (#5391) 2026-08-07 20:19:05 +02:00
Florence Morris 2f9e4c6723 Reconcile MDA docs with public beta changes (#5329)
Follow-up cleanup branch for PR #5262, based on the current
`fjmorris/DOC-1403` branch. These commits were verified against
`managed-deepagents==0.5.0.dev89`.

Commit 1 updates the Managed Deep Agents docs to match the public beta
identity model: identity scopes memory and credentials, threads are
always user-owned, and organization-scoped identity/memory is no longer
documented. It removes the outdated identity scope explorer and updates
related MDA docs and snippets.

Commit 2 updates the Slack connector docs for BYOK app setup: users
bring their own Slack app, configure `SLACK_SIGNING_SECRET` and
`SLACK_BOT_TOKEN`, and point Events API requests at
`/connectors/slack/events`. It removes stale managed Slack app
provisioning claims from the Slack connector page, connector overview,
CLI reference, and deploy docs.

Commit 3 refreshes the integrations catalog and `mda connect` docs for
the current public beta behavior: the catalog now matches `mda connect
--list`, includes marketplace MCP connectors such as Notion, Cloudflare,
Neon, Netlify, Prisma, Vanta, and Close, and documents OAuth,
secret-backed, credential-free, and BYOK Slack setup. It also updates
the CLI flag table and uses `LANGSMITH_WORKSPACE_ID` for tool server
routing.

Commit 4 reconciles the CLI reference with the current public beta
command surface: it adds `mda build`, `mda logs`, and `mda delete` /
`mda destroy`, documents current `mda init` flags, fixes `mda dev
--no-browser`, removes stale `mda deploy --host-url`, and corrects
deploy/log/delete defaults.

Commit 5 runs a cross-page consistency cleanup after the identity,
Slack, integrations, and CLI updates: it removes stale channels
terminology from the overview, replaces tenant wording with organization
wording, and cleans up generic ingress language while preserving literal
`MDA_INGRESS_SECRET` and `X-MDA-Ingress-Secret` names.

Commit 6 fixes the MDA identity page markup found during validation by
removing duplicate closing `Card` / `CardGroup` tags. Validation passed
with `make lint_prose`, `make broken-links`, and `make
broken-links-with-anchors`.

Commit 7 updates the MDA install and release-stage wording: Python
install examples now use `uv tool install --prerelease allow
managed-deepagents`, and access/release-stage copy now says public beta
instead of private beta across the overview, deploy, middleware,
quickstart, and shared snippets.

---------

Co-authored-by: Christian Bromann <git@bromann.dev>
Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
Co-authored-by: victorm-lc <victor@langchain.dev>
2026-08-07 07:35:55 -07:00
Naomi Pentrel cd7a388969 add OpenWiki docs (#5265) 2026-08-06 18:14:35 +02:00
Naomi Pentrel c57dfa0839 Fix emdashes in integrations (#5293) 2026-08-04 18:47:54 +02:00
Naomi Pentrel 5907a8d9cc fix link checking for snippets (#5179) 2026-07-29 13:16:04 +02:00
Naomi Pentrel 00ac537f93 fix lint for tests (#5178) 2026-07-29 13:00:52 +02:00
SpiliosDmk 82349a99f7 fix: inline LangGraph Agent Server note to fix broken link (#5166)
Co-authored-by: Naomi Pentrel <5212232+npentrel@users.noreply.github.com>
2026-07-29 12:27:14 +02:00
Naomi Pentrel b4a89165c5 curate integrations docs for integrations with less than 50K monthly downloads (#4865) 2026-07-28 14:25:28 +02:00
Naomi Pentrel b10426a000 make dcode docs language agnostic (#5100) 2026-07-26 21:57:36 +02:00
Naomi Pentrel 6777368f14 update dcode structure (#4713) 2026-07-09 13:17:46 +02:00
langsmith-fleet[bot] 30f5996d45 Fix link display text for LangSmith URLs to use autolink format (#4720)
Fixes DOC-1334

## Summary

- Changed `[https://smith.langchain.com](https://smith.langchain.com)`
style links to `<https://smith.langchain.com>` (angle-bracket autolink
format) on `cloud.mdx` and `regions-faq.mdx`
- This ensures the full URL including the `https://` scheme is reliably
displayed as link text in Mintlify's renderer
- Affected files: `src/langsmith/cloud.mdx` (Note component + regional
table) and `src/langsmith/regions-faq.mdx`

## Links

- Linear: https://linear.app/langchain/issue/DOC-1334
- Slack:
https://langchain.slack.com/archives/C09G1T60QV9/p1783106143127929

## Verification

- Not run; docs-only link syntax change.
- Cross-reference check passed: `make check-cross-refs` 

## Reviewers

Requested review from: @katmayb, @fjmorris

---------

Co-authored-by: Docs Bot <docs-bot@langchain.dev>
Co-authored-by: Kathryn May <kathryn@langchain.dev>
2026-07-06 09:52:56 -04:00
Lauren Hirata Singh e66e4dbd5b fix: language toggle script and fix langsmith→oss links (#4684)
Fixes DOC-1317 and
https://langchain.slack.com/archives/C0990EP5N0N/p1782913559544209

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 17:19:59 -04:00
Mason Daugherty ca2f3ee1ca dcode: rework goals and rubrics guide (#4675)
Deep Agents Code now has a dedicated guide for choosing between goals
and rubrics instead of putting workflow details on the overview page.
The overview keeps a concise capability link, while the new page
explains when to use a goal, when to use a rubric, and how persistent
versus one-turn criteria work.

---------

Co-authored-by: Naomi Pentrel <5212232+npentrel@users.noreply.github.com>
2026-07-01 12:33:43 -04:00
Daniel Kneipp 171aa6d98f Add docs mise and pre-commit config (#4329) 2026-06-18 14:40:19 +02:00
Christian Bromann 93040fcf8e feat(oss): add new streaming docs (#3763)
Document the new Projection Streaming model across LangGraph, LangChain,
and Deep Agents, while preserving Mode Streaming as the lower-level
Pregel stream mode reference.

Adds LangGraph streaming docs for overview, projection streaming,
protocol, remote streaming, in-process vs remote behavior, custom
transformers, and EventLog vs StreamChannel. Adds consolidated LangChain
and Deep Agents streaming projection pages, updates navigation and
redirects, and refreshes related cross-links so users land on the
recommended application-facing streaming docs.

---------

Co-authored-by: Naomi Pentrel <5212232+npentrel@users.noreply.github.com>
Co-authored-by: Nick Hollon <nick.hollon@langchain.dev>
2026-05-13 09:08:18 -07:00
Naomi Pentrel 5af6480745 update for lint error (#3902) 2026-05-07 17:22:52 +02:00
Lauren Hirata Singh 781f3d5092 Consolidate LangSmith CTA links with clean UTM tracking (#3900)
Added a build pipeline preprocessor
(pipeline/preprocessors/utm_links.py) that auto-tags LangSmith signup
links with UTM
parameters at build time, so CTA attribution collapses to a single
trackable URL in GA/Looker. Normalized 39 files with
inconsistent trailing slashes and manually tagged the home page card CTA
(the only JSX href the preprocessor can't reach).

Fixes DOC-1088
2026-05-07 10:53:09 -04:00
Naomi Pentrel 7ec9ae83cc update gpt model (#3671) 2026-04-22 10:55:24 -04:00
Naomi Pentrel 7f8707b7fb create deep research tutorial (#3193) 2026-03-23 19:00:56 +01:00
Christian Bromann db88d56726 fix(playground): add sub page for playground (#3198)
Creating a docs.langchain.com/playground subpage.
2026-03-20 01:26:41 -04:00
Mason Daugherty e0d7bb27e9 feat: add CI check for unresolved @[ref] cross-references (#3051)
## Description
Adds a check that validates all `@[ref]` cross-references in source
MDX/MD files resolve against entries in `link_map.py`. Previously,
unresolved references silently passed through the build pipeline and
appeared as raw `@[ClassName]` text in the published docs. Available via
`make check-cross-refs`.

Note: I couldn't modify `.github/workflows/_check-links.yml` due to
workflow permissions. To integrate into CI, add this step to
`_check-links.yml` after "Install Python dependencies":
```yaml
- name: Check for unresolved cross-references
  run: make check-cross-refs
```

## Test Plan
- [ ] `make check-cross-refs` reports unresolved references with file,
line number, and scope
- [ ] 12 unit tests covering: valid refs, unresolved refs, scope fences,
code block skipping, escaped refs, titled refs, backtick refs, and
code-samples exclusion

---------

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Co-authored-by: Naomi Pentrel <5212232+npentrel@users.noreply.github.com>
2026-03-13 17:35:55 -04:00
Mason Daugherty 5a17fc0df3 switch to tyfor type checking (#3121) 2026-03-13 17:18:19 -04:00
Mason Daugherty ae12b17d07 cleanup build logs (#3118) 2026-03-13 17:10:12 -04:00
Dev Patel 6d96029e57 fix: Added markdown parser logic to detect code block fences (#2374)
## Overview
The Autolink preprocessor was transforming @[...] patterns found inside
triple-backtick code blocks, causing false positive warnings when code
contained regex patterns like email validators or character classes
(e.g., @[a-zA-Z0-9.-]).

Changes:

* Added code block detection to `replace_autolinks()` using
`markdown-it-py` token parsing
* Lines within triple-backtick fences are now skipped from autolink
transformation
* Fence markers and code block content are preserved unchanged in output
* Conditional scope markers (:::language) outside code blocks continue
to work correctly

## Type of change

**Type:** Bug

## Related issues/PRs
https://github.com/langchain-ai/docs/issues/2069

To automatically close an issue when this PR is merged, use closing
keywords:
- "closes #2069"

## Checklist
<!-- Put an 'x' in all boxes that apply -->
- [x] I have read the [contributing guidelines](README.md)
- [x] I have tested my changes locally using `docs dev`
- [x] All code examples have been tested and work correctly
- [x] I have used **root relative** paths for internal links
- [x] I have updated navigation in `src/docs.json` if needed

## Additional notes
For these changes, I added `markdown-it-py` package as a dependency. In
addition to that, I haven't added any unit test cases to test my changes
because I am not able to find any unit test cases related to this
Autolink preprocessors. Let me know if you would like to add those then
I am happy to do that.

---------

Co-authored-by: Mason Daugherty <mason@langchain.dev>
Co-authored-by: Mason Daugherty <github@mdrxy.com>
2026-03-13 16:54:29 -04:00
Christian Bromann c0ac46fe0a feat: frontend docs (#2930)
## Overview

Split the monolithic streaming/frontend documentation pages into
individual pattern-specific pages across LangChain, LangGraph, and
DeepAgents. Each page covers a single frontend pattern (tool calling,
human-in-the-loop, branching chat, etc.) with an interactive playground
embed powered by the `@langchain/docs-sandbox` npm package.

Also restructures the "Streaming" nav groups into a top-level
"Streaming" page and a new "Frontend" nav group for each product.

## Type of change

**Type:** New documentation page / Update existing documentation

## Related issues/PRs

- GitHub issue:
- Feature PR:
- Linear issue:
- Slack thread:

## Checklist

- [x] I have read the [contributing guidelines](README.md)
- [x] I have tested my changes locally using `docs dev`
- [ ] All code examples have been tested and work correctly
- [ ] I have used **root relative** paths for internal links
- [ ] I have updated navigation in `src/docs.json` if needed

(Internal team members only / optional): Create a preview deployment as
necessary using the [Create Preview Branch
workflow](https://github.com/langchain-ai/docs/actions/workflows/create-preview-branch.yml)

## Additional notes

### New frontend pattern pages

**LangChain** (10 pages):
`tool-calling`, `human-in-the-loop`, `branching-chat`,
`optimistic-updates`, `reasoning-tokens`, `structured-output`,
`async-iterator-tools`, `message-queues`, `join-rejoin`, `time-travel`

**DeepAgents** (2 pages):
`subagent-streaming`, `todo-list`

**LangGraph** (1 page):
`graph-execution`

Each page includes a `<PatternEmbed>` component that renders an
interactive playground preview from the `@langchain/docs-sandbox`
package.

### Playground embed build pipeline

The `PatternEmbed` component is now sourced from the
`@langchain/docs-sandbox` npm package rather than being manually
maintained in the source tree:

- Added `package.json` with `@langchain/docs-sandbox@0.0.3` dependency
- Added `.npmrc` with `legacy-peer-deps=true` (needed because the
package declares a peer dependency using pnpm's `workspace:*` protocol)
- Updated `pipeline/core/builder.py` to copy
`node_modules/@langchain/docs-sandbox/dist/PatternEmbed.jsx` →
`build/snippets/pattern-embed.jsx` during the build step
- CI pipelines need to run `npm install` before building docs

### Navigation changes (`src/docs.json`)

- Collapsed `Streaming` sub-group (overview + frontend) into a single
top-level `streaming` page under LangChain and DeepAgents
- Added new `Frontend` nav groups for LangChain (10 pages), DeepAgents
(3 pages including overview), and LangGraph (2 pages including overview)

---------

Co-authored-by: Naomi Pentrel <5212232+npentrel@users.noreply.github.com>
2026-03-12 08:26:10 -07:00
Lauren Hirata Singh 0c0850270d fix reported issues (#2896)
Fixes issues reported after rebrand

Fixes DOC-811
Fixes DOC-817
Fixes DOC-814
Fixes DOC-812
2026-03-03 12:06:07 -05:00
Mason Daugherty 8350e675a1 chore: update outdated models (#2887) 2026-03-03 09:18:15 -05:00
Mason Daugherty 1f16946e54 fix(ci): only flag langchain_core imports for symbols actually re-exported by langchain (#2503)
Fixes false positives in the import checker where symbols like
`BaseMessage` were flagged despite not being re-exported by `langchain`.

The module-level mapping (`langchain_core.messages` ->
`langchain.messages`) caused all imports from that module to be flagged.

Now each imported symbol is verified against the symbol-level mappings
before flagging.
2026-02-05 15:47:08 -05:00
John Kennedy 7ddbe3b2d1 Adding security.txt (#2097)
## Overview
https://securitytxt.org/

## Checklist
<!-- Put an 'x' in all boxes that apply -->
- [x] I have read the [contributing guidelines](README.md)
- [x] I have tested my changes locally using `docs dev`
- [x] All code examples have been tested and work correctly
- [x] I have used **root relative** paths for internal links
- [x] I have updated navigation in `src/docs.json` if needed

(Internal team members only / optional): Create a preview deployment as
necessary using the [Create Preview Branch
workflow](https://github.com/langchain-ai/docs/actions/workflows/create-preview-branch.yml)

## Additional notes
<!-- Any other information that would be helpful for reviewers -->
2026-01-06 14:13:58 -05:00
Mason Daugherty 228ff53980 fix(infra): security enhancements (#1610) 2025-11-24 13:01:50 -05:00
Mason Daugherty a54b65ce43 fix(ci): import check regex pattern (#1588) 2025-11-22 17:49:54 -05:00
Mason Daugherty 2745dc5d30 feat(ci): validate imports from langchain (#1445)
Introduces an automated system to detecting and manage incorrect imports
from `langchain_core` in favor of using the re-exports from `langchain`.

* Added `check-import-mappings.yml` workflow to periodically analyze the
latest version of `langchain_core`, check for re-exports in `langchain`
(and generate `import_mappings.json`), and automatically create PRs to
update the mappings cache in this repo.
* Added `check_import_mappings.py` to fetch latest package releases,
introspect `langchain` public `__init__` files, and generate a detailed
mapping of re-exported members from `langchain_core`. Uses the previous
local `import_mappings.json`
* Added `check-pr-imports.yml` workflow to run on PRs, ensuring inbound
contributions use `langchain` imports when available, and comment on PRs
with specific guidance if issues are found.
* Uses `check_pr_imports.py` to analyze PR diffs against the import
mappings, detect incorrect `langchain_core` imports, and output
suggested fixes for contributors.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-22 17:28:42 -05:00
Sydney Runkle 946a685169 revert interactive diagram (#860)
not rendering properly live at the moment, going to revert for now and
can debug later
2025-10-13 09:02:45 -04:00
Sydney Runkle b9c6486c15 feat: use new interactive HTML application for middleware (#853)
* Remove old images no longer being used
* Add new images in an auto-generated JSON file
* add widget to middleware page demoing new middleware :)
* auto generated mermaid diagrams confirm correct graph structure for
middleware implementation
* js and python implementations 🚀 


https://github.com/user-attachments/assets/ab7a47cf-6dd3-4bbb-aa16-73cd3c231bea

Totally open to structural changes etc to this code, just wanted to get
an initial example in
2025-10-13 08:41:19 -04:00
Mason Daugherty c83608fe5f chore: linting, formatting, bumps (#658)
* Bump to latest actions, `mint`, Python, lock
* Run linting/formatting/tests
2025-09-25 23:11:45 -04:00
Lauren Hirata Singh e69a3328ed Lint files + add a PR labeler (#534)
## Overview
- make lint / make format
- added a PR labeler

## Type of change
**Type:**  Infra

## Related issues/PRs
<!-- Link to related issues, feature PRs, or discussions (if applicable)
-->
- GitHub issue:
- Feature PR:

<!-- For LangChain employees, if applicable: -->
- Linear issue:
- Slack thread:

## Checklist
<!-- Put an 'x' in all boxes that apply -->
- [x] I have read the [contributing guidelines](README.md)
- [x] I have tested my changes locally using `docs dev`
- [x] All code examples have been tested and work correctly
- [x] I have used **root relative** paths for internal links
- [x] I have updated navigation in `src/docs.json` if needed
- [x] I have gotten approval from the relevant reviewers
- [ ] (Internal team members only / optional) I have created a preview
deployment using the [Create Preview Branch
workflow](https://github.com/langchain-ai/docs/actions/workflows/create-preview-branch.yml)

## Additional notes
<!-- Any other information that would be helpful for reviewers -->
2025-09-15 11:18:50 -04:00
Lauren Hirata Singh f806aee37c update dir structure for langchain (#407)
Co-authored-by: Mason Daugherty <mason@langchain.dev>
Co-authored-by: Brody <beklapko@gmail.com>
2025-09-08 11:38:19 -04:00
Eugene Yurtsev 063eb8c5e1 patch: ignore temporary files in build pipeline to fix some hot reload issues (#371)
This was breaking hot-reload for me as errors were being raised due to
temporarily files created by the IDE.
2025-09-04 09:20:27 -04:00
Lauren Hirata Singh 73b2089b82 update docs dev to hot reload (#238) 2025-08-27 15:12:16 -04:00
Lauren Hirata Singh 9f99bb9773 LangGraph migration (#109)
Co-authored-by: Brody <beklapko@gmail.com>
Co-authored-by: Brody Klapko <brody@langchain.dev>
2025-08-13 13:07:10 -07:00
Eugene Yurtsev a6d04c6757 docs: handle some edge cases and add error messages (#101) 2025-08-02 11:05:46 -04:00
Eugene Yurtsev b5c93179ce chore(parser): Support parsing conditional blocks (#77)
Parse conditional blocks
2025-07-30 11:52:39 -04:00
Lauren Hirata Singh abdae69e99 new pill logos and update docusaurus script (#75) 2025-07-29 13:53:26 -04:00
Lauren Hirata Singh 78c07da2fd fix homepage styling (WIP) (#70) 2025-07-27 11:00:42 -04:00
Eugene Yurtsev fe122a37e7 In place migration (#40)
* Update nav to look the same
* Add stubs for all content
2025-06-13 10:53:18 -04:00
Eugene Yurtsev 44f4136d90 Add code to drop extensions from internal links (#37)
* Replace suffix to md (not mdx temporarily to make it easier to
side-by-side compare)
* Drop extensions from internal links to be consistent w/ what mdx
requires
2025-06-12 16:26:03 -04:00
Eugene Yurtsev 04bfddf20e handle some blank line issues in parser (#36)
* Handle missing language in code block
* Handle some blank lines
* Handle front matter correctly
2025-06-12 12:58:59 -04:00