fix: restore compatibility with latest agno version

This commit is contained in:
BV003
2025-10-09 10:40:11 +08:00
parent f7c1ac8fa8
commit 4fbfb90737
3 changed files with 7 additions and 6 deletions

View File

@@ -14,7 +14,7 @@ A terminal-based Notion Agent for interacting with your Notion pages using natur
## Prerequisites
- Python 3.9+
- Python 3.10+
- A Notion account with admin permissions
- A Notion Integration token
- An OpenAI API key

View File

@@ -7,7 +7,7 @@ from textwrap import dedent
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.mcp import MCPTools
from agno.memory.v2 import Memory
from agno.db.sqlite import SqliteDb
from mcp import StdioServerParameters
from dotenv import load_dotenv
@@ -68,7 +68,7 @@ async def main():
# Start the MCP Tools session
async with MCPTools(server_params=server_params) as mcp_tools:
print("Connected to Notion MCP server successfully!")
db = SqliteDb(db_file="agno.db") # SQLite DB for memory
# Create the agent
agent = Agent(
name="NotionDocsAgent",
@@ -97,10 +97,10 @@ async def main():
The user's current page ID is: {page_id}
"""),
markdown=True,
show_tool_calls=True,
retries=3,
memory=Memory(), # Use Memory v2 for better multi-session support
add_history_to_messages=True, # Include conversation history
db=db,
enable_user_memories=True, # This enables Memory for the Agent
add_history_to_context=True, # Include conversation history
num_history_runs=5, # Keep track of the last 5 interactions
)

View File

@@ -2,3 +2,4 @@ agno
python-dotenv
mcp
openai
sqlalchemy