alpha-avatar-plugins-memory 0.6.4__tar.gz → 0.6.5__tar.gz

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.
Files changed (24) hide show
  1. alpha_avatar_plugins_memory-0.6.5/PKG-INFO +155 -0
  2. alpha_avatar_plugins_memory-0.6.5/README.md +133 -0
  3. {alpha_avatar_plugins_memory-0.6.4 → alpha_avatar_plugins_memory-0.6.5}/alphaavatar/plugins/memory/__init__.py +22 -18
  4. alpha_avatar_plugins_memory-0.6.5/alphaavatar/plugins/memory/env_memory/__init__.py +19 -0
  5. alpha_avatar_plugins_memory-0.6.5/alphaavatar/plugins/memory/env_memory/scheduler.py +591 -0
  6. {alpha_avatar_plugins_memory-0.6.4 → alpha_avatar_plugins_memory-0.6.5}/alphaavatar/plugins/memory/memory_prompts.py +184 -118
  7. {alpha_avatar_plugins_memory-0.6.4 → alpha_avatar_plugins_memory-0.6.5}/alphaavatar/plugins/memory/memory_runtime.py +135 -322
  8. {alpha_avatar_plugins_memory-0.6.4 → alpha_avatar_plugins_memory-0.6.5}/alphaavatar/plugins/memory/runner/lancedb_runner.py +3 -4
  9. {alpha_avatar_plugins_memory-0.6.4 → alpha_avatar_plugins_memory-0.6.5}/alphaavatar/plugins/memory/runner/qdrant_runner.py +3 -3
  10. {alpha_avatar_plugins_memory-0.6.4 → alpha_avatar_plugins_memory-0.6.5}/alphaavatar/plugins/memory/version.py +1 -1
  11. alpha_avatar_plugins_memory-0.6.4/PKG-INFO +0 -242
  12. alpha_avatar_plugins_memory-0.6.4/README.md +0 -220
  13. {alpha_avatar_plugins_memory-0.6.4 → alpha_avatar_plugins_memory-0.6.5}/.gitignore +0 -0
  14. {alpha_avatar_plugins_memory-0.6.4 → alpha_avatar_plugins_memory-0.6.5}/alphaavatar/plugins/memory/graph/__init__.py +0 -0
  15. {alpha_avatar_plugins_memory-0.6.4 → alpha_avatar_plugins_memory-0.6.5}/alphaavatar/plugins/memory/graph/graph_alias.py +0 -0
  16. {alpha_avatar_plugins_memory-0.6.4 → alpha_avatar_plugins_memory-0.6.5}/alphaavatar/plugins/memory/graph/graph_builder.py +0 -0
  17. {alpha_avatar_plugins_memory-0.6.4 → alpha_avatar_plugins_memory-0.6.5}/alphaavatar/plugins/memory/graph/graph_lookup.py +0 -0
  18. {alpha_avatar_plugins_memory-0.6.4 → alpha_avatar_plugins_memory-0.6.5}/alphaavatar/plugins/memory/graph/graph_store.py +0 -0
  19. {alpha_avatar_plugins_memory-0.6.4 → alpha_avatar_plugins_memory-0.6.5}/alphaavatar/plugins/memory/log.py +0 -0
  20. {alpha_avatar_plugins_memory-0.6.4 → alpha_avatar_plugins_memory-0.6.5}/alphaavatar/plugins/memory/memory_delta_extractor.py +0 -0
  21. {alpha_avatar_plugins_memory-0.6.4 → alpha_avatar_plugins_memory-0.6.5}/alphaavatar/plugins/memory/memory_markdown.py +0 -0
  22. {alpha_avatar_plugins_memory-0.6.4 → alpha_avatar_plugins_memory-0.6.5}/alphaavatar/plugins/memory/memory_op.py +0 -0
  23. {alpha_avatar_plugins_memory-0.6.4 → alpha_avatar_plugins_memory-0.6.5}/alphaavatar/plugins/memory/runner/__init__.py +0 -0
  24. {alpha_avatar_plugins_memory-0.6.4 → alpha_avatar_plugins_memory-0.6.5}/pyproject.toml +0 -0
@@ -0,0 +1,155 @@
1
+ Metadata-Version: 2.4
2
+ Name: alpha-avatar-plugins-memory
3
+ Version: 0.6.5
4
+ Summary: AlphaAvatar Framework plugin for memory service
5
+ Project-URL: Source, https://github.com/AlphaAvatar/AlphaAvatar
6
+ License-Expression: Apache-2.0
7
+ Keywords: AI,agents,langchain,llm,memory
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: License :: OSI Approved :: Apache Software License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3 :: Only
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Topic :: Multimedia :: Sound/Audio
17
+ Classifier: Topic :: Multimedia :: Video
18
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
19
+ Requires-Python: <3.12,>=3.11
20
+ Requires-Dist: torchaudio>=0.10.1
21
+ Description-Content-Type: text/markdown
22
+
23
+ # 🧠 AlphaAvatar Memory Plugin
24
+
25
+ The Memory Plugin provides persistent conversation, tool, and environment memory for AlphaAvatar.
26
+
27
+ ## 🧩 Module Overview
28
+
29
+ The plugin is responsible for:
30
+
31
+ * extracting durable memories from conversations and tool results;
32
+ * building ENV memory from live perception observations;
33
+ * attaching identity, session, evidence, and graph metadata;
34
+ * storing memory records in local or remote vector databases;
35
+ * retrieving relevant memories for future interactions.
36
+
37
+ Memory extraction is divided into independent paths:
38
+
39
+ ```text
40
+ Conversation
41
+ └── → Conversation Memory
42
+
43
+ Tool / RAG / DeepResearch Result
44
+ └── → Tool Memory
45
+
46
+ Visual or Audio Observation
47
+ └── → ENV Memory
48
+ ```
49
+
50
+ Supported memory types include:
51
+
52
+ | Memory Type | Description |
53
+ | -------------- | ------------------------------------------------------------------- |
54
+ | `Avatar` | Stable information about the avatar itself |
55
+ | `Conversation` | User information, preferences, decisions, and interaction history |
56
+ | `Tools` | Useful results produced by tools, RAG, MCP, or research |
57
+ | `ENV` | Information extracted from visual or audio environment observations |
58
+
59
+ ## 🌍 ENV Memory
60
+
61
+ ENV Memory consumes observation windows from `PerceptionRuntime`.
62
+
63
+ ```text
64
+ Video / Screen / Audio Observation
65
+
66
+ PerceptionRuntime
67
+
68
+ EnvMemoryScheduler
69
+
70
+ Multimodal ENV Extraction
71
+
72
+ MemoryType.ENV
73
+ ```
74
+
75
+ `EnvMemoryScheduler` manages:
76
+
77
+ * periodic ENV memory updates;
78
+ * updates triggered by user turns;
79
+ * resetting the periodic interval after a successful triggered capture;
80
+ * fast perception cursor commits;
81
+ * serialized model inference;
82
+ * pending batch merging and retry handling.
83
+
84
+ ENV memory is only updated when visual or audio observations are available.
85
+
86
+ User text does not independently create ENV memory. It is attached only as additional context when real environment observations are present.
87
+
88
+ ```text
89
+ Visual / Audio Observation + User Text
90
+
91
+ ENV Memory Update
92
+
93
+ User Text Only
94
+
95
+ No ENV Memory Update
96
+ ```
97
+
98
+ Visual observations are sampled before extraction to avoid repeatedly processing similar frames. Raw audio frames are ignored; future audio support should use audio segments or semantic audio events.
99
+
100
+ Heavy runtime payloads such as video frames and audio buffers are not stored directly as memory records. ENV memory stores extracted text, evidence references, and metadata.
101
+
102
+ ## 🕸️ Storage and Retrieval
103
+
104
+ Memory records may contain:
105
+
106
+ * memory text;
107
+ * memory type;
108
+ * object ownership;
109
+ * session and timestamp metadata;
110
+ * observation evidence;
111
+ * graph nodes and links;
112
+ * provider-specific metadata.
113
+
114
+ Supported storage backends include:
115
+
116
+ | Backend | Usage |
117
+ | --------- | ------------------------------------ |
118
+ | `LanceDB` | Local vector storage and retrieval |
119
+ | `Qdrant` | Remote or self-hosted vector storage |
120
+
121
+ Memory retrieval supports:
122
+
123
+ * semantic context search;
124
+ * filtering by memory type, session, or object ID;
125
+ * graph-node lookup;
126
+ * graph-neighbor expansion;
127
+ * identity alias resolution.
128
+
129
+ Graph metadata improves retrieval across related users, speakers, faces, objects, tools, sessions, and events, while memory text remains the primary stored information.
130
+
131
+ ## 🔗 Module Relationships
132
+
133
+ ```text
134
+ PerceptionRuntime
135
+ └── → ENV Memory observations
136
+
137
+ Persona Plugin
138
+ └── → user, face, and speaker identity aliases
139
+
140
+ RAG / DeepResearch / MCP
141
+ └── → Tool Memory
142
+
143
+ Memory Plugin
144
+ ├── → Dynamic runtime context
145
+ ├── → Semantic retrieval
146
+ └── → Graph-aware retrieval
147
+ ```
148
+
149
+ ## 📦 Installation
150
+
151
+ ```bash
152
+ pip install alpha-avatar-plugins-memory
153
+ ```
154
+
155
+ The plugin is loaded through the AlphaAvatar configuration.
@@ -0,0 +1,133 @@
1
+ # 🧠 AlphaAvatar Memory Plugin
2
+
3
+ The Memory Plugin provides persistent conversation, tool, and environment memory for AlphaAvatar.
4
+
5
+ ## 🧩 Module Overview
6
+
7
+ The plugin is responsible for:
8
+
9
+ * extracting durable memories from conversations and tool results;
10
+ * building ENV memory from live perception observations;
11
+ * attaching identity, session, evidence, and graph metadata;
12
+ * storing memory records in local or remote vector databases;
13
+ * retrieving relevant memories for future interactions.
14
+
15
+ Memory extraction is divided into independent paths:
16
+
17
+ ```text
18
+ Conversation
19
+ └── → Conversation Memory
20
+
21
+ Tool / RAG / DeepResearch Result
22
+ └── → Tool Memory
23
+
24
+ Visual or Audio Observation
25
+ └── → ENV Memory
26
+ ```
27
+
28
+ Supported memory types include:
29
+
30
+ | Memory Type | Description |
31
+ | -------------- | ------------------------------------------------------------------- |
32
+ | `Avatar` | Stable information about the avatar itself |
33
+ | `Conversation` | User information, preferences, decisions, and interaction history |
34
+ | `Tools` | Useful results produced by tools, RAG, MCP, or research |
35
+ | `ENV` | Information extracted from visual or audio environment observations |
36
+
37
+ ## 🌍 ENV Memory
38
+
39
+ ENV Memory consumes observation windows from `PerceptionRuntime`.
40
+
41
+ ```text
42
+ Video / Screen / Audio Observation
43
+
44
+ PerceptionRuntime
45
+
46
+ EnvMemoryScheduler
47
+
48
+ Multimodal ENV Extraction
49
+
50
+ MemoryType.ENV
51
+ ```
52
+
53
+ `EnvMemoryScheduler` manages:
54
+
55
+ * periodic ENV memory updates;
56
+ * updates triggered by user turns;
57
+ * resetting the periodic interval after a successful triggered capture;
58
+ * fast perception cursor commits;
59
+ * serialized model inference;
60
+ * pending batch merging and retry handling.
61
+
62
+ ENV memory is only updated when visual or audio observations are available.
63
+
64
+ User text does not independently create ENV memory. It is attached only as additional context when real environment observations are present.
65
+
66
+ ```text
67
+ Visual / Audio Observation + User Text
68
+
69
+ ENV Memory Update
70
+
71
+ User Text Only
72
+
73
+ No ENV Memory Update
74
+ ```
75
+
76
+ Visual observations are sampled before extraction to avoid repeatedly processing similar frames. Raw audio frames are ignored; future audio support should use audio segments or semantic audio events.
77
+
78
+ Heavy runtime payloads such as video frames and audio buffers are not stored directly as memory records. ENV memory stores extracted text, evidence references, and metadata.
79
+
80
+ ## 🕸️ Storage and Retrieval
81
+
82
+ Memory records may contain:
83
+
84
+ * memory text;
85
+ * memory type;
86
+ * object ownership;
87
+ * session and timestamp metadata;
88
+ * observation evidence;
89
+ * graph nodes and links;
90
+ * provider-specific metadata.
91
+
92
+ Supported storage backends include:
93
+
94
+ | Backend | Usage |
95
+ | --------- | ------------------------------------ |
96
+ | `LanceDB` | Local vector storage and retrieval |
97
+ | `Qdrant` | Remote or self-hosted vector storage |
98
+
99
+ Memory retrieval supports:
100
+
101
+ * semantic context search;
102
+ * filtering by memory type, session, or object ID;
103
+ * graph-node lookup;
104
+ * graph-neighbor expansion;
105
+ * identity alias resolution.
106
+
107
+ Graph metadata improves retrieval across related users, speakers, faces, objects, tools, sessions, and events, while memory text remains the primary stored information.
108
+
109
+ ## 🔗 Module Relationships
110
+
111
+ ```text
112
+ PerceptionRuntime
113
+ └── → ENV Memory observations
114
+
115
+ Persona Plugin
116
+ └── → user, face, and speaker identity aliases
117
+
118
+ RAG / DeepResearch / MCP
119
+ └── → Tool Memory
120
+
121
+ Memory Plugin
122
+ ├── → Dynamic runtime context
123
+ ├── → Semantic retrieval
124
+ └── → Graph-aware retrieval
125
+ ```
126
+
127
+ ## 📦 Installation
128
+
129
+ ```bash
130
+ pip install alpha-avatar-plugins-memory
131
+ ```
132
+
133
+ The plugin is loaded through the AlphaAvatar configuration.
@@ -15,6 +15,7 @@ import os
15
15
 
16
16
  from alphaavatar.agents import AvatarModule, AvatarPlugin
17
17
  from alphaavatar.agents.runtime import AvatarRuntime
18
+ from alphaavatar.agents.runtime.inference import InferenceRunner
18
19
 
19
20
  from .log import logger
20
21
  from .memory_runtime import MemoryRuntime
@@ -55,29 +56,32 @@ class MemoryPlugin(AvatarPlugin):
55
56
  raise ImportError(f"Failed to initialize MemoryRuntime plugin: {e}") from e
56
57
 
57
58
 
58
- def bootstrap_inference_runners() -> None:
59
- """
60
- Plugin-owned runner bootstrap.
59
+ def configure_vdb_runner(vdb_type: str | None = None) -> None:
60
+ vdb_type = vdb_type or os.getenv("MEMORY_VDB_TYPE")
61
61
 
62
- Called by AlphaAvatar core after AvatarConfig is parsed.
63
- """
64
- memory_vdb_type = os.getenv("MEMORY_VDB_TYPE", "lancedb")
62
+ logger.info("Configuring Persona plugin with VDB type: %s", vdb_type)
65
63
 
66
- if memory_vdb_type == "qdrant":
64
+ if vdb_type == "qdrant":
67
65
  from .runner import QdrantRunner
68
66
 
69
- os.environ["MEMORY_INFERENCE_METHOD"] = QdrantRunner.INFERENCE_METHOD
70
- AvatarPlugin.register_inference_runner_once(QdrantRunner)
71
- return
67
+ method = QdrantRunner.INFERENCE_METHOD
68
+ InferenceRunner.register(QdrantRunner)
72
69
 
73
- if memory_vdb_type == "lancedb":
70
+ elif vdb_type == "lancedb":
74
71
  from .runner import LanceDBRunner
75
72
 
76
- os.environ["MEMORY_INFERENCE_METHOD"] = LanceDBRunner.INFERENCE_METHOD
77
- AvatarPlugin.register_inference_runner_once(LanceDBRunner)
78
- return
73
+ method = LanceDBRunner.INFERENCE_METHOD
74
+ InferenceRunner.register(LanceDBRunner)
79
75
 
80
- logger.warning("Unsupported MEMORY_VDB_TYPE=%r", memory_vdb_type)
76
+ else:
77
+ logger.warning(
78
+ "Unsupported MEMORY_VDB_TYPE=%r. Expected 'qdrant' or 'lancedb'.",
79
+ vdb_type,
80
+ )
81
+ return None
82
+
83
+ os.environ["MEMORY_VDB_INFERENCE_METHOD"] = method
84
+ return None
81
85
 
82
86
 
83
87
  # Plugin register
@@ -87,8 +91,8 @@ AvatarPlugin.register_avatar_plugin(
87
91
  MemoryPlugin(),
88
92
  )
89
93
 
90
- # Runner bootstrap register
94
+ # Inference Runners
91
95
  AvatarPlugin.register_inference_runner_bootstrap(
92
- "alphaavatar.plugins.memory",
93
- bootstrap_inference_runners,
96
+ "alphaavatar.plugins.memory.vdb",
97
+ configure_vdb_runner,
94
98
  )
@@ -0,0 +1,19 @@
1
+ # Copyright 2026 AlphaAvatar project
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ from .scheduler import EnvMemoryBatch, EnvMemoryScheduler
15
+
16
+ __all__ = [
17
+ "EnvMemoryBatch",
18
+ "EnvMemoryScheduler",
19
+ ]