AgentMemory
The AgentMemory_Memory node is a component designed to provide memory capabilities for agent-based conversations in the your solutions. It allows agents to remember the state of conversations across interactions.
Node Details
- Name: agentMemory
- Type: AgentMemory
- Version: 1.0
- Category: Memory
- Icon: agentmemory.svg
Description
This node implements memory functionality for agentflow, enabling it to maintain context and remember the state of conversations. It primarily uses SQLite as the database backend but is designed with flexibility to potentially support other database types in the future.
Base Classes
- AgentMemory
- All base classes of SqliteSaver
Parameters
Parameters
Inputs
Inputs
-
Database Type
- Type: options
- Options: SQLite (default)
- Description: Type of database to use for memory storage
- Options: SQLite (default)
- Description: Type of database to use for memory storage
-
Database File Path (optional)
-
Database File Path (optional)
- Type: string
- Description: Path to the SQLite database file. If left empty, it uses the default application database
- Description: Path to the SQLite database file. If left empty, it uses the default application database
- Placeholder: C:\Users\User.ardor\database.sqlite
-
Additional Connection Configuration (optional)
-
Additional Connection Configuration (optional)
- Type: json
- Description: Extra database connection parameters in JSON format
- Description: Extra database connection parameters in JSON format
Initialization Process
The init
method sets up the memory system with the following steps:
- Processes input parameters (database type, file path, and additional configuration).
- Determines the thread ID from the session or chat ID.
- Configures the data source options.
- For SQLite:
- Resolves the database file path.
- Creates a SqliteSaver instance with necessary options.
Usage
This node is crucial for maintaining conversation context in agent-based systems. It allows the agent to access and store information about the ongoing conversation, enabling more coherent and context-aware interactions.
Integration
The AgentMemory_Memory node integrates with the broader solution by:
- Utilizing the application’s data source.
- Accessing database entities provided by the solution.
- Using environment variables and user home directory for default configurations.
Note
While currently focused on SQLite, the structure of the node suggests it’s designed to potentially support other database types in the future, allowing for scalability and flexibility in deployment scenarios.