mem0ai-azure-mysql 0.1.116.12__py3-none-any.whl → 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mem0/__init__.py +1 -1
- mem0/configs/llms/base.py +1 -1
- mem0/embeddings/configs.py +3 -14
- mem0/graphs/configs.py +6 -62
- mem0/llms/azure_openai.py +1 -1
- mem0/llms/configs.py +2 -20
- mem0/memory/main.py +0 -861
- mem0/utils/factory.py +3 -55
- mem0/vector_stores/configs.py +2 -23
- mem0ai_azure_mysql-0.2.0.data/data/README.md +181 -0
- mem0ai_azure_mysql-0.2.0.dist-info/METADATA +221 -0
- mem0ai_azure_mysql-0.2.0.dist-info/RECORD +52 -0
- mem0/configs/llms/anthropic.py +0 -56
- mem0/configs/llms/aws_bedrock.py +0 -191
- mem0/configs/llms/deepseek.py +0 -56
- mem0/configs/llms/lmstudio.py +0 -59
- mem0/configs/llms/ollama.py +0 -56
- mem0/configs/llms/openai.py +0 -76
- mem0/configs/llms/vllm.py +0 -56
- mem0/configs/vector_stores/baidu.py +0 -29
- mem0/configs/vector_stores/chroma.py +0 -40
- mem0/configs/vector_stores/databricks.py +0 -63
- mem0/configs/vector_stores/elasticsearch.py +0 -65
- mem0/configs/vector_stores/faiss.py +0 -39
- mem0/configs/vector_stores/langchain.py +0 -32
- mem0/configs/vector_stores/milvus.py +0 -44
- mem0/configs/vector_stores/mongodb.py +0 -25
- mem0/configs/vector_stores/opensearch.py +0 -41
- mem0/configs/vector_stores/pgvector.py +0 -50
- mem0/configs/vector_stores/pinecone.py +0 -57
- mem0/configs/vector_stores/qdrant.py +0 -49
- mem0/configs/vector_stores/redis.py +0 -26
- mem0/configs/vector_stores/supabase.py +0 -44
- mem0/configs/vector_stores/upstash_vector.py +0 -36
- mem0/configs/vector_stores/vertex_ai_vector_search.py +0 -27
- mem0/configs/vector_stores/weaviate.py +0 -43
- mem0/embeddings/aws_bedrock.py +0 -100
- mem0/embeddings/gemini.py +0 -39
- mem0/embeddings/huggingface.py +0 -41
- mem0/embeddings/langchain.py +0 -35
- mem0/embeddings/lmstudio.py +0 -29
- mem0/embeddings/mock.py +0 -11
- mem0/embeddings/ollama.py +0 -53
- mem0/embeddings/openai.py +0 -49
- mem0/embeddings/together.py +0 -31
- mem0/embeddings/vertexai.py +0 -54
- mem0/graphs/neptune/__init__.py +0 -0
- mem0/graphs/neptune/base.py +0 -410
- mem0/graphs/neptune/main.py +0 -373
- mem0/llms/anthropic.py +0 -87
- mem0/llms/aws_bedrock.py +0 -600
- mem0/llms/azure_openai_structured.py +0 -91
- mem0/llms/deepseek.py +0 -107
- mem0/llms/gemini.py +0 -201
- mem0/llms/groq.py +0 -88
- mem0/llms/langchain.py +0 -65
- mem0/llms/litellm.py +0 -87
- mem0/llms/lmstudio.py +0 -114
- mem0/llms/ollama.py +0 -106
- mem0/llms/openai.py +0 -141
- mem0/llms/openai_structured.py +0 -52
- mem0/llms/sarvam.py +0 -89
- mem0/llms/together.py +0 -88
- mem0/llms/vllm.py +0 -107
- mem0/llms/xai.py +0 -52
- mem0/memory/kuzu_memory.py +0 -710
- mem0/memory/memgraph_memory.py +0 -638
- mem0/proxy/__init__.py +0 -0
- mem0/proxy/main.py +0 -189
- mem0/vector_stores/baidu.py +0 -368
- mem0/vector_stores/chroma.py +0 -254
- mem0/vector_stores/databricks.py +0 -759
- mem0/vector_stores/elasticsearch.py +0 -237
- mem0/vector_stores/faiss.py +0 -473
- mem0/vector_stores/langchain.py +0 -180
- mem0/vector_stores/milvus.py +0 -247
- mem0/vector_stores/mongodb.py +0 -312
- mem0/vector_stores/opensearch.py +0 -281
- mem0/vector_stores/pgvector.py +0 -368
- mem0/vector_stores/pinecone.py +0 -382
- mem0/vector_stores/qdrant.py +0 -270
- mem0/vector_stores/redis.py +0 -295
- mem0/vector_stores/supabase.py +0 -237
- mem0/vector_stores/upstash_vector.py +0 -293
- mem0/vector_stores/vertex_ai_vector_search.py +0 -629
- mem0/vector_stores/weaviate.py +0 -316
- mem0ai_azure_mysql-0.1.116.12.data/data/README.md +0 -24
- mem0ai_azure_mysql-0.1.116.12.dist-info/METADATA +0 -89
- mem0ai_azure_mysql-0.1.116.12.dist-info/RECORD +0 -126
- {mem0ai_azure_mysql-0.1.116.12.dist-info → mem0ai_azure_mysql-0.2.0.dist-info}/WHEEL +0 -0
mem0/__init__.py
CHANGED
mem0/configs/llms/base.py
CHANGED
|
@@ -29,7 +29,7 @@ class BaseLlmConfig(ABC):
|
|
|
29
29
|
Initialize a base configuration class instance for the LLM.
|
|
30
30
|
|
|
31
31
|
Args:
|
|
32
|
-
model: The model identifier to use (e.g., "gpt-
|
|
32
|
+
model: The model identifier to use (e.g., "gpt-5.1", "claude-3-5-sonnet-20240620")
|
|
33
33
|
Defaults to None (will be set by provider-specific configs)
|
|
34
34
|
temperature: Controls the randomness of the model's output.
|
|
35
35
|
Higher values (closer to 1) make output more random, lower values make it more deterministic.
|
mem0/embeddings/configs.py
CHANGED
|
@@ -5,26 +5,15 @@ from pydantic import BaseModel, Field, field_validator
|
|
|
5
5
|
|
|
6
6
|
class EmbedderConfig(BaseModel):
|
|
7
7
|
provider: str = Field(
|
|
8
|
-
description="Provider of the embedding model (e.g., '
|
|
9
|
-
default="
|
|
8
|
+
description="Provider of the embedding model (e.g., 'azure_openai')",
|
|
9
|
+
default="azure_openai",
|
|
10
10
|
)
|
|
11
11
|
config: Optional[dict] = Field(description="Configuration for the specific embedding model", default={})
|
|
12
12
|
|
|
13
13
|
@field_validator("config")
|
|
14
14
|
def validate_config(cls, v, values):
|
|
15
15
|
provider = values.data.get("provider")
|
|
16
|
-
if provider in [
|
|
17
|
-
"openai",
|
|
18
|
-
"ollama",
|
|
19
|
-
"huggingface",
|
|
20
|
-
"azure_openai",
|
|
21
|
-
"gemini",
|
|
22
|
-
"vertexai",
|
|
23
|
-
"together",
|
|
24
|
-
"lmstudio",
|
|
25
|
-
"langchain",
|
|
26
|
-
"aws_bedrock",
|
|
27
|
-
]:
|
|
16
|
+
if provider in ["azure_openai"]:
|
|
28
17
|
return v
|
|
29
18
|
else:
|
|
30
19
|
raise ValueError(f"Unsupported embedding provider: {provider}")
|
mem0/graphs/configs.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Optional
|
|
1
|
+
from typing import Optional
|
|
2
2
|
|
|
3
3
|
from pydantic import BaseModel, Field, field_validator, model_validator
|
|
4
4
|
|
|
@@ -8,7 +8,7 @@ from mem0.llms.configs import LlmConfig
|
|
|
8
8
|
class RerankConfig(BaseModel):
|
|
9
9
|
provider: str = Field(
|
|
10
10
|
description="Provider of the rerank model (e.g., 'openai', 'azure', 'cohere')",
|
|
11
|
-
default="cohere",
|
|
11
|
+
default="cohere",
|
|
12
12
|
)
|
|
13
13
|
config: Optional[dict] = Field(
|
|
14
14
|
description="Configuration for the specific rerank model", default={}
|
|
@@ -33,7 +33,7 @@ class Neo4jConfig(BaseModel):
|
|
|
33
33
|
)
|
|
34
34
|
if not url or not username or not password:
|
|
35
35
|
raise ValueError("Please provide 'url', 'username' and 'password'.")
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
if values.get("rerank") is not None:
|
|
38
38
|
values["rerank"] = RerankConfig(**values.get("rerank"))
|
|
39
39
|
if values["rerank"].provider not in ("cohere"):
|
|
@@ -42,62 +42,12 @@ class Neo4jConfig(BaseModel):
|
|
|
42
42
|
return values
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
class MemgraphConfig(BaseModel):
|
|
46
|
-
url: Optional[str] = Field(None, description="Host address for the graph database")
|
|
47
|
-
username: Optional[str] = Field(None, description="Username for the graph database")
|
|
48
|
-
password: Optional[str] = Field(None, description="Password for the graph database")
|
|
49
|
-
|
|
50
|
-
@model_validator(mode="before")
|
|
51
|
-
def check_host_port_or_path(cls, values):
|
|
52
|
-
url, username, password = (
|
|
53
|
-
values.get("url"),
|
|
54
|
-
values.get("username"),
|
|
55
|
-
values.get("password"),
|
|
56
|
-
)
|
|
57
|
-
if not url or not username or not password:
|
|
58
|
-
raise ValueError("Please provide 'url', 'username' and 'password'.")
|
|
59
|
-
return values
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
class NeptuneConfig(BaseModel):
|
|
63
|
-
endpoint: Optional[str] = (
|
|
64
|
-
Field(
|
|
65
|
-
None,
|
|
66
|
-
description="Endpoint to connect to a Neptune Analytics Server as neptune-graph://<graphid>",
|
|
67
|
-
),
|
|
68
|
-
)
|
|
69
|
-
base_label: Optional[bool] = Field(None, description="Whether to use base node label __Entity__ for all entities")
|
|
70
|
-
|
|
71
|
-
@model_validator(mode="before")
|
|
72
|
-
def check_host_port_or_path(cls, values):
|
|
73
|
-
endpoint = values.get("endpoint")
|
|
74
|
-
if not endpoint:
|
|
75
|
-
raise ValueError("Please provide 'endpoint' with the format as 'neptune-graph://<graphid>'.")
|
|
76
|
-
if endpoint.startswith("neptune-db://"):
|
|
77
|
-
raise ValueError("neptune-db server is not yet supported")
|
|
78
|
-
elif endpoint.startswith("neptune-graph://"):
|
|
79
|
-
# This is a Neptune Analytics Graph
|
|
80
|
-
graph_identifier = endpoint.replace("neptune-graph://", "")
|
|
81
|
-
if not graph_identifier.startswith("g-"):
|
|
82
|
-
raise ValueError("Provide a valid 'graph_identifier'.")
|
|
83
|
-
values["graph_identifier"] = graph_identifier
|
|
84
|
-
return values
|
|
85
|
-
else:
|
|
86
|
-
raise ValueError(
|
|
87
|
-
"You must provide an endpoint to create a NeptuneServer as either neptune-db://<endpoint> or neptune-graph://<graphid>"
|
|
88
|
-
)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
class KuzuConfig(BaseModel):
|
|
92
|
-
db: Optional[str] = Field(":memory:", description="Path to a Kuzu database file")
|
|
93
|
-
|
|
94
|
-
|
|
95
45
|
class GraphStoreConfig(BaseModel):
|
|
96
46
|
provider: str = Field(
|
|
97
|
-
description="Provider of the data store (e.g., 'neo4j'
|
|
47
|
+
description="Provider of the data store (e.g., 'neo4j')",
|
|
98
48
|
default="neo4j",
|
|
99
49
|
)
|
|
100
|
-
config:
|
|
50
|
+
config: Optional[Neo4jConfig] = Field(
|
|
101
51
|
description="Configuration for the specific data store", default=None
|
|
102
52
|
)
|
|
103
53
|
llm: Optional[LlmConfig] = Field(description="LLM configuration for querying the graph store", default=None)
|
|
@@ -108,13 +58,7 @@ class GraphStoreConfig(BaseModel):
|
|
|
108
58
|
@field_validator("config")
|
|
109
59
|
def validate_config(cls, v, values):
|
|
110
60
|
provider = values.data.get("provider")
|
|
111
|
-
if provider
|
|
61
|
+
if provider in ("neo4j", "default"):
|
|
112
62
|
return Neo4jConfig(**v.model_dump())
|
|
113
|
-
elif provider == "memgraph":
|
|
114
|
-
return MemgraphConfig(**v.model_dump())
|
|
115
|
-
elif provider == "neptune":
|
|
116
|
-
return NeptuneConfig(**v.model_dump())
|
|
117
|
-
elif provider == "kuzu":
|
|
118
|
-
return KuzuConfig(**v.model_dump())
|
|
119
63
|
else:
|
|
120
64
|
raise ValueError(f"Unsupported graph store provider: {provider}")
|
mem0/llms/azure_openai.py
CHANGED
|
@@ -36,7 +36,7 @@ class AzureOpenAILLM(LLMBase):
|
|
|
36
36
|
|
|
37
37
|
# Model name should match the custom deployment name chosen for it.
|
|
38
38
|
if not self.config.model:
|
|
39
|
-
self.config.model = "gpt-
|
|
39
|
+
self.config.model = "gpt-5.1"
|
|
40
40
|
|
|
41
41
|
api_key = self.config.azure_kwargs.api_key or os.getenv("LLM_AZURE_API_KEY")
|
|
42
42
|
azure_ad_token = self.config.azure_kwargs.azure_ad_token or os.getenv("LLM_AZURE_AD_TOKEN")
|
mem0/llms/configs.py
CHANGED
|
@@ -4,31 +4,13 @@ from pydantic import BaseModel, Field, field_validator
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class LlmConfig(BaseModel):
|
|
7
|
-
provider: str = Field(description="Provider of the LLM (e.g., '
|
|
7
|
+
provider: str = Field(description="Provider of the LLM (e.g., 'azure_openai')", default="azure_openai")
|
|
8
8
|
config: Optional[dict] = Field(description="Configuration for the specific LLM", default={})
|
|
9
9
|
|
|
10
10
|
@field_validator("config")
|
|
11
11
|
def validate_config(cls, v, values):
|
|
12
12
|
provider = values.data.get("provider")
|
|
13
|
-
if provider in (
|
|
14
|
-
"openai",
|
|
15
|
-
"ollama",
|
|
16
|
-
"anthropic",
|
|
17
|
-
"groq",
|
|
18
|
-
"together",
|
|
19
|
-
"aws_bedrock",
|
|
20
|
-
"litellm",
|
|
21
|
-
"azure_openai",
|
|
22
|
-
"openai_structured",
|
|
23
|
-
"azure_openai_structured",
|
|
24
|
-
"gemini",
|
|
25
|
-
"deepseek",
|
|
26
|
-
"xai",
|
|
27
|
-
"sarvam",
|
|
28
|
-
"lmstudio",
|
|
29
|
-
"vllm",
|
|
30
|
-
"langchain",
|
|
31
|
-
):
|
|
13
|
+
if provider in ("azure_openai",):
|
|
32
14
|
return v
|
|
33
15
|
else:
|
|
34
16
|
raise ValueError(f"Unsupported LLM provider: {provider}")
|