mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-04-30 20:50:21 +00:00
Detach memory and update config
Removed the memory_subdir attribute from AgentConfig and related settings, transitioning to a project-based memory isolation approach. Updated the memory plugin configuration to default to an empty string for agent_memory_subdir. Enhanced the get_context_memory_subdir function to support project-specific memory directories. Removed the project-edit-memory component and adjusted the UI to reflect these changes. Added a new memory configuration file for better management of memory settings.
This commit is contained in:
parent
a1589c27f5
commit
505128c384
14 changed files with 53 additions and 157 deletions
|
|
@ -34,9 +34,6 @@ class BasicProjectData(TypedDict):
|
|||
instructions: str
|
||||
color: str
|
||||
git_url: str
|
||||
memory: Literal[
|
||||
"own", "global"
|
||||
] # in the future we can add cutom and point to another existing folder
|
||||
file_structure: FileStructureInjectionSettings
|
||||
|
||||
class GitStatusData(TypedDict, total=False):
|
||||
|
|
@ -158,7 +155,6 @@ def _normalizeBasicData(data: BasicProjectData) -> BasicProjectData:
|
|||
"instructions": data.get("instructions", ""),
|
||||
"color": data.get("color", ""),
|
||||
"git_url": data.get("git_url", ""),
|
||||
"memory": data.get("memory", "own"),
|
||||
"file_structure": data.get(
|
||||
"file_structure",
|
||||
_default_file_structure_settings(),
|
||||
|
|
@ -179,7 +175,6 @@ def _normalizeEditData(data: EditProjectData) -> EditProjectData:
|
|||
"instruction_files_count": data.get("instruction_files_count", 0),
|
||||
"knowledge_files_count": data.get("knowledge_files_count", 0),
|
||||
"secrets": data.get("secrets", ""),
|
||||
"memory": data.get("memory", "own"),
|
||||
"file_structure": data.get(
|
||||
"file_structure",
|
||||
_default_file_structure_settings(),
|
||||
|
|
@ -463,16 +458,6 @@ def save_project_secrets(name: str, secrets: str):
|
|||
secrets_manager.save_secrets_with_merge(secrets)
|
||||
|
||||
|
||||
def get_context_memory_subdir(context: "AgentContext") -> str | None:
|
||||
# if a project is active and has memory isolation set, return the project memory subdir
|
||||
project_name = get_context_project_name(context)
|
||||
if project_name:
|
||||
project_data = load_basic_project_data(project_name)
|
||||
if project_data["memory"] == "own":
|
||||
return "projects/" + project_name
|
||||
return None # no memory override
|
||||
|
||||
|
||||
def create_project_meta_folders(name: str):
|
||||
# create instructions folder
|
||||
files.create_dir(get_project_meta(name, PROJECT_INSTRUCTIONS_DIR))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue