The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.
Python agentic-memoryagentic-memory-systemagentsaiai-agentschatgptgenaillmlong-term-memorymemorymemory-managementpythonragstate-management
[Bug fix] Fix issue of missing user directory (#975)
Deshraj Yadav1df46b2bb3e0
diff --git a/embedchain/__init__.py b/embedchain/__init__.pyindex 14d913f2b..5575a541a 100644--- a/embedchain/__init__.py+++ b/embedchain/__init__.py@@ -6,3 +6,6 @@ from embedchain.apps.app import App # noqa: F401from embedchain.client import Client # noqa: F401from embedchain.pipeline import Pipeline # noqa: F401from embedchain.vectordb.chroma import ChromaDB # noqa: F401++# Setup the user directory if doesn't exist already+Client.setup_dir()diff --git a/embedchain/apps/app.py b/embedchain/apps/app.pyindex 56d1353ea..b61acbe75 100644--- a/embedchain/apps/app.py+++ b/embedchain/apps/app.py@@ -2,9 +2,7 @@ from typing import Optionalimport yaml-from embedchain.client import Client-from embedchain.config import (AppConfig, BaseEmbedderConfig, BaseLlmConfig,- ChunkerConfig)+from embedchain.config import AppConfig, BaseEmbedderConfig, BaseLlmConfig, ChunkerConfigfrom embedchain.config.vectordb.base import BaseVectorDbConfigfrom embedchain.embedchain import EmbedChainfrom embedchain.embedder.base import BaseEmbedder@@ -68,9 +66,6 @@ class App(EmbedChain)::type system_prompt: Optional[str], optional:raises TypeError: LLM, database or embedder or their config is not a valid class instance."""- # Setup user directory if it doesn't exist already- Client.setup_dir()-# Type check configsif config and not isinstance(config, AppConfig):raise TypeError(@@ -134,9 +129,6 @@ class App(EmbedChain)::return: An instance of the App class.:rtype: App"""- # Setup user directory if it doesn't exist already- Client.setup_dir()-with open(yaml_path, "r") as file:config_data = yaml.safe_load(file)diff --git a/embedchain/embedchain.py b/embedchain/embedchain.pyindex dfd1627e2..863bf1e7a 100644--- a/embedchain/embedchain.py+++ b/embedchain/embedchain.py@@ -16,8 +16,7 @@ from embedchain.embedder.base import BaseEmbedderfrom embedchain.helpers.json_serializable import JSONSerializablefrom embedchain.llm.base import BaseLlmfrom embedchain.loaders.base_loader import BaseLoader-from embedchain.models.data_type import (DataType, DirectDataType,- IndirectDataType, SpecialDataType)+from embedchain.models.data_type import DataType, DirectDataType, IndirectDataType, SpecialDataTypefrom embedchain.telemetry.posthog import AnonymousTelemetryfrom embedchain.utils import detect_datatype, is_valid_json_stringfrom embedchain.vectordb.base import BaseVectorDBdiff --git a/embedchain/pipeline.py b/embedchain/pipeline.pyindex 00a8a92df..e370faa48 100644--- a/embedchain/pipeline.py+++ b/embedchain/pipeline.py@@ -24,6 +24,10 @@ from embedchain.vectordb.base import BaseVectorDBfrom embedchain.vectordb.chroma import ChromaDB+# Setup the user directory if doesn't exist already+Client.setup_dir()++@register_deserializableclass Pipeline(EmbedChain):"""@@ -64,9 +68,6 @@ class Pipeline(EmbedChain)::type auto_deploy: bool, optional:raises Exception: If an error occurs while creating the pipeline"""- # Setup user directory if it doesn't exist already- Client.setup_dir()-if id and yaml_path:raise Exception("Cannot provide both id and config. Please provide only one of them.")@@ -357,9 +358,6 @@ class Pipeline(EmbedChain)::return: An instance of the Pipeline class.:rtype: Pipeline"""- # Setup user directory if it doesn't exist already- Client.setup_dir()-with open(yaml_path, "r") as file:config_data = yaml.safe_load(file)diff --git a/embedchain/store/assistants.py b/embedchain/store/assistants.pyindex e3bde8de6..9803c0835 100644--- a/embedchain/store/assistants.py+++ b/embedchain/store/assistants.py@@ -10,7 +10,7 @@ from typing import castfrom openai import OpenAIfrom openai.types.beta.threads import MessageContentText, ThreadMessage-from embedchain import Pipeline+from embedchain import Client, Pipelinefrom embedchain.config import AddConfigfrom embedchain.data_formatter import DataFormatterfrom embedchain.models.data_type import DataType@@ -19,6 +19,9 @@ from embedchain.utils import detect_datatypelogging.basicConfig(level=logging.WARN)+# Setup the user directory if doesn't exist already+Client.setup_dir()+class OpenAIAssistant:def __init__(diff --git a/pyproject.toml b/pyproject.tomlindex f322179ed..9c039de36 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -1,6 +1,6 @@[tool.poetry]name = "embedchain"-version = "0.1.20"+version = "0.1.21"description = "Data platform for LLMs - Load, index, retrieve and sync any unstructured data"authors = ["Taranjeet Singh <[email protected]>",