Skip to content

Building AI agents, atomically

refactor: AgentMemory renamed to ChatHistory, #115

jon foxa2407508e553
diff --git a/README.md b/README.md
index 8afbfe8..05e5670 100644
--- a/README.md
+++ b/README.md
@@ -140,7 +140,7 @@ import instructor
from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig, BaseAgentInputSchema
from atomic_agents.lib.base.base_io_schema import BaseIOSchema
from atomic_agents.lib.components.system_prompt_generator import SystemPromptGenerator
-from atomic_agents.lib.components.agent_memory import AgentMemory
+from atomic_agents.lib.components.agent_memory import AgentHistory
# Define a custom output schema
class CustomOutputSchema(BaseIOSchema):
@@ -173,7 +173,7 @@ agent = BaseAgent[BaseAgentInputSchema, CustomOutputSchema](
client=client,
model="gpt-4o-mini",
system_prompt_generator=system_prompt_generator,
- memory=AgentMemory(),
+ memory=AgentHistory(),
)
)
diff --git a/atomic-agents/atomic_agents/agents/base_agent.py b/atomic-agents/atomic_agents/agents/base_agent.py
index 096c5c1..f02fc1e 100644
--- a/atomic-agents/atomic_agents/agents/base_agent.py
+++ b/atomic-agents/atomic_agents/agents/base_agent.py
@@ -1,7 +1,7 @@
import instructor
from pydantic import BaseModel, Field
from typing import Optional, Type, Generator, AsyncGenerator, get_args
-from atomic_agents.lib.components.agent_history import AgentMemory
+from atomic_agents.lib.components.agent_history import AgentHistory
from atomic_agents.lib.components.system_prompt_generator import (
SystemPromptContextProviderBase,
SystemPromptGenerator,
@@ -60,7 +60,7 @@ class BaseAgentOutputSchema(BaseIOSchema):
class BaseAgentConfig(BaseModel):
client: instructor.client.Instructor = Field(..., description="Client for interacting with the language model.")
model: str = Field(default="gpt-4o-mini", description="The model to use for generating responses.")
- memory: Optional[AgentMemory] = Field(default=None, description="Memory component for storing chat history.")
+ memory: Optional[AgentHistory] = Field(default=None, description="Memory component for storing chat history.")
system_prompt_generator: Optional[SystemPromptGenerator] = Field(
default=None, description="Component for generating system prompts."
)
@@ -85,10 +85,10 @@ class BaseAgent[InputSchema: BaseIOSchema, OutputSchema: BaseIOSchema]:
Attributes:
client: Client for interacting with the language model.
model (str): The model to use for generating responses.
- memory (AgentMemory): Memory component for storing chat history.
+ memory (AgentHistory): Memory component for storing chat history.
system_prompt_generator (SystemPromptGenerator): Component for generating system prompts.
system_role (Optional[str]): The role of the system in the conversation. None means no system prompt.
- initial_memory (AgentMemory): Initial state of the memory.
+ initial_memory (AgentHistory): Initial state of the memory.
current_user_input (Optional[InputSchema]): The current user input being processed.
model_api_parameters (dict): Additional parameters passed to the API provider.
- Use this for parameters like 'temperature', 'max_tokens', etc.
@@ -103,7 +103,7 @@ class BaseAgent[InputSchema: BaseIOSchema, OutputSchema: BaseIOSchema]:
"""
self.client = config.client
self.model = config.model
- self.memory = config.memory or AgentMemory()
+ self.memory = config.memory or AgentHistory()
self.system_prompt_generator = config.system_prompt_generator or SystemPromptGenerator()
self.system_role = config.system_role
self.initial_memory = self.memory.copy()
diff --git a/atomic-agents/atomic_agents/lib/components/agent_history.py b/atomic-agents/atomic_agents/lib/components/agent_history.py
index 0890153..b9f6fd4 100644
--- a/atomic-agents/atomic_agents/lib/components/agent_history.py
+++ b/atomic-agents/atomic_agents/lib/components/agent_history.py
@@ -20,7 +20,7 @@ class Message(BaseModel):
turn_id: Optional[str] = None
-class AgentMemory:
+class AgentHistory:
"""
Manages the chat history for an AI agent.
@@ -32,7 +32,7 @@ class AgentMemory:
def __init__(self, max_messages: Optional[int] = None):
"""
- Initializes the AgentMemory with an empty history and optional constraints.
+ Initializes the AgentHistory with an empty history and optional constraints.
Args:
max_messages (Optional[int]): Maximum number of messages to keep in history.
@@ -124,14 +124,14 @@ class AgentMemory:
history.append({"role": message.role, "content": json.dumps(content.model_dump(mode="json"))})
return history
- def copy(self) -> "AgentMemory":
+ def copy(self) -> "AgentHistory":
"""
Creates a copy of the chat memory.
Returns:
- AgentMemory: A copy of the chat memory.
+ AgentHistory: A copy of the chat memory.
"""
- new_memory = AgentMemory(max_messages=self.max_messages)
+ new_memory = AgentHistory(max_messages=self.max_messages)
new_memory.load(self.dump())
new_memory.current_turn_id = self.current_turn_id
return new_memory
@@ -182,10 +182,10 @@ class AgentMemory:
def dump(self) -> str:
"""
- Serializes the entire AgentMemory instance to a JSON string.
+ Serializes the entire AgentHistory instance to a JSON string.
Returns:
- str: A JSON string representation of the AgentMemory.
+ str: A JSON string representation of the AgentHistory.
"""
serialized_history = []
for message in self.history:
@@ -209,10 +209,10 @@ class AgentMemory:
def load(self, serialized_data: str) -> None:
"""
- Deserializes a JSON string and loads it into the AgentMemory instance.
+ Deserializes a JSON string and loads it into the AgentHistory instance.
Args:
- serialized_data (str): A JSON string representation of the AgentMemory.
+ serialized_data (str): A JSON string representation of the AgentHistory.
Raises:
ValueError: If the serialized data is invalid or cannot be deserialized.
@@ -287,7 +287,7 @@ if __name__ == "__main__":
images: List[instructor.Image] = Field(..., description="The images to analyze")
# Create and populate the original memory with complex data
- original_memory = AgentMemory(max_messages=10)
+ original_memory = AgentHistory(max_messages=10)
# Add a complex input message
original_memory.add_message(
@@ -330,7 +330,7 @@ if __name__ == "__main__":
print(dumped_data)
# Create a new memory and load the dumped data
- loaded_memory = AgentMemory()
+ loaded_memory = AgentHistory()
loaded_memory.load(dumped_data)
# Print detailed information about the loaded memory
diff --git a/atomic-agents/tests/agents/test_base_agent.py b/atomic-agents/tests/agents/test_base_agent.py
index af61284..ad126df 100644
--- a/atomic-agents/tests/agents/test_base_agent.py
+++ b/atomic-agents/tests/agents/test_base_agent.py
@@ -9,7 +9,7 @@ from atomic_agents.agents.base_agent import (
BaseAgentInputSchema,
BaseAgentOutputSchema,
SystemPromptGenerator,
- AgentMemory,
+ AgentHistory,
SystemPromptContextProviderBase,
)
from instructor.dsl.partial import PartialBase
@@ -58,10 +58,10 @@ def mock_instructor_async():
@pytest.fixture
def mock_memory():
- mock = Mock(spec=AgentMemory)
+ mock = Mock(spec=AgentHistory)
mock.get_history.return_value = []
mock.add_message = Mock()
- mock.copy = Mock(return_value=Mock(spec=AgentMemory))
+ mock.copy = Mock(return_value=Mock(spec=AgentHistory))
mock.initialize_turn = Mock()
return mock
diff --git a/atomic-agents/tests/lib/components/test_agent_history.py b/atomic-agents/tests/lib/components/test_agent_history.py
index d06e8c9..253165a 100644
--- a/atomic-agents/tests/lib/components/test_agent_history.py
+++ b/atomic-agents/tests/lib/components/test_agent_history.py
@@ -2,7 +2,7 @@ import pytest
import json
from typing import List, Dict
from pydantic import Field
-from atomic_agents.lib.components.agent_history import AgentMemory, Message
+from atomic_agents.lib.components.agent_history import AgentHistory, Message
from atomic_agents.lib.base.base_io_schema import BaseIOSchema
import instructor
@@ -52,7 +52,7 @@ class MockMultimodalSchema(BaseIOSchema):
@pytest.fixture
def memory():
- return AgentMemory(max_messages=5)
+ return AgentHistory(max_messages=5)
def test_initialization(memory):
@@ -132,7 +132,7 @@ def test_dump_and_load(memory):
)
dumped_data = memory.dump()
- new_memory = AgentMemory()
+ new_memory = AgentHistory()
new_memory.load(dumped_data)
assert new_memory.max_messages == memory.max_messages
@@ -151,7 +151,7 @@ def test_load_invalid_data(memory):
def test_get_class_from_string():
class_string = "tests.lib.components.test_agent_memory.InputSchema"
- cls = AgentMemory._get_class_from_string(class_string)
+ cls = AgentHistory._get_class_from_string(class_string)
assert cls.__name__ == InputSchema.__name__
assert cls.__module__.endswith("test_agent_memory")
assert issubclass(cls, BaseIOSchema)
@@ -159,7 +159,7 @@ def test_get_class_from_string():
def test_get_class_from_string_invalid():
with pytest.raises((ImportError, AttributeError)):
- AgentMemory._get_class_from_string("invalid.module.Class")
+ AgentHistory._get_class_from_string("invalid.module.Class")
def test_message_model():
@@ -196,7 +196,7 @@ def test_complex_scenario(memory):
# Dump and load
dumped_data = memory.dump()
- new_memory = AgentMemory()
+ new_memory = AgentHistory()
new_memory.load(dumped_data)
# Verify loaded data
@@ -215,21 +215,21 @@ def test_complex_scenario(memory):
def test_memory_with_no_max_messages():
- unlimited_memory = AgentMemory()
+ unlimited_memory = AgentHistory()
for i in range(100):
unlimited_memory.add_message("user", InputSchema(test_field=f"Message {i}"))
assert len(unlimited_memory.history) == 100
def test_memory_with_zero_max_messages():
- zero_max_memory = AgentMemory(max_messages=0)
+ zero_max_memory = AgentHistory(max_messages=0)
for i in range(10):
zero_max_memory.add_message("user", InputSchema(test_field=f"Message {i}"))
assert len(zero_max_memory.history) == 0
def test_memory_turn_consistency():
- memory = AgentMemory()
+ memory = AgentHistory()
memory.initialize_turn()
turn_id = memory.get_current_turn_id()
memory.add_message("user", InputSchema(test_field="Hello"))
@@ -248,7 +248,7 @@ def test_agent_memory_delete_turn_id(memory):
mock_input = InputSchema(test_field="Test input")
mock_output = InputSchema(test_field="Test output")
- memory = AgentMemory()
+ memory = AgentHistory()
initial_turn_id = "123-456"
memory.current_turn_id = initial_turn_id
diff --git a/atomic-examples/mcp-agent/example-client/example_client/main_sse.py b/atomic-examples/mcp-agent/example-client/example_client/main_sse.py
index 0d40a70..0ef191b 100644
--- a/atomic-examples/mcp-agent/example-client/example_client/main_sse.py
+++ b/atomic-examples/mcp-agent/example-client/example_client/main_sse.py
@@ -9,7 +9,7 @@ import instructor
from pydantic import Field
from atomic_agents.agents.base_agent import BaseIOSchema, BaseAgent, BaseAgentConfig
from atomic_agents.lib.components.system_prompt_generator import SystemPromptGenerator
-from atomic_agents.lib.components.agent_history import AgentMemory
+from atomic_agents.lib.components.agent_history import AgentHistory
from typing import Union, Type, Dict
from dataclasses import dataclass
import re
@@ -140,7 +140,7 @@ def main():
console.print(table)
# Create and initialize orchestrator agent
console.print("[dim]• Creating orchestrator agent...[/dim]")
- memory = AgentMemory()
+ memory = AgentHistory()
orchestrator_agent = BaseAgent[MCPOrchestratorInputSchema, OrchestratorOutputSchema](
BaseAgentConfig(
client=client,
diff --git a/atomic-examples/mcp-agent/example-client/example_client/main_stdio.py b/atomic-examples/mcp-agent/example-client/example_client/main_stdio.py
index 6fe3c7a..ea1f654 100644
--- a/atomic-examples/mcp-agent/example-client/example_client/main_stdio.py
+++ b/atomic-examples/mcp-agent/example-client/example_client/main_stdio.py
@@ -11,7 +11,7 @@ from contextlib import AsyncExitStack
from pydantic import Field
from atomic_agents.agents.base_agent import BaseIOSchema, BaseAgent, BaseAgentConfig
from atomic_agents.lib.components.system_prompt_generator import SystemPromptGenerator
-from atomic_agents.lib.components.agent_history import AgentMemory
+from atomic_agents.lib.components.agent_history import AgentHistory
from typing import Union, Type, Dict, Optional
from dataclasses import dataclass
from mcp import ClientSession, StdioServerParameters
@@ -133,7 +133,7 @@ def main():
console.print(table)
# Create and initialize orchestrator agent
console.print("[dim]• Creating orchestrator agent...[/dim]")
- memory = AgentMemory()
+ memory = AgentHistory()
orchestrator_agent = BaseAgent[MCPOrchestratorInputSchema, OrchestratorOutputSchema](
BaseAgentConfig(
client=client,
diff --git a/atomic-examples/quickstart/quickstart/1_0_basic_chatbot.py b/atomic-examples/quickstart/quickstart/1_0_basic_chatbot.py
index 04536ec..0c1fc69 100644
--- a/atomic-examples/quickstart/quickstart/1_0_basic_chatbot.py
+++ b/atomic-examples/quickstart/quickstart/1_0_basic_chatbot.py
@@ -4,7 +4,7 @@ import openai
from rich.console import Console
from rich.panel import Panel
from rich.text import Text
-from atomic_agents.lib.components.agent_history import AgentMemory
+from atomic_agents.lib.components.agent_history import AgentHistory
from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig, BaseAgentInputSchema, BaseAgentOutputSchema
# API Key setup
@@ -21,7 +21,7 @@ if not API_KEY:
console = Console()
# Memory setup
-memory = AgentMemory()
+memory = AgentHistory()
# Initialize memory with an initial message from the assistant
initial_message = BaseAgentOutputSchema(chat_message="Hello! How can I assist you today?")
diff --git a/atomic-examples/quickstart/quickstart/1_1_basic_chatbot_streaming.py b/atomic-examples/quickstart/quickstart/1_1_basic_chatbot_streaming.py
index e36648e..46ca6d3 100644
--- a/atomic-examples/quickstart/quickstart/1_1_basic_chatbot_streaming.py
+++ b/atomic-examples/quickstart/quickstart/1_1_basic_chatbot_streaming.py
@@ -4,7 +4,7 @@ import openai
from rich.console import Console
from rich.panel import Panel
from rich.text import Text
-from atomic_agents.lib.components.agent_history import AgentMemory
+from atomic_agents.lib.components.agent_history import AgentHistory
from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig, BaseAgentInputSchema, BaseAgentOutputSchema
# API Key setup
@@ -21,7 +21,7 @@ if not API_KEY:
console = Console()
# Memory setup
-memory = AgentMemory()
+memory = AgentHistory()
# Initialize memory with an initial message from the assistant
initial_message = BaseAgentOutputSchema(chat_message="Hello! How can I assist you today?")
diff --git a/atomic-examples/quickstart/quickstart/1_2_basic_chatbot_async_streaming.py b/atomic-examples/quickstart/quickstart/1_2_basic_chatbot_async_streaming.py
index 0609652..baa9421 100644
--- a/atomic-examples/quickstart/quickstart/1_2_basic_chatbot_async_streaming.py
+++ b/atomic-examples/quickstart/quickstart/1_2_basic_chatbot_async_streaming.py
@@ -5,7 +5,7 @@ from rich.console import Console
from rich.panel import Panel
from rich.text import Text
from rich.live import Live
-from atomic_agents.lib.components.agent_history import AgentMemory
+from atomic_agents.lib.components.agent_history import AgentHistory
from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig, BaseAgentInputSchema, BaseAgentOutputSchema
# API Key setup
@@ -22,7 +22,7 @@ if not API_KEY:
console = Console()
# Memory setup
-memory = AgentMemory()
+memory = AgentHistory()
# Initialize memory with an initial message from the assistant
initial_message = BaseAgentOutputSchema(chat_message="Hello! How can I assist you today?")
diff --git a/atomic-examples/quickstart/quickstart/2_basic_custom_chatbot.py b/atomic-examples/quickstart/quickstart/2_basic_custom_chatbot.py
index 83002ce..a75c3bf 100644
--- a/atomic-examples/quickstart/quickstart/2_basic_custom_chatbot.py
+++ b/atomic-examples/quickstart/quickstart/2_basic_custom_chatbot.py
@@ -5,7 +5,7 @@ from rich.console import Console
from rich.panel import Panel
from rich.text import Text
from atomic_agents.lib.components.system_prompt_generator import SystemPromptGenerator
-from atomic_agents.lib.components.agent_history import AgentMemory
+from atomic_agents.lib.components.agent_history import AgentHistory
from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig, BaseAgentInputSchema, BaseAgentOutputSchema
# API Key setup
@@ -22,7 +22,7 @@ if not API_KEY:
console = Console()
# Memory setup
-memory = AgentMemory()
+memory = AgentHistory()
# Initialize memory with an initial message from the assistant
initial_message = BaseAgentOutputSchema(
diff --git a/atomic-examples/quickstart/quickstart/3_0_basic_custom_chatbot_with_custom_schema.py b/atomic-examples/quickstart/quickstart/3_0_basic_custom_chatbot_with_custom_schema.py
index 68d8cf7..90f4d0a 100644
--- a/atomic-examples/quickstart/quickstart/3_0_basic_custom_chatbot_with_custom_schema.py
+++ b/atomic-examples/quickstart/quickstart/3_0_basic_custom_chatbot_with_custom_schema.py
@@ -7,7 +7,7 @@ from rich.text import Text
from typing import List
from pydantic import Field
from atomic_agents.lib.components.system_prompt_generator import SystemPromptGenerator
-from atomic_agents.lib.components.agent_history import AgentMemory
+from atomic_agents.lib.components.agent_history import AgentHistory
from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig, BaseAgentInputSchema
from atomic_agents.lib.base.base_io_schema import BaseIOSchema
@@ -25,7 +25,7 @@ if not API_KEY:
console = Console()
# Memory setup
-memory = AgentMemory()
+memory = AgentHistory()
# Custom output schema
diff --git a/atomic-examples/quickstart/quickstart/3_1_basic_custom_chatbot_with_custom_schema_streaming.py b/atomic-examples/quickstart/quickstart/3_1_basic_custom_chatbot_with_custom_schema_streaming.py
index 7b6c4b4..09fed7b 100644
--- a/atomic-examples/quickstart/quickstart/3_1_basic_custom_chatbot_with_custom_schema_streaming.py
+++ b/atomic-examples/quickstart/quickstart/3_1_basic_custom_chatbot_with_custom_schema_streaming.py
@@ -8,7 +8,7 @@ from rich.live import Live
from typing import List
from pydantic import Field
from atomic_agents.lib.components.system_prompt_generator import SystemPromptGenerator
-from atomic_agents.lib.components.agent_history import AgentMemory
+from atomic_agents.lib.components.agent_history import AgentHistory
from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig, BaseAgentInputSchema
from atomic_agents.lib.base.base_io_schema import BaseIOSchema
@@ -26,7 +26,7 @@ if not API_KEY:
console = Console()
# Memory setup
-memory = AgentMemory()
+memory = AgentHistory()
# Custom output schema
diff --git a/atomic-examples/quickstart/quickstart/4_basic_chatbot_different_providers.py b/atomic-examples/quickstart/quickstart/4_basic_chatbot_different_providers.py
index 3e03308..12013a3 100644
--- a/atomic-examples/quickstart/quickstart/4_basic_chatbot_different_providers.py
+++ b/atomic-examples/quickstart/quickstart/4_basic_chatbot_different_providers.py
@@ -3,7 +3,7 @@ import instructor
from rich.console import Console
from rich.panel import Panel
from rich.text import Text
-from atomic_agents.lib.components.agent_history import AgentMemory
+from atomic_agents.lib.components.agent_history import AgentHistory
from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig, BaseAgentInputSchema, BaseAgentOutputSchema
from dotenv import load_dotenv
@@ -13,7 +13,7 @@ load_dotenv()
console = Console()
# Memory setup
-memory = AgentMemory()
+memory = AgentHistory()
# Initialize memory with an initial message from the assistant
initial_message = BaseAgentOutputSchema(chat_message="Hello! How can I assist you today?")
diff --git a/atomic-examples/web-search-agent/web_search_agent/main.py b/atomic-examples/web-search-agent/web_search_agent/main.py
index 46652a6..3234c71 100644
--- a/atomic-examples/web-search-agent/web_search_agent/main.py
+++ b/atomic-examples/web-search-agent/web_search_agent/main.py
@@ -5,7 +5,7 @@ from rich.markdown import Markdown
from pydantic import Field
from atomic_agents.agents.base_agent import BaseIOSchema
-from atomic_agents.lib.components.agent_history import AgentMemory
+from atomic_agents.lib.components.agent_history import AgentHistory
from atomic_agents.lib.components.system_prompt_generator import SystemPromptContextProviderBase
from web_search_agent.tools.searxng_search import (
@@ -25,7 +25,7 @@ load_dotenv()
console = Console()
# Memory setup
-memory = AgentMemory()
+memory = AgentHistory()
# Initialize the SearXNGSearchTool
search_tool = SearXNGSearchTool(config=SearXNGSearchToolConfig(base_url=os.getenv("SEARXNG_BASE_URL"), max_results=5))
diff --git a/docs/api/agents.md b/docs/api/agents.md
index 17d8d99..427f86b 100644
--- a/docs/api/agents.md
+++ b/docs/api/agents.md
@@ -103,7 +103,7 @@ The `BaseAgent` class is the foundation for building AI agents in the Atomic Age
```python
from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig
-from atomic_agents.lib.components.agent_memory import AgentMemory
+from atomic_agents.lib.components.agent_memory import AgentHistory
from atomic_agents.lib.components.system_prompt_generator import SystemPromptGenerator
# Create agent with basic configuration
@@ -111,7 +111,7 @@ agent = BaseAgent[BaseAgentInputSchema, BaseAgentOutputSchema](
config=BaseAgentConfig(
client=instructor.from_openai(OpenAI()),
model="gpt-4-turbo-preview",
- memory=AgentMemory(),
+ memory=AgentHistory(),
system_prompt_generator=SystemPromptGenerator()
)
)
@@ -132,7 +132,7 @@ The `BaseAgentConfig` class provides configuration options:
class BaseAgentConfig:
client: instructor.Instructor # Client for interacting with the language model
model: str = "gpt-4-turbo-preview" # Model to use
- memory: Optional[AgentMemory] = None # Memory component
+ memory: Optional[AgentHistory] = None # Memory component
system_prompt_generator: Optional[SystemPromptGenerator] = None # Prompt generator
input_schema: Optional[Type[BaseModel]] = None # Custom input schema
output_schema: Optional[Type[BaseModel]] = None # Custom output schema
@@ -207,7 +207,7 @@ async def chat():
### Memory Management
-The agent automatically manages conversation history through the `AgentMemory` component:
+The agent automatically manages conversation history through the `AgentHistory` component:
```python
# Access memory
diff --git a/docs/api/components.md b/docs/api/components.md
index b85e5ef..7d68180 100644
--- a/docs/api/components.md
+++ b/docs/api/components.md
@@ -2,14 +2,14 @@
## Agent Memory
-The `AgentMemory` class manages conversation history and state for AI agents:
+The `AgentHistory` class manages conversation history and state for AI agents:
```python
-from atomic_agents.lib.components.agent_memory import AgentMemory
+from atomic_agents.lib.components.agent_memory import AgentHistory
from atomic_agents.lib.base.base_io_schema import BaseIOSchema
# Initialize memory with optional max messages
-memory = AgentMemory(max_messages=10)
+memory = AgentHistory(max_messages=10)
# Add messages
memory.add_message(
diff --git a/docs/api/index.md b/docs/api/index.md
index 88cb6bb..0fa7572 100644
--- a/docs/api/index.md
+++ b/docs/api/index.md
@@ -30,7 +30,7 @@ The agents module provides the base classes for creating AI agents:
The components module contains essential building blocks:
-- `AgentMemory`: Manages conversation history and state with support for:
+- `AgentHistory`: Manages conversation history and state with support for:
- Message history with role-based messages
- Turn-based conversation tracking
- Multimodal content
diff --git a/docs/examples/mcp_agent.md b/docs/examples/mcp_agent.md
index 617178e..c94ba51 100644
--- a/docs/examples/mcp_agent.md
+++ b/docs/examples/mcp_agent.md
@@ -99,7 +99,7 @@ tool_schema_to_class_map = {
2. **Query Processing**:
- Uses an orchestrator agent to analyze queries
- Extracts parameters and selects appropriate tools
-- Maintains conversation context through AgentMemory
+- Maintains conversation context through AgentHistory
## MCP Transport Methods
diff --git a/docs/guides/quickstart.md b/docs/guides/quickstart.md
index b8c7ff2..d6cc8db 100644
--- a/docs/guides/quickstart.md
+++ b/docs/guides/quickstart.md
@@ -24,14 +24,14 @@ import os
import instructor
import openai
from rich.console import Console
-from atomic_agents.lib.components.agent_memory import AgentMemory
+from atomic_agents.lib.components.agent_memory import AgentHistory
from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig, BaseAgentInputSchema, BaseAgentOutputSchema
# Initialize console for pretty outputs
console = Console()
# Memory setup
-memory = AgentMemory()
+memory = AgentHistory()
# Initialize memory with an initial message from the assistant
initial_message = BaseAgentOutputSchema(chat_message="Hello! How can I assist you today?")
@@ -80,14 +80,14 @@ from rich.console import Console
from rich.panel import Panel
from rich.text import Text
from rich.live import Live
-from atomic_agents.lib.components.agent_memory import AgentMemory
+from atomic_agents.lib.components.agent_memory import AgentHistory
from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig, BaseAgentInputSchema, BaseAgentOutputSchema
# Initialize console for pretty outputs
console = Console()
# Memory setup
-memory = AgentMemory()
+memory = AgentHistory()
# Initialize memory with an initial message from the assistant
initial_message = BaseAgentOutputSchema(chat_message="Hello! How can I assist you today?")
@@ -152,7 +152,7 @@ from rich.console import Console
from typing import List
from pydantic import Field
from atomic_agents.lib.components.system_prompt_generator import SystemPromptGenerator
-from atomic_agents.lib.components.agent_memory import AgentMemory
+from atomic_agents.lib.components.agent_memory import AgentHistory
from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig, BaseAgentInputSchema
from atomic_agents.lib.base.base_io_schema import BaseIOSchema
@@ -160,7 +160,7 @@ from atomic_agents.lib.base.base_io_schema import BaseIOSchema
console = Console()
# Memory setup
-memory = AgentMemory()
+memory = AgentHistory()
# Custom output schema
class CustomOutputSchema(BaseIOSchema):
@@ -258,7 +258,7 @@ import os
import instructor
from rich.console import Console
from rich.text import Text
-from atomic_agents.lib.components.agent_memory import AgentMemory
+from atomic_agents.lib.components.agent_memory import AgentHistory
from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig, BaseAgentInputSchema, BaseAgentOutputSchema
from dotenv import load_dotenv
@@ -268,7 +268,7 @@ load_dotenv()
console = Console()
# Memory setup
-memory = AgentMemory()
+memory = AgentHistory()
# Initialize memory with an initial message from the assistant
initial_message = BaseAgentOutputSchema(chat_message="Hello! How can I assist you today?")
diff --git a/docs/index.md b/docs/index.md
index e944374..a5fae3a 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -61,7 +61,7 @@ Here's a glimpse of how easy it is to create an agent:
```python
import instructor
import openai
-from atomic_agents.lib.components.agent_memory import AgentMemory
+from atomic_agents.lib.components.agent_memory import AgentHistory
from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig, BaseAgentInputSchema, BaseAgentOutputSchema
@@ -70,7 +70,7 @@ from atomic_agents.agents.base_agent import BaseAgent, BaseAgentConfig, BaseAgen
# or pass it to the client: openai.OpenAI(api_key="your-api-key")
# Initialize agent with memory
-memory = AgentMemory()
+memory = AgentHistory()
# Set up client with your preferred provider
client = instructor.from_openai(openai.OpenAI()) # Pass your API key here if not in environment