Skip to content

Commit

Permalink
Merge branch 'main' of github.com:langchain-ai/langgraphjs into jacob…
Browse files Browse the repository at this point in the history
…/command
  • Loading branch information
jacoblee93 committed Dec 6, 2024
2 parents ae8193d + c713acd commit 92e5bb4
Show file tree
Hide file tree
Showing 25 changed files with 1,264 additions and 208 deletions.
2 changes: 1 addition & 1 deletion docs/docs/concepts/memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ Long-term memory in LangGraph allows systems to retain information across differ
LangGraph stores long-term memories as JSON documents in a [store](persistence.md#memory-store) ([reference doc](https://langchain-ai.github.io/langgraphjs/reference/classes/checkpoint.BaseStore.html)). Each memory is organized under a custom `namespace` (similar to a folder) and a distinct `key` (like a filename). Namespaces often include user or org IDs or other labels that makes it easier to organize information. This structure enables hierarchical organization of memories. Cross-namespace searching is then supported through content filters. See the example below for an example.

```typescript
import { InMemoryStore } from "@langchain/langgraph/store";
import { InMemoryStore } from "@langchain/langgraph";

// InMemoryStore saves data to an in-memory dictionary. Use a DB-backed store in production use.
const store = new InMemoryStore();
Expand Down
4 changes: 3 additions & 1 deletion docs/docs/how-tos/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ LangGraph makes it easy to manage conversation [memory](../concepts/memory.md) i
- [How to manage conversation history](manage-conversation-history.ipynb)
- [How to delete messages](delete-messages.ipynb)
- [How to add summary of the conversation history](add-summary-conversation-history.ipynb)
- [How to add long-term memory (cross-thread)](cross-thread-persistence.ipynb)
- [How to use semantic search for long-term memory](semantic-search.ipynb)

### Human-in-the-loop

Expand Down Expand Up @@ -207,4 +209,4 @@ These are the guides for resolving common errors you may find while building wit
- [GRAPH_RECURSION_LIMIT](../troubleshooting/errors/GRAPH_RECURSION_LIMIT.ipynb)
- [INVALID_CONCURRENT_GRAPH_UPDATE](../troubleshooting/errors/INVALID_CONCURRENT_GRAPH_UPDATE.ipynb)
- [INVALID_GRAPH_NODE_RETURN_VALUE](../troubleshooting/errors/INVALID_GRAPH_NODE_RETURN_VALUE.ipynb)
- [MULTIPLE_SUBGRAPHS](../troubleshooting/errors/MULTIPLE_SUBGRAPHS.ipynb)
- [MULTIPLE_SUBGRAPHS](../troubleshooting/errors/MULTIPLE_SUBGRAPHS.ipynb)
1 change: 1 addition & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ nav:
- how-tos/manage-conversation-history.ipynb
- how-tos/delete-messages.ipynb
- how-tos/add-summary-conversation-history.ipynb
- how-tos/semantic-search.ipynb
- Human-in-the-loop:
- Human-in-the-loop: how-tos#human-in-the-loop
- how-tos/breakpoints.ipynb
Expand Down
15 changes: 13 additions & 2 deletions examples/how-tos/react-system-prompt.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,18 @@
"\n",
"This tutorial will show how to add a custom system prompt to the prebuilt ReAct agent. Please see [this tutorial](./create-react-agent.ipynb) for how to get started with the prebuilt ReAct agent\n",
"\n",
"You can add a custom system prompt by passing a string to the `messageModifier` param.\n",
"You can add a custom system prompt by passing a string to the `stateModifier` param.\n",
"\n",
"<div class=\"admonition tip\">\n",
" <p class=\"admonition-title\">Compatibility</p>\n",
" <p>\n",
" The <a href=\"https://langchain-ai.github.io/langgraphjs/reference/types/langgraph_prebuilt.CreateReactAgentParams.html\"><code>stateModifier</code></a> parameter was added in <code>@langchain/langgraph>=0.2.27</code>.\n",
" <br />\n",
" If you are on an older version, you will need to use the deprecated <code>messageModifier</code> parameter.\n",
" <br />\n",
" For help upgrading, see <a href=\"/langgraphjs/how-tos/manage-ecosystem-dependencies/\">this guide</a>.\n",
" </p>\n",
"</div>\n",
"\n",
"## Setup\n",
"\n",
Expand Down Expand Up @@ -88,7 +99,7 @@
"// We can add our system prompt here\n",
"const prompt = \"Respond in Italian\"\n",
"\n",
"const agent = createReactAgent({ llm: model, tools: [getWeather], messageModifier: prompt });"
"const agent = createReactAgent({ llm: model, tools: [getWeather], stateModifier: prompt });"
]
},
{
Expand Down
Loading

0 comments on commit 92e5bb4

Please sign in to comment.