Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.alibaba.cloud.ai</groupId>
<artifactId>spring-ai-alibaba</artifactId>
<version>${revision}</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<groupId>com.alibaba.cloud.ai.autoconfigure.memory.long</groupId>
<artifactId>spring-ai-alibaba-autoconfigure-memory-long</artifactId>

<name>Spring AI Alibaba Long Memory Autoconfiguration</name>
<description>Spring AI Alibaba Long Memory Autoconfiguration</description>
<url>https://github.com/alibaba/spring-ai-alibaba</url>
<scm>
<connection>git://github.com/alibaba/spring-ai-alibaba.git</connection>
<developerConnection>git@github.com:alibaba/spring-ai-alibaba.git</developerConnection>
<url>https://github.com/alibaba/spring-ai-alibaba</url>
</scm>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>com.alibaba.cloud.ai</groupId>
<artifactId>spring-ai-alibaba-starter-memory-mem0</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.cloud.ai.memory.mem0.config;
package com.alibaba.cloud.ai.autoconfigure.memory;

import com.alibaba.cloud.ai.memory.mem0.core.Mem0MemoryStore;
import com.alibaba.cloud.ai.memory.mem0.core.Mem0ServiceClient;
Expand All @@ -37,7 +37,8 @@ public class Mem0ChatMemoryAutoConfiguration {

@Bean
public Mem0ServiceClient mem0ServiceClient(Mem0ChatMemoryProperties properties, ResourceLoader resourceLoader) {
Mem0ServiceClient mem0ServiceClient = new Mem0ServiceClient(properties, resourceLoader);
Mem0ServiceClient mem0ServiceClient = new Mem0ServiceClient(properties.getClient(), properties.getServer(),
resourceLoader);
logger.info("Initialized Mem0Service Client.success!");
// Pass the client configuration items to the Server to initialize the Mem0
// instance
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright 2024-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.cloud.ai.autoconfigure.memory;

import com.alibaba.cloud.ai.memory.mem0.core.Mem0Client;
import com.alibaba.cloud.ai.memory.mem0.core.Mem0Server;
import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = Mem0ChatMemoryProperties.MEM0_PREFIX)
public class Mem0ChatMemoryProperties {

public static final String MEM0_PREFIX = "spring.ai.alibaba.mem0";

private Mem0Client client;

private Mem0Server server;

public Mem0Client getClient() {
return client;
}

public void setClient(Mem0Client client) {
this.client = client;
}

public Mem0Server getServer() {
return server;
}

public void setServer(Mem0Server server) {
this.server = server;
}

}
Original file line number Diff line number Diff line change
@@ -1,142 +1,176 @@
{
"groups": [
{
"name": "spring.ai.memory.mem0",
"type": "com.alibaba.cloud.ai.autoconfigure.memory.Mem0ChatMemoryProperties",
"sourceType": "com.alibaba.cloud.ai.autoconfigure.memory.Mem0ChatMemoryProperties"
}
],
"properties": [
{
"name": "spring.ai.alibaba.mem0.client.base-url",
"type": "java.lang.String",
"description": "Base URL for the Mem0 client service.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Client",
"defaultValue": "http://localhost:8888"
},
{
"name": "spring.ai.alibaba.mem0.client.timeout-seconds",
"type": "java.lang.Integer",
"description": "Timeout in seconds for client operations.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Client",
"defaultValue": 30
},
{
"name": "spring.ai.alibaba.mem0.client.max-retry-attempts",
"type": "java.lang.Integer",
"description": "Maximum number of retry attempts for failed operations.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Client",
"defaultValue": 3
},
{
"name": "spring.ai.alibaba.mem0.server.version",
"type": "java.lang.String",
"description": "Version of the Mem0 server to connect to."
},
"description": "Version of the Mem0 server to connect to.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"},
{
"name": "spring.ai.alibaba.mem0.server.vector-store.provider",
"type": "java.lang.String",
"description": "Provider for the vector store (e.g., qdrant, chroma, pgvector, pinecone, mongodb, milvus, baidu, upstash_vector, azure_ai_search, redis, elasticsearch, vertex_ai_vector_search, opensearch, supabase, weaviate, faiss, langchain)."
"description": "Provider for the vector store (e.g., qdrant, chroma, pgvector, pinecone, mongodb, milvus, baidu, upstash_vector, azure_ai_search, redis, elasticsearch, vertex_ai_vector_search, opensearch, supabase, weaviate, faiss, langchain).",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.vector-store.config",
"type": "java.util.Map<java.lang.String,java.lang.String>",
"description": "Configuration map for the vector store provider."
"description": "Configuration map for the vector store provider.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.graph-store.provider",
"type": "java.lang.String",
"description": "Provider for the graph store."
"description": "Provider for the graph store.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.graph-store.config.url",
"type": "java.lang.String",
"description": "URL for the graph store connection."
"description": "URL for the graph store connection.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.graph-store.config.username",
"type": "java.lang.String",
"description": "Username for the graph store authentication."
"description": "Username for the graph store authentication.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.graph-store.config.password",
"type": "java.lang.String",
"description": "Password for the graph store authentication."
"description": "Password for the graph store authentication.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.graph-store.config.database",
"type": "java.lang.String",
"description": "Database name for Neo4j graph store."
"description": "Database name for Neo4j graph store.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.graph-store.config.base-label",
"type": "java.lang.Boolean",
"description": "Base label setting for Neo4j graph store."
"description": "Base label setting for Neo4j graph store.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.graph-store.custom-prompt",
"type": "java.lang.String",
"description": "Custom prompt template for graph store operations."
"description": "Custom prompt template for graph store operations.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.llm.provider",
"type": "java.lang.String",
"description": "Provider for the LLM service."
"description": "Provider for the LLM service.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.llm.config.api-key",
"type": "java.lang.String",
"description": "API key for the LLM service."
"description": "API key for the LLM service.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.llm.config.temperature",
"type": "java.lang.Double",
"description": "Temperature setting for LLM responses."
"description": "Temperature setting for LLM responses.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.llm.config.model",
"type": "java.lang.String",
"description": "Model name for the LLM service."
"description": "Model name for the LLM service.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.llm.config.openai-base-url",
"type": "java.lang.String",
"description": "Base URL for OpenAI-compatible services."
"description": "Base URL for OpenAI-compatible services.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.embedder.provider",
"type": "java.lang.String",
"description": "Provider for the embedding service."
"description": "Provider for the embedding service.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.embedder.config.api-key",
"type": "java.lang.String",
"description": "API key for the embedding service."
"description": "API key for the embedding service.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.embedder.config.model",
"type": "java.lang.String",
"description": "Model name for the embedding service."
"description": "Model name for the embedding service.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.embedder.config.openai-base-url",
"type": "java.lang.String",
"description": "Base URL for OpenAI-compatible embedding services."
"description": "Base URL for OpenAI-compatible embedding services.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.history-db-path",
"type": "java.lang.String",
"description": "Path to the history database."
"description": "Path to the history database.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.project.custom-categories",
"type": "java.lang.String",
"description": "Custom categories for the project."
"description": "Custom categories for the project.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.project.custom-instructions",
"type": "java.lang.String",
"description": "Custom instructions for the project."
"description": "Custom instructions for the project.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.custom-fact-extraction-prompt",
"type": "java.lang.String",
"description": "Custom prompt for fact extraction."
"description": "Custom prompt for fact extraction.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
},
{
"name": "spring.ai.alibaba.mem0.server.custom-update-memory-prompt",
"type": "java.lang.String",
"description": "Custom prompt for memory updates."
"description": "Custom prompt for memory updates.",
"sourceType": "com.alibaba.cloud.ai.memory.mem0.core.Mem0Server"
}
]
],
"hints": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#
# Copyright 2025-2025 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
com.alibaba.cloud.ai.autoconfigure.memory.Mem0ChatMemoryAutoConfiguration
Loading
Loading