django-agent-studio 0.1.4__py3-none-any.whl → 0.1.5__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.
@@ -39,6 +39,7 @@ You have access to tools that allow you to:
39
39
  6. **Discover and add dynamic tools** from the Django project codebase
40
40
  7. **Create multi-agent systems** by adding sub-agent tools
41
41
  8. **Switch between agents and systems** in the UI
42
+ 9. **Configure agent memory** (enable/disable the remember tool)
42
43
 
43
44
  ## IMPORTANT: Tool Usage
44
45
 
@@ -95,6 +96,26 @@ You can control the builder UI to switch between different agents and systems:
95
96
  When the user asks to work on a different agent or system, use these tools to switch context.
96
97
  The UI will automatically update to show the selected agent/system.
97
98
 
99
+ ## Agent Memory
100
+
101
+ Agents have a built-in memory system that allows them to remember facts about users across conversations:
102
+ - Memory is **enabled by default** for all agents
103
+ - When enabled, the agent has a `remember` tool it can use to store key-value facts
104
+ - Memories are scoped per-user and per-conversation
105
+ - Memory only works for **authenticated users** (not anonymous visitors)
106
+ - Use `get_memory_status` to check if memory is enabled
107
+ - Use `set_memory_enabled` to enable or disable memory
108
+
109
+ **When to disable memory:**
110
+ - Public-facing agents where you don't want user data stored
111
+ - Simple Q&A agents that don't need personalization
112
+ - Agents handling sensitive information that shouldn't be persisted
113
+
114
+ **When to keep memory enabled (default):**
115
+ - Personal assistants that should remember user preferences
116
+ - Support agents that benefit from knowing user history
117
+ - Any agent where personalization improves the experience
118
+
98
119
  When helping users:
99
120
  - Ask clarifying questions to understand what they want their agent to do
100
121
  - Suggest appropriate system prompts based on the agent's purpose
@@ -231,6 +252,34 @@ BUILDER_TOOLS = [
231
252
  },
232
253
  },
233
254
  },
255
+ {
256
+ "type": "function",
257
+ "function": {
258
+ "name": "set_memory_enabled",
259
+ "description": "Enable or disable conversation memory for the agent. When enabled (default), the agent can remember facts about users across messages using the 'remember' tool. Memory only works for authenticated users.",
260
+ "parameters": {
261
+ "type": "object",
262
+ "properties": {
263
+ "enabled": {
264
+ "type": "boolean",
265
+ "description": "Whether to enable memory. True = agent can remember facts, False = no memory.",
266
+ },
267
+ },
268
+ "required": ["enabled"],
269
+ },
270
+ },
271
+ },
272
+ {
273
+ "type": "function",
274
+ "function": {
275
+ "name": "get_memory_status",
276
+ "description": "Check if memory is enabled for the current agent.",
277
+ "parameters": {
278
+ "type": "object",
279
+ "properties": {},
280
+ },
281
+ },
282
+ },
234
283
  {
235
284
  "type": "function",
236
285
  "function": {
@@ -908,6 +957,33 @@ Knowledge: {len(config.get('knowledge', []))} sources
908
957
  return {"success": True, "message": "Model settings updated"}
909
958
  return {"error": "No active version found"}
910
959
 
960
+ elif tool_name == "set_memory_enabled":
961
+ if version:
962
+ enabled = args.get("enabled", True)
963
+ if version.extra_config is None:
964
+ version.extra_config = {}
965
+ version.extra_config["memory_enabled"] = enabled
966
+ await sync_to_async(version.save)()
967
+ status = "enabled" if enabled else "disabled"
968
+ await create_revision(agent, comment=f"Memory {status}")
969
+ return {
970
+ "success": True,
971
+ "message": f"Memory {status} for this agent",
972
+ "memory_enabled": enabled,
973
+ }
974
+ return {"error": "No active version found"}
975
+
976
+ elif tool_name == "get_memory_status":
977
+ if version:
978
+ extra = version.extra_config or {}
979
+ enabled = extra.get("memory_enabled", True) # Default is True
980
+ return {
981
+ "memory_enabled": enabled,
982
+ "message": f"Memory is {'enabled' if enabled else 'disabled'} for this agent",
983
+ "note": "When enabled, the agent has a 'remember' tool to store facts about users. Memory only works for authenticated users.",
984
+ }
985
+ return {"error": "No active version found"}
986
+
911
987
  elif tool_name == "add_knowledge":
912
988
  inclusion_mode = args.get("inclusion_mode", "always")
913
989
  knowledge = await sync_to_async(AgentKnowledge.objects.create)(
@@ -92,6 +92,10 @@ class DynamicAgentRuntime(AgentRuntime):
92
92
  """Execute the agent with the dynamic configuration and agentic loop."""
93
93
  config = self.config
94
94
 
95
+ # Check if memory is enabled (default: True)
96
+ extra_config = config.get("extra", {})
97
+ memory_enabled = extra_config.get("memory_enabled", True)
98
+
95
99
  # Build the messages list
96
100
  messages = []
97
101
 
@@ -108,12 +112,14 @@ class DynamicAgentRuntime(AgentRuntime):
108
112
  if rag_context:
109
113
  system_prompt = f"{system_prompt}\n\n{rag_context}"
110
114
 
111
- # Add conversation memories (if we have a conversation_id and user)
112
- memory_store = await self._get_memory_store(ctx)
113
- if memory_store:
114
- memory_context = await self._recall_memories(memory_store)
115
- if memory_context:
116
- system_prompt = f"{system_prompt}\n\n{memory_context}"
115
+ # Add conversation memories (if memory is enabled and we have context)
116
+ memory_store = None
117
+ if memory_enabled:
118
+ memory_store = await self._get_memory_store(ctx)
119
+ if memory_store:
120
+ memory_context = await self._recall_memories(memory_store)
121
+ if memory_context:
122
+ system_prompt = f"{system_prompt}\n\n{memory_context}"
117
123
 
118
124
  if system_prompt:
119
125
  messages.append({"role": "system", "content": system_prompt})
@@ -121,9 +127,10 @@ class DynamicAgentRuntime(AgentRuntime):
121
127
  # Add conversation history
122
128
  messages.extend(ctx.input_messages)
123
129
 
124
- # Build tool schemas - include memory tool
130
+ # Build tool schemas - include memory tool only if memory is enabled
125
131
  tools = self._build_tool_schemas(config)
126
- tools.append(MEMORY_TOOL_SCHEMA) # Add remember tool to all designed agents
132
+ if memory_enabled:
133
+ tools.append(MEMORY_TOOL_SCHEMA)
127
134
 
128
135
  tool_map = self._build_tool_map(config) # Maps tool name to execution info
129
136
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: django-agent-studio
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: Visual agent builder and management studio for Django - build custom GPTs with a two-pane interface
5
5
  Author: Chris Barry
6
6
  License-Expression: MIT
@@ -3,8 +3,8 @@ django_agent_studio/apps.py,sha256=L89QWn4XOvPBs2z6qHAhaE4uZQpasJntYD75aSd2p_k,6
3
3
  django_agent_studio/urls.py,sha256=O_rrobaxpmg8gR0JmeUzQ0TI3E8mGdcz27p4OJlcI8s,743
4
4
  django_agent_studio/views.py,sha256=bQxSIeL9-D4MzKwWkeHEFXrzo1CD911qicrt_A8t_6M,3153
5
5
  django_agent_studio/agents/__init__.py,sha256=VYL_ato0DtggIo4BGRkyiz9cm1ARPXhhTQFzoG__NVM,800
6
- django_agent_studio/agents/builder.py,sha256=aUH5swcBYKmVByB2C9cMoTDmoGhvxmXDM0BXY6_ut1k,77147
7
- django_agent_studio/agents/dynamic.py,sha256=M1pSfwfujKKikdDZPcEcd7DCsM-0ZTWGRvEC9HuIWMs,13681
6
+ django_agent_studio/agents/builder.py,sha256=Kpn16CK_5JuPJT02UO0VsTPhNusY2v4LrWA2Dcvs7WM,80594
7
+ django_agent_studio/agents/dynamic.py,sha256=KhmdAHkYUdfuuBgsKeY-Sf9sjDA-QiBVWHpw0NAgPX0,13939
8
8
  django_agent_studio/api/__init__.py,sha256=vtBwuvBENyFFhFqCWyFsI6cYu4N9ZGqSMmHIRhr9a_U,45
9
9
  django_agent_studio/api/permissions.py,sha256=MutmA8TxZb4ZwGfeEoolK-QI04Gbcxs7DPNzkXe_Bss,5302
10
10
  django_agent_studio/api/serializers.py,sha256=rkn9xtACbJZlCBr6TLD5r-HsE1AWlaX39WYegtwEIig,18268
@@ -26,7 +26,7 @@ django_agent_studio/templates/django_agent_studio/base.html,sha256=rpHmr7CAWGwRk
26
26
  django_agent_studio/templates/django_agent_studio/builder.html,sha256=L2KX-RLVpnC2mmYsIl_aSeJIc6b63knTYVrDg8aaU1g,61425
27
27
  django_agent_studio/templates/django_agent_studio/home.html,sha256=pgwKPjiQe9UxYYLGSsKT-6erEPDUdW9MZ5D-MOjIxK4,4385
28
28
  django_agent_studio/templates/django_agent_studio/test.html,sha256=h9aTtTD1eYcgG-n410qMSryHdpXyKny0hjiKYAoGsic,3779
29
- django_agent_studio-0.1.4.dist-info/METADATA,sha256=WltdK6F9mB4hg3Koj_ydk-I6rEuzqPzqiBksIM0xiR0,11294
30
- django_agent_studio-0.1.4.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
31
- django_agent_studio-0.1.4.dist-info/top_level.txt,sha256=O1kqZzXPOsJlqnPSAcB2fH5WpJNY8ZNfHEJzX9_SZ0A,20
32
- django_agent_studio-0.1.4.dist-info/RECORD,,
29
+ django_agent_studio-0.1.5.dist-info/METADATA,sha256=_2hWCRBbGlZNCwlNNzIxeaT2jvjPiOhQI9krgm-zoOw,11294
30
+ django_agent_studio-0.1.5.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
31
+ django_agent_studio-0.1.5.dist-info/top_level.txt,sha256=O1kqZzXPOsJlqnPSAcB2fH5WpJNY8ZNfHEJzX9_SZ0A,20
32
+ django_agent_studio-0.1.5.dist-info/RECORD,,