Skip to content

Commit 33cf1be

Browse files
authored
Update agent_with_longterm_memory.py
1 parent 9eeab57 commit 33cf1be

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

examples/agents/memory/agents_and_memory/agent_with_longterm_memory.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
import os
2-
3-
from dotenv import load_dotenv
4-
51
# Import the OpenAIChat model and the Agent struct
62
from swarms import Agent
7-
from swarm_models import OpenAIChat
83
from swarms_memory import ChromaDB
94

10-
# Load the environment variables
11-
load_dotenv()
12-
135
# Get the API key from the environment
146
api_key = os.environ.get("OPENAI_API_KEY")
157

@@ -21,23 +13,16 @@
2113
docs_folder="artifacts",
2214
)
2315

24-
# Initialize the language model
25-
llm = OpenAIChat(
26-
temperature=0.5,
27-
openai_api_key=api_key,
28-
max_tokens=1000,
29-
)
30-
3116
## Initialize the workflow
3217
agent = Agent(
18+
agent_name = "Long-Term-Memory-Agent",
3319
model_name="gpt-4o-mini",
3420
name="Health and Wellness Blog",
3521
system_prompt="Generate a 10,000 word blog on health and wellness.",
36-
max_loops=4,
22+
max_loops=1,
3723
autosave=True,
3824
dashboard=True,
3925
long_term_memory=[chromadb],
40-
memory_chunk_size=300,
4126
)
4227

4328
# Run the workflow on a task

0 commit comments

Comments
 (0)