Compact task summary for prompts
import os
from acontext import AcontextClient
client = AcontextClient(api_key=os.getenv("ACONTEXT_API_KEY"))
summary = client.sessions.get_session_summary(session_id)
system_prompt = f"""You are a helpful assistant.
Previous tasks:
{summary}
Continue helping the user.
"""
<task id="1" description="Search for iPhone 15 news">
<progress>
1. Searched and found key specs
2. Compiled feature comparison
</progress>
<user_preference>
1. Focus on camera capabilities
</user_preference>
</task>
# Limit to last 5 tasks
summary = client.sessions.get_session_summary(session_id, limit=5)