diff --git a/mkdocs/framework/cat-components/cheshire_cat/tool_chain.md b/mkdocs/framework/cat-components/cheshire_cat/tool_chain.md index 2ef63dd87..875adfee1 100644 --- a/mkdocs/framework/cat-components/cheshire_cat/tool_chain.md +++ b/mkdocs/framework/cat-components/cheshire_cat/tool_chain.md @@ -6,7 +6,7 @@ The decision on *whether* and *which* action should be taken to fulfill the user The Tool Agent uses the language model to outline a "reasoning" and accomplish the user's request with the tools retrieved from the Cat's [procedural memory](../memory/long_term_memory.md). -The tools selection and usage is planned according to a set of [instructions](../prompts/main_prompt.md#instructions). +The tools selection and usage is planned according to a set of [instructions](../prompts/instructions.md). Finally, the Tool Agent parses the formatting of the tool output. ![Schema of the Cheshire Cat memories](../../../assets/img/diagrams/tool-chain.jpg){width=650px style="display: block; margin: 0 auto"} diff --git a/mkdocs/framework/cat-components/llm.md b/mkdocs/framework/cat-components/llm.md index 3290069eb..f3aa9dbbf 100644 --- a/mkdocs/framework/cat-components/llm.md +++ b/mkdocs/framework/cat-components/llm.md @@ -31,6 +31,6 @@ For instance, measuring the distance between two points can inform us about the ## Language Models flow :material-information-outline:{ title="click on the nodes with hooks to see their documentation" } !!! note "Developer documentation" - [Language Models hooks](../../API_Documentation/mad_hatter/core_plugin/hooks/models.md) + [Language Models hooks](../../plugins/hooks.md#__tabbed_1_5) Nodes with the 🪝 point the execution places where there is an available [hook](../../plugins/plugins.md) to customize the execution pipeline. diff --git a/mkdocs/framework/cat-components/plugins.md b/mkdocs/framework/cat-components/plugins.md index e5e85c981..f1d3521cf 100644 --- a/mkdocs/framework/cat-components/plugins.md +++ b/mkdocs/framework/cat-components/plugins.md @@ -11,8 +11,8 @@ The [plugins manager](cheshire_cat/mad_hatter.md) takes care of collecting all t ## Tools -Tools are custom Python functions that are called by the [Tool Agent](cheshire_cat/agent.md#tool-chain). -They come with a rich docstring upon with the [Tool Agent](cheshire_cat/agent.md) chooses *whether* and *which* tool is the most suitable to fulfill the user's request. +Tools are custom Python functions that are called by the [Tool Agent](cheshire_cat/tool_chain.md). +They come with a rich docstring upon with the Tool Agent chooses *whether* and *which* tool is the most suitable to fulfill the user's request. The list of available tools ends up in the [Instruction Prompt](prompts/instructions.md), that instructs the [Tool Agent](cheshire_cat/agent.md) on how to structure its reasoning. ![Schema of the Cheshire Cat components](../../assets/img/diagrams/plugin2.jpg){width=300px} diff --git a/mkdocs/framework/cat-components/prompts/instructions.md b/mkdocs/framework/cat-components/prompts/instructions.md index 7f07c9d09..a8220eafb 100644 --- a/mkdocs/framework/cat-components/prompts/instructions.md +++ b/mkdocs/framework/cat-components/prompts/instructions.md @@ -1,7 +1,7 @@ # Instructions Prompt -The Instruction Prompt explains the [Tool Agent](../cheshire_cat/agent.md#tool-chain) how to format its reasoning. -The [Tool Agent](../cheshire_cat/agent.md) uses a [chain](https://docs.langchain.com/docs/components/chains/llm-chain) +The Instruction Prompt explains the [Tool Agent](../cheshire_cat/tool_chain.md) how to format its reasoning. +The [Tool Agent](../cheshire_cat/agent.md) uses a [chain](https://python.langchain.com/v0.2/docs/introduction/) to decide *when* and *which* [tool](../plugins.md) is the most appropriate to fulfill the user's needs. By default, it is set to Langchain [instructions format](https://api.python.langchain.com/en/latest/agents/langchain.agents.conversational.base.ConversationalAgent.html?highlight=prompt%20format_instruction) @@ -24,3 +24,4 @@ AI: [your response here]""" ``` where the placeholder `{tool_names}` is replaced with the list of Python [tools](../plugins.md) retrieved from the [procedural memory](../memory/long_term_memory.md). + diff --git a/mkdocs/framework/cat-components/prompts/main_prompt.md b/mkdocs/framework/cat-components/prompts/main_prompt.md index 5c6b49a5f..f02b03572 100644 --- a/mkdocs/framework/cat-components/prompts/main_prompt.md +++ b/mkdocs/framework/cat-components/prompts/main_prompt.md @@ -1,6 +1,6 @@ # Main Prompt -The Main Prompt is the set of instructions that is fed to the [Agent Manager](../cheshire_cat/agent.md), when using the [**memory chain**](../cheshire_cat/agent.md#memory-chain). +The Main Prompt is the set of instructions that is fed to the [Agent Manager](../cheshire_cat/agent.md), when using the [**memory chain**](../cheshire_cat/memory_chain.md). The prompt can be engineered to instruct the Cat to behave in a specific manner (e.g. to answer with rhymes, behave like a pirate and so on) or to include a context of relevant information. @@ -11,7 +11,7 @@ This prompt is split in two parts: More in details, the former contains the instructions about whom the Cat is and how to behave; the latter embeds a set of variables like the user's message and the memories retrieved from the [long term memory](../memory/long_term_memory.md) among the others. -Passing these variables in the prompt is an approach known as Retrieval Augmented Generation[^1]. +Passing these variables in the prompt is an approach known as Retrieval Augmented Generation. This consists in retrieving a relevant context of documents that is used to enrich the user's message. In the following sections, we explain the prompt components. @@ -59,6 +59,6 @@ The purpose of this component is to gather few variables, that are: ## References -[^1]: Lewis, P., Perez, E., Piktus, A., Petroni, F., Karpukhin, V., Goyal, N., ... & Kiela, D. (2020). Retrieval-augmented generation for knowledge-intensive nlp tasks. Advances in Neural Information Processing Systems, 33, 9459-9474. +- Lewis, P., Perez, E., Piktus, A., Petroni, F., Karpukhin, V., Goyal, N., ... & Kiela, D. (2020). Retrieval-augmented generation for knowledge-intensive nlp tasks. Advances in Neural Information Processing Systems, 33, 9459-9474. -[^2]: Gao, L., Ma, X., Lin, J., & Callan, J. (2022). Precise Zero-Shot Dense Retrieval without Relevance Labels. arXiv preprint arXiv:2212.10496. +- Gao, L., Ma, X., Lin, J., & Callan, J. (2022). Precise Zero-Shot Dense Retrieval without Relevance Labels. arXiv preprint arXiv:2212.10496. diff --git a/mkdocs/plugins/debugging/vscode.md b/mkdocs/plugins/debugging/vscode.md index 466aa6648..9a42d02f7 100644 --- a/mkdocs/plugins/debugging/vscode.md +++ b/mkdocs/plugins/debugging/vscode.md @@ -1,6 +1,6 @@ # 🚀 Debug with Visual Studio Code -The `Debug Server for VSCode` plugin helps you to debug the Cat with Visual Studio Code, install it from the [public plugins registry](../../quickstart/installing-plugin.md#manual-installation#Through-the-Admin-Dashboard) or [download the zip file](https://github.com/sambarza/cc-vscode-debugpy) (and follow the [Manual Instruction](../../quickstart/installing-plugin.md#manual-installation)). +The `Debug Server for VSCode` plugin helps you to debug the Cat with Visual Studio Code, install it from the [public plugins registry](../../quickstart/installing-plugin.md#through-the-admin-dashboard) or [download the zip file](https://github.com/sambarza/cc-vscode-debugpy) (and follow the [Manual Instruction](../../quickstart/installing-plugin.md#manual-installation)). ## Add a new port to the container