-
-
Notifications
You must be signed in to change notification settings - Fork 977
Expand file tree
/
Copy pathduckdb_agent.py
More file actions
25 lines (21 loc) · 693 Bytes
/
Copy pathduckdb_agent.py
File metadata and controls
25 lines (21 loc) · 693 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from swarms import Agent
from swarms.communication.duckdb_wrap import DuckDBConversation
# Configure a DuckDB-backed conversation store
conversation_store = DuckDBConversation(
db_path="support_conversation.duckdb",
table_name="support_history",
enable_logging=True,
)
# Create an agent that uses this persistent memory
agent = Agent(
agent_name="HelpdeskAgent",
system_prompt="You are a helpful assistant.",
model_name="gpt-5.4",
long_term_memory=conversation_store,
max_loops=1,
autosave=False,
)
response = agent.run("What are your hours of operation?")
print(response)
# View the conversation as stored in DuckDB
print(conversation_store.to_dict())