Conversational Agent¶
 (1) (1) (1) (1) (1) (1).png)
Conversational Agent Node
Set Up the Conversational Agent¶
Prerequisites:¶
- An AKILIBOT account.
- An Ollama language model endpoint (for example https://ollama.com/).
- A Redis instance for AI (for example https://redis.io/redis-for-ai/).
Context:¶
Unlike standard large language models (LLMs), which provide general-purpose models for performing language-based tasks, conversational agents are more sophisticated as they are designed specifically for managing conversations effectively.
You can use Akilibot conversational agent to create a comprehensive and interactive conversation experience.
Steps:¶
-
Access the Chatflows menu.
- Open your browser and go to https://akilibot.dev.
- In Akilibot, click Chatflows.
-
Create a new chatflow:
- Click Add New.
- Enter a name for your chatflow and click Save.
-
Add a conversational agent node:
- Click Add Node.
- Search for the conversational agent.
- Drag and drop the conversational agent node into your chatflow workspace.
-
Add a SearchAPI node. This node enables the agent to fetch data from Google search results:
- Click Add Node.
- Search for the SearchAPI node. It displays in the Tools section of the search results.
- Drag and drop the SearchAPI node into your chatflow workspace.
- Create a free SearchAPI account and retrieve your SearchAPI API key. The SearchAPI node needs this key to authenticate and perform search queries.
- On the SearchAPI node, click Connect Credentials > Create New.
- Enter a name for your credentials e.g. SearchAPI Credentials, copy and paste your SearchAPI API key into the SearchAPI API Key field and click Add.
- Connect the SearchAPI node to the Conversational Agent node by drawing a line from the Output section of the SearchAPI node to the Allowed Tools Inputs section of the Conversational Agent node.
- Click Save Chatflow to save your progress.
-
Add a ChatOllama chat model node. This node enables the agent to use Ollama language models to generate responses:
- Click Add Node.
- Search for the ChatOllama node. It displays in the Chat Models section of the search results.
- Drag and drop the ChatOllama node into your chatflow workspace.
- On the Model Name field, enter the model you’d like to use. We recommend llama3.2.
- On the Temperature field, set a temperature value between 0 and 1. The temperature parameter controls the randomness of the model's responses. Low temperature produces deterministic and focused responses. High temperature produces creative and varied responses. We recommend a temperature value of 0.5.
- Connect the ChatOllama node to the Conversational Agent node by drawing a line from the Output section of the ChatOllama node to the Chat Model Inputs section of the Conversational Agent node.
- Click Save Chatflow to save your progress.
-
Add a Redis chat memory node. This node enables the agent to remember previous interactions and store them in the chat history, enhancing the overall user experience:
- Click Add Node.
- Search for the Redis-Backed Chat Memory node. It displays in the Memory section of the search results.
- Drag and drop the Redis-Backed Chat Memory node into your chatflow workspace.
- On the Redis-Backed Chat Memory node, click Connect Credentials > Create New.
- Enter either your Redis API username and password or your Redis credential name and URL and click Add.
- Connect the Redis-Backed Chat Memory node to the Conversational Agent node by drawing a line from the Output section of the Redis node to the Memory Inputs section of the Conversational Agent node.
- Click Save Chatflow to save your progress.
Result:¶
By following these steps, you will have successfully created a conversational agent that you can chat with and ask questions.
Next Steps:¶
Click the chat icon to interact with your newly created conversational agent.
Related Links and Troubleshooting:¶
For additional information and troubleshooting, refer to the Redis documentation for the LangChain conversational agent.