Configuring MemMachine
MemMachine has one primary file that is used for configuration,cfg.yml.
Understanding Configuration Settings
You can customize your application’s settings with two types of configuration: Global and Local.
- Global Configuration acts as the default setting for all your applications. Think of it as your standard setup that everything uses unless told otherwise. This file should reside in your Project root directory.
- Local Configuration is used when you need to make specific, one-time adjustments for a single session or task. This is best for situations where you have multiple agents, and wish to configure each agent differently. The file should reside in the root directory for each individual agent.
cfg.yml file using YAML syntax. Below, we will explore the various configuration options available to you.
Tailor MemMachine to Your Needs
Check out the following configuration options, an example of how to set, where to set, and a link to more information about the variable options.Logging
Logging
Logging parameters manage the path and level of logging desired.
An example of these parameters in a config file would look like the following:
| Parameter | Required? | Default | Description |
|---|---|---|---|
path | No | /tmp/memory_log | Sets the path and file name where logging will be kept. |
level | No | info | Choice between three levels: info, debug, or error |
Long-Term Memory
Long-Term Memory
Parameters that pertain to Long-Term memory settings.
An example of these parameters in a config file would look like the following:
| Parameter | Required? | Default | Description |
|---|---|---|---|
derivative_deriver | No | sentence | Sets the method for deriving new, insightful information from a memory’s content (can choose identity or sentence). |
metadata_derivative_format | No | N/A | A template string for formatting derived metadata from memory content. Uses bracket notation to pull properties like user_metadata[source_timestamp] and isolation_properties[producer_id]. |
embedder | No | N/A | The ID of the embedder model to use for generating vector embeddings for long-term memory. |
reranker | No | N/A | The ID of the reranker to use for reordering search results to improve relevance. |
vector_graph_store | No | N/A | The ID of the storage vendor to use for long-term memory and vector graph storage. |
Profile Memory
Profile Memory
Parameters that pertain to Profile memory settings.
| Parameter | Required? | Default | Description |
|---|---|---|---|
llm_model | Yes | testmodel | The language model for profile extraction. |
embedding_model | Yes | N/A | The model for generating vector embeddings for profile memory. |
database | Yes | profile_storage | Connection to the profile database. Passing this default allows you to establish all other variables within that subsection. |
prompt | Yes | profile_prompt. | The system prompts to be used for profile memory. |
SessionDB
SessionDB
There is only one parameter for SessionDB, which is the connection URI.
An example of these parameters in a config file would look like the following:
| Parameter | Required? | Default | Description | |
|---|---|---|---|---|
uri | Yes | sqlitetest.db | A configuration dictionary containing the database connection URI. If this field is blank, MemMachine will create an SQLitetest.db. |
Model
Model
The model parameters are used to establish the LLM model to be used with MemMachine.
An example of these parameters in a config file would look like the following:
The ‘another_model_id` can be any unique identifier you choose. Just be sure you use that unique identifier when referencing the model elsewhere in your configuration. Example holds AWS Bedrock required configuration information
| Parameter | Required? | Default | Description |
|---|---|---|---|
testmodel | Yes | testmodel | This is the default configuration ID for MemMachine using openai. |
model_vendor | Yes | ’openai’ | The vendor of the model (e.g., openai, amazon-bedrock). |
model | Yes | ”gpt-4o-mini” | The name of the model to use (e.g., gpt-4o-mini). |
api_key | Yes | N/A | Only required if using openai, required if using default set up |
another_model_id | No | another_model_id | Unique identifier for another model configuration. |
Storage
Storage
Parameters that pertain to Storage settings.The Storage database that can be chosen for our Memory to use. You need to set parameters for both
my_storage_id and profile_storage to use different databases for long-term memory and profile memory respectively.
Only the Neo4j graph database is supported at this time for Storage (Episodic Memory) and POSTGRESS for Profile Memory.
| Parameter | Required? | Default | Description |
|---|---|---|---|
<ID>.vendor_name | Yes | neo4j | The name of the database vendor to use (e.g., neo4j). |
<ID>.host | Yes | localhost | The hostname or IP address of the database server. |
<ID>.port | Yes | 7687 | The port number for the database connection. |
<ID>.user | Yes | N/A | The username for database authentication. |
<ID>.password | Yes | N/A | The password for database authentication. |
profile_storage | Yes | N/A | The configuration for the profile database using Postgres. |
<ID>.vendor_name | Yes | postgres | The name of the database vendor to use for profile storage. |
<ID>.host | Yes | localhost | The hostname or IP address of the profile database server. |
<ID>.port | Yes | 5432 | The port number for the profile database connection. |
<ID>.user | Yes | postgres | The username for profile database authentication. |
<ID>.db_name | Yes | postgres | The name of the profile database. |
<ID>.password | Yes | N/A | The password for profile database authentication. |
Session Memory
Session Memory
| Parameter | Required? | Default | Description |
|---|---|---|---|
model_name | No | N/A | The ID of the model to use for session memory. |
message_capacity | No | 500 | The maximum number of messages to store in session memory. |
max_message_length | No | 16000 | The maximum length of a message in session memory. |
max_token_num | No | 8000 | The maximum number of tokens to store in session memory. |
Embedder
Embedder
The Embedder model that we choose to use.
An example of these parameters in a config file would look like the following:
aws_embedder_id parameters are only required for AWS Bedrock embedding models. The default, my_embedder_id, is set up for OpenAI embedding models. | Parameter | Required? | Default | Description |
|---|---|---|---|
my_ebedder_id | No | N/A | Tag for your default embedder. Use if using OpenAI. |
<ID>.name | No | openai | The vendor name of your embedder. |
<ID>.model_name | No | ”text-embedding-3-small” | The model type of your embedder. Should be by the vendor designated in name. |
<ID>.api_key | No | N/A | Your API Key for use with OpenAI |
Reranker
Reranker
Parameters to set for the chosen Reranker.
An example of these parameters in a config file would look like the following:
aws_reranker_id parameters are only required for AWS Bedrock reranking models. If you choose to use AWS Bedrock for your reranker, be sure to list it under your reranker_ids and define it appropriately. The
ce_ranker_id is for use only on systems that have GPUs| Parameter | Required? | Default | Description |
|---|---|---|---|
my_reranker_id | Yes | N/A | This tag defines the rerankers you wish to use. |
<ID>.type | Yes | N/A | The type of reranker to use (e.g., rrf-hybrid, identity, bm25, cross-encoder, amazon-bedrock). |
<ID>.reranker_ids | Yes | N/A | A list of reranker IDs to be used in the hybrid reranker. |
id_ranker_id | No | N/A | An identity reranker configuration. |
bm_ranker_id | No | N/A | A BM25 reranker configuration. |
ce_ranker_id | No | ”cross-encoder” | A cross-encoder reranker configuration. |
<ID>.model_name | No | N/A | The model name for the cross-encoder reranker. |
aws_reranker_id | No | N/A | Tag should you choose to use AWS Bedrock for your Reranker. |
<ID>.region | No | N/A | The AWS region for the Bedrock reranker (e.g., us-west-2). |
<ID>.aws_access_key_id | No | N/A | The AWS access key ID for Bedrock authentication. |
<ID>.aws_secret_access_key | No | N/A | The AWS secret access key for Bedrock authentication. |
<ID>.model_id | No | N/A | The Bedrock model ID to use for reranking. |

