mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-02 01:23:07 +00:00
Harrison/update docs mem (#201)
This commit is contained in:
parent
05c5d0b8ee
commit
d4e6b7a692
11
docs/examples/memory.rst
Normal file
11
docs/examples/memory.rst
Normal file
@ -0,0 +1,11 @@
|
||||
Memory
|
||||
======
|
||||
|
||||
The examples here are all related to working with the concept of Memory in LangChain.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:glob:
|
||||
:caption: Memory
|
||||
|
||||
memory/*
|
@ -76,7 +76,7 @@
|
||||
" suffix=suffix, \n",
|
||||
" input_variables=[\"input\", \"chat_history\"]\n",
|
||||
")\n",
|
||||
"memory = ConversationBufferMemory(dynamic_key=\"chat_history\")"
|
||||
"memory = ConversationBufferMemory(memory_key=\"chat_history\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -29,3 +29,9 @@ They vary greatly in complexity and are combination of generic, highly configura
|
||||
## Agents
|
||||
As opposed to a chain, whether the steps to be taken are known ahead of time, agents
|
||||
use an LLM to determine which tools to call and in what order.
|
||||
|
||||
## Memory
|
||||
By default, Chains and Agents are stateless, meaning that they treat each incoming query independently.
|
||||
In some applications (chatbots being a GREAT example) it is highly important to remember previous interactions,
|
||||
both at a short term but also at a long term level. The concept of "Memory" exists to do exactly that.
|
||||
|
||||
|
@ -290,10 +290,20 @@
|
||||
"conversation_with_summary.predict(input=\"Very cool -- what is the scope of the project?\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "5c8735cc",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### More Resources on Memory\n",
|
||||
"\n",
|
||||
"This just scratches the surface of what you can do with memory. For more examples on things like how to implement custom memory classes, how to add memory to a custom LLM chain and how to use memory with and agent, please see the [How-To: Memory](../../examples/memory) section."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "0eb11bd0",
|
||||
"id": "436dda66",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
|
@ -120,6 +120,7 @@ Start here if you haven't used LangChain before.
|
||||
examples/integrations.rst
|
||||
examples/chains.rst
|
||||
examples/agents.rst
|
||||
examples/memory.rst
|
||||
examples/model_laboratory.ipynb
|
||||
|
||||
More elaborate examples and walk-throughs of particular
|
||||
|
Loading…
Reference in New Issue
Block a user