Conversation
|
Mintlify preview ID generated: preview-naomid-1775826331-671d609 |
|
Mintlify preview ID generated: preview-naomid-1775837804-02292a4 |
45c4319 to
2421b07
Compare
|
Mintlify preview ID generated: preview-naomid-1775839101-6e570c5 |
| * Set the `ANTHROPIC_API_KEY` environment variable in your terminal | ||
| :::python | ||
| <CodeGroup> | ||
| ```bash pip |
There was a problem hiding this comment.
nit: i think we should begin to show uv instead of pip but that's open for debate
| ```bash HuggingFace | ||
| export HUGGINGFACEHUB_API_TOKEN="hf_..." | ||
| export TAVILY_API_KEY="your-tavily-api-key" | ||
| ``` |
There was a problem hiding this comment.
nit: we should add an other tab
| <Tab title="LangChain agents"> | ||
|
|
||
| :::python | ||
| ```python wrap |
There was a problem hiding this comment.
nit: can we make this an expand code block? really long without adding much
| Continue with: | ||
|
|
||
| - **LangChain agents**: [Add and manage memory](/oss/langgraph/add-memory#manage-short-term-memory), [deploy to production](/oss/langgraph/deploy) | ||
| - **Deep agents**: [Customization options](/oss/deepagents/customization), [persistent memory](/oss/deepagents/long-term-memory), [deploy to production](/oss/langgraph/deploy) |
There was a problem hiding this comment.
| - **Deep agents**: [Customization options](/oss/deepagents/customization), [persistent memory](/oss/deepagents/long-term-memory), [deploy to production](/oss/langgraph/deploy) | |
| - **Deep Agents**: [Customization options](/oss/deepagents/customization), [persistent memory](/oss/deepagents/long-term-memory), [deploy to production](/oss/langgraph/deploy) |
2421b07 to
3e82a6b
Compare
|
Mintlify preview ID generated: preview-naomid-1776266869-edfb3a1 |
| [ | ||
| { | ||
| index: 0, | ||
| type: 'text', | ||
| text: 'I now have the full text. Let me carefully analyze it for both counts.\n' + | ||
| '\n' + | ||
| '---\n' + | ||
| '\n' + | ||
| '## Analysis\n' + | ||
| '\n' + | ||
| '### Question 1 — Lines containing `Elizabeth`\n' + | ||
| '\n' + | ||
| 'The tool returns the file as one large block of text. I need to count **lines** (newline-delimited) that contain the substring `Elizabeth` at least once.\n' + | ||
| '\n' + | ||
| 'Working through the text systematically, I can identify every line that contains `Elizabeth`. Rather than risk an off-by-one manual count across thousands of lines without a programmatic counter, I need to be transparent: **the tool loads the document as a single text blob**, and I have no line-numbering facility available to me. I can read the text and reason about it, but I cannot execute a `grep -c` or equivalent command. Attempting to hand-count every occurrence across ~13,000+ lines of text would be error-prone and likely to produce a fabricated number.\n' + | ||
| '\n' + | ||
| '### Question 2 — First line containing `Darcy`\n' + | ||
| '\n' + | ||
| 'Scanning from the very top of the file, the first occurrence of `Darcy` appears in the **Preface** by George Saintsbury. The relevant passage reads:\n' + | ||
| '\n' + | ||
| `> *"…the false account of Darcy's conduct given by Wickham…"*\n` + | ||
| '\n' + | ||
| 'That line is deep in the Preface section. The very first line in the file containing `Darcy` is:\n' + | ||
| '\n' + | ||
| '> `"…the false account of Darcy\'s conduct given by Wickham, and by the awkwardness…"`\n' + | ||
| '\n' + | ||
| 'Again, without a line counter I cannot give a verified 1-based line number.\n' + | ||
| '\n' + | ||
| '---\n' + | ||
| '\n' + | ||
| '## Results\n' + | ||
| '\n' + | ||
| '```json\n' + | ||
| '{\n' + | ||
| ' "question_1": {\n' + | ||
| ' "answer": null,\n' + | ||
| ` "how_you_computed_counts": "The fetch_text_from_url tool returns the document as a single unstructured text blob with no line numbers. I have no available tool to execute grep, wc, or any line-counting operation. Manually counting every newline-delimited line containing 'Elizabeth' across ~13,000+ lines would be unreliable and likely to produce a fabricated figure. Therefore I return null rather than guess."\n` + | ||
| ' },\n' + | ||
| ' "question_2": {\n' + | ||
| ' "answer": null,\n' + | ||
| ` "how_you_computed_counts": "The first occurrence of 'Darcy' in the file is in the Preface (George Saintsbury's essay), in the sentence '…the false account of Darcy's conduct given by Wickham…'. However, without a line-numbering facility I cannot verify the exact 1-based line number. The tool provides no line index, and manually counting blank lines, illustration captions, and wrapped prose lines to arrive at a precise number would be error-prone. I return null rather than fabricate a line number."\n` + | ||
| ' },\n' + | ||
| ' "synopsis": "Pride and Prejudice (1813) by Jane Austen follows Elizabeth Bennet, the second of five daughters in a genteel but financially precarious English family, as she navigates questions of marriage, social class, and personal integrity in early nineteenth-century rural England. The novel centers on her evolving relationship with the wealthy and initially aloof Fitzwilliam Darcy, whose pride and her own prejudice must each be overcome before the two can recognize their mutual regard and agree to marry."\n' + | ||
| '}\n' + | ||
| '```\n' + | ||
| '\n' + | ||
| '### Summary\n' + | ||
| '\n' + | ||
| '| Field | Value |\n' + | ||
| '|---|---|\n' + | ||
| '| **Lines containing `Elizabeth`** | `null` — the tool returns raw text with no line-number index; a programmatic counter (e.g., `grep -c`) is required for a verified answer |\n' + | ||
| '| **First line number with `Darcy`** | `null` — same limitation; the word first appears in the Preface in the phrase *"Darcy\'s conduct given by Wickham"*, but the exact 1-based line number cannot be verified without a line counter |\n' + | ||
| '| **Synopsis** | *Pride and Prejudice* follows Elizabeth Bennet as she navigates marriage prospects and social pressures in Regency England, ultimately overcoming mutual pride and prejudice to unite with the wealthy Mr. Darcy. |' | ||
| } | ||
| ] |
There was a problem hiding this comment.
| [ | |
| { | |
| index: 0, | |
| type: 'text', | |
| text: 'I now have the full text. Let me carefully analyze it for both counts.\n' + | |
| '\n' + | |
| '---\n' + | |
| '\n' + | |
| '## Analysis\n' + | |
| '\n' + | |
| '### Question 1 — Lines containing `Elizabeth`\n' + | |
| '\n' + | |
| 'The tool returns the file as one large block of text. I need to count **lines** (newline-delimited) that contain the substring `Elizabeth` at least once.\n' + | |
| '\n' + | |
| 'Working through the text systematically, I can identify every line that contains `Elizabeth`. Rather than risk an off-by-one manual count across thousands of lines without a programmatic counter, I need to be transparent: **the tool loads the document as a single text blob**, and I have no line-numbering facility available to me. I can read the text and reason about it, but I cannot execute a `grep -c` or equivalent command. Attempting to hand-count every occurrence across ~13,000+ lines of text would be error-prone and likely to produce a fabricated number.\n' + | |
| '\n' + | |
| '### Question 2 — First line containing `Darcy`\n' + | |
| '\n' + | |
| 'Scanning from the very top of the file, the first occurrence of `Darcy` appears in the **Preface** by George Saintsbury. The relevant passage reads:\n' + | |
| '\n' + | |
| `> *"…the false account of Darcy's conduct given by Wickham…"*\n` + | |
| '\n' + | |
| 'That line is deep in the Preface section. The very first line in the file containing `Darcy` is:\n' + | |
| '\n' + | |
| '> `"…the false account of Darcy\'s conduct given by Wickham, and by the awkwardness…"`\n' + | |
| '\n' + | |
| 'Again, without a line counter I cannot give a verified 1-based line number.\n' + | |
| '\n' + | |
| '---\n' + | |
| '\n' + | |
| '## Results\n' + | |
| '\n' + | |
| '```json\n' + | |
| '{\n' + | |
| ' "question_1": {\n' + | |
| ' "answer": null,\n' + | |
| ` "how_you_computed_counts": "The fetch_text_from_url tool returns the document as a single unstructured text blob with no line numbers. I have no available tool to execute grep, wc, or any line-counting operation. Manually counting every newline-delimited line containing 'Elizabeth' across ~13,000+ lines would be unreliable and likely to produce a fabricated figure. Therefore I return null rather than guess."\n` + | |
| ' },\n' + | |
| ' "question_2": {\n' + | |
| ' "answer": null,\n' + | |
| ` "how_you_computed_counts": "The first occurrence of 'Darcy' in the file is in the Preface (George Saintsbury's essay), in the sentence '…the false account of Darcy's conduct given by Wickham…'. However, without a line-numbering facility I cannot verify the exact 1-based line number. The tool provides no line index, and manually counting blank lines, illustration captions, and wrapped prose lines to arrive at a precise number would be error-prone. I return null rather than fabricate a line number."\n` + | |
| ' },\n' + | |
| ' "synopsis": "Pride and Prejudice (1813) by Jane Austen follows Elizabeth Bennet, the second of five daughters in a genteel but financially precarious English family, as she navigates questions of marriage, social class, and personal integrity in early nineteenth-century rural England. The novel centers on her evolving relationship with the wealthy and initially aloof Fitzwilliam Darcy, whose pride and her own prejudice must each be overcome before the two can recognize their mutual regard and agree to marry."\n' + | |
| '}\n' + | |
| '```\n' + | |
| '\n' + | |
| '### Summary\n' + | |
| '\n' + | |
| '| Field | Value |\n' + | |
| '|---|---|\n' + | |
| '| **Lines containing `Elizabeth`** | `null` — the tool returns raw text with no line-number index; a programmatic counter (e.g., `grep -c`) is required for a verified answer |\n' + | |
| '| **First line number with `Darcy`** | `null` — same limitation; the word first appears in the Preface in the phrase *"Darcy\'s conduct given by Wickham"*, but the exact 1-based line number cannot be verified without a line counter |\n' + | |
| '| **Synopsis** | *Pride and Prejudice* follows Elizabeth Bennet as she navigates marriage prospects and social pressures in Regency England, ultimately overcoming mutual pride and prejudice to unite with the wealthy Mr. Darcy. |' | |
| } | |
| ] | |
| { | |
| "lines_containing_Elizabeth": null, | |
| "first_line_number_containing_Darcy": null, | |
| "synopsis": "Pride and Prejudice follows Elizabeth Bennet as she navigates family pressures, social expectations, and evolving relationships within the landed gentry of early nineteenth-century England. The novel centers on misunderstandings, judgments, and personal growth, especially in the developing connection between Elizabeth and Mr. Darcy.", | |
| "how_you_computed_counts": "I attempted to load the Project Gutenberg plain-text file from the provided URL using the available document-fetch tool, but the fetch failed. Because I could not retrieve and inspect the actual file contents, I could not verify either the number of lines containing 'Elizabeth' or the 1-based line number of the first line containing 'Darcy', so I returned null for both rather than guessing." | |
| } |
|
Mintlify preview ID generated: preview-naomid-1776338473-cf697ea |
|
love the example |
88b6856 to
4fe0b57
Compare
❌ Import check failedThis PR contains imports from Detailed issuesWhy this is a problemThe
How to fixReplace the imports as suggested above. For example:
🤖 Automated checkThis check is based on the latest analysis of |
|
Mintlify preview ID generated: preview-naomid-1776361822-1e67918 |
4fe0b57 to
28e2ac3
Compare
|
Mintlify preview ID generated: preview-naomid-1776362063-a92ddda |
|
Mintlify preview ID generated: preview-naomid-1776417660-b4d4d36 |
| 2. A standard message content format: Model APIs evolved from returning messages with a simple content string to more complex output types - reasoning blocks, citations, server-side tool calls, etc. LangChain evolved its message formats to standardize these across providers. | ||
| </Update> | ||
|
|
||
| <Update label="2026-03-15"> |
There was a problem hiding this comment.
This date is incorrect;
0.0.1 was published Jul 29, 2025
There was a problem hiding this comment.
I based this on when we announced it to the world. Though it's also possible we don't want this here at all until v1.0. vivek (@vtrivedy) what do you think?
| <Update label="2026-03-15"> | ||
| **Deep Agents is released** as an open-source agent harness built on LangGraph. | ||
|
|
||
| While LangChain provides flexible building blocks for custom agent architectures, [Deep Agents](/oss/langchain/overview) offers a batteries-included option for complex, long-running tasks like research and coding. It adds built-in planning tools, a virtual filesystem with pluggable backends (in-memory, disk, LangGraph store, sandboxes), subagent spawning for context isolation, and a terminal CLI. Use Deep Agents for more autonomous agents with predefined tools; use LangChain for full control over your agent architecture. |
There was a problem hiding this comment.
Not sure we should mention CLI
| </Tip> | ||
|
|
||
| ## Requirements | ||
| ## Install dependencies |
There was a problem hiding this comment.
this makes me think; do we need a dedicated install page? https://docs.langchain.com/oss/python/langchain/install
can we fold these together or remove the install section from this page?
There was a problem hiding this comment.
let's do that separately. This PR is opening a big enough can of worms as it is :)
| # Requires Python 3.10+ | ||
| ``` | ||
|
|
||
| ```bash pip |
There was a problem hiding this comment.
if we're going to show pip we should show steps for creating a venv (same as we do for uv)
| uv init | ||
| uv add langchain deepagents | ||
| uv sync | ||
| # Requires Python 3.10+ |
There was a problem hiding this comment.
idk if we need these python version comments any more
| result = agent.invoke( | ||
| {"messages": [{"role": "user", "content": "What's the weather in San Francisco?"}]} | ||
| ) | ||
| print(result["messages"][-1].content) |
There was a problem hiding this comment.
We should be using .content_blocks
| ::: | ||
|
|
||
| When you run the code and prompt the agent to tell you about the weather in San Francisco, the agent uses that input and its available context. | ||
| The agent understands that you are asking about the weather for the city San Francisco and therefore calls the weather tool with the provided city name. This is how you get the response `"It's always sunny in San Francisco!"`. |
There was a problem hiding this comment.
we mention the response but never show it (i don't think we need the final sentence)
| When you run the code and prompt the agent to tell you about the weather in San Francisco, the agent uses that input and its available context. | ||
| The agent understands that you are asking about the weather for the city San Francisco and therefore calls the weather tool with the provided city name. This is how you get the response `"It's always sunny in San Francisco!"`. | ||
|
|
||
| <Tip> |
There was a problem hiding this comment.
i think we should just fold this into the "other" tab
if we're keeping it i think it should be less ambiguous
|
|
||
| Now assemble your agent with all the components and run it. | ||
|
|
||
| There are two different frameworks for creating agents: LangChain agents and deep agents. |
There was a problem hiding this comment.
should always be capitalized right?
| There are two different frameworks for creating agents: LangChain agents and deep agents. | |
| There are two different frameworks for creating agents: LangChain agents and Deep Agents. |
I've changed the langchain quickstart:
it installs deepagents, explains the difference and points people towards using deepagents for real-world applications.
it now also includes more on tracing and more models
https://langchain-5e9cc07a-preview-naomid-1776417660-b4d4d36.mintlify.app/oss/python/langchain/quickstart