Acontext is a context data platform that:
- Stores contexts & artifacts
- Observes agent tasks and user feedback.
- Enables agent self-learning by collecting experiences (SOPs) into long-term memory.
- Offers a local Dashboard to view messages, tasks, artifacts and experiences.
Store Contexts, Observe Tasks, then Learn Skills
We're building it because we believe Acontext can help you:
- Build a more scalable agent product
- Improve your agent success rate and reduce running steps
so that your agent can be more stable and provide greater value to your users.
-
Session - A conversation thread that stores messages with multi-modal support.
- Task - extracted automatically from conversations. Tasks move through
pendingโrunningโsuccess/failedstates.
- Task - extracted automatically from conversations. Tasks move through
-
Disk - File storage for agent artifacts.
-
Space - A knowledge repository (like Notion) for agent, where learned skills are stored.
- Experience Agent - Background AI agents that extract tasks and learn skills.
- Skill Block - A learned experience from complex tasks.
โโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ User โโโโโบโ Your Agent โโโโโบโ Session (stores msgs) โ โ Disk (stores artifacts) โ
โโโโโโโโ โโโโโโโฒโโโโโโโ โโโโโโโโโโโโโโฌโโโโโโโโโโโโโ โโโโโโโโโโโโโฒโโโโโโโโโโโโโโ
โ โ โ
โ โ โโโโโโโโโโโดโโโโโโโโโโ
โ โ โ Agent reads/writesโ
โ โ โ files as needed โ
โ โ โโโโโโโโโโโโโโโโโโโโโ
โ โผ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ Task Extraction โ
โ โ (by Experience Agent) โ
โ โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ โ
โ โผ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ Task Completion โ
โ โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ โ
โ โผ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ Space Connected? โ
โ โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ โ Yes
โ โผ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ Skill Learning โ
โ โ (by Experience Agent) โ
โ โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ โ
โ โผ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ Skill Blocks (stored) โ
โ โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ โ
โ โผ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ Search & Reuse in Future โ
โ โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโ
Skills guide agent behaviorHow to Start It? ๐
๐ means a document link
We have an acontext-cli to help you do quick proof-of-concept. Download it first in your terminal:
curl -fsSL https://install.acontext.io | shYou should have docker installed and an OpenAI API Key to start an Acontext backend on your computer:
acontext docker up๐ Acontext requires at least an OpenAI API key. We recommend
gpt-5.1orgpt-4.1as the LLM model
Once it's done, you can access the following endpoints:
- Acontext API Base URL: http://localhost:8029/api/v1
- Acontext Dashboard: http://localhost:3000/
Dashboard of Success Rate and other Metrics
We're maintaining Python and Typescript
SDKs. The snippets below are using Python.
pip install acontext # for Python
npm i @acontext/acontext # for Typescript
from acontext import AcontextClient
client = AcontextClient(
base_url="http://localhost:8029/api/v1"
api_key="sk-ac-your-root-api-bearer-token"
)
client.ping()
# yes, the default api_key is sk-ac-your-root-api-bearer-tokenAcontext can manage agent sessions and artifacts.
Save Messages ๐
Acontext offers persistent storage for message data. When you call session.send_message, Acontext will persist the message and start to monitor this session:
Code Snippet
session = client.sessions.create()
messages = [
{"role": "user", "content": "I need to write a landing page of iPhone 15 pro max"},
{
"role": "assistant",
"content": "Sure, my plan is below:\n1. Search for the latest news about iPhone 15 pro max\n2. Init Next.js project for the landing page\n3. Deploy the landing page to the website",
}
]
# Save messages
for msg in messages:
client.sessions.send_message(session_id=session.id, blob=msg, format="openai")๐ We also support multi-modal message storage and anthropic SDK.
Load Messages ๐
Obtain your session messages using sessions.get_messages
Code Snippet
r = client.sessions.get_messages(session.id)
new_msg = r.items
new_msg.append({"role": "user", "content": "How you doing?"})
r = openai_client.chat.completions.create(model="gpt-4.1", messages=new_msg)
print(r.choices[0].message.content)
client.sessions.send_message(session_id=session.id, blob=r.choices[0].message)
You can view sessions in your local Dashboard
Artifacts ๐
Create a disk for your agent to store and read artifacts using file paths:
Code Snippet
from acontext import FileUpload
disk = client.disks.create()
file = FileUpload(
filename="todo.md",
content=b"# Sprint Plan\n\n## Goals\n- Complete user authentication\n- Fix critical bugs"
)
artifact = client.disks.artifacts.upsert(
disk.id,
file=file,
file_path="/todo/"
)
print(client.disks.artifacts.list(
disk.id,
path="/todo/"
))
result = client.disks.artifacts.get(
disk.id,
file_path="/todo/",
filename="todo.md",
with_public_url=True,
with_content=True
)
print(f"โ File content: {result.content.raw}")
print(f"โ Download URL: {result.public_url}")
You can view artifacts in your local Dashboard
Observe ๐
For every session, Acontext will automatically launch a background agent to track the task progress and user feedback. It's like a background TODO agent.
You can use the SDK to retrieve the current state of the agent session.
Full Script
from acontext import AcontextClient
# Initialize client
client = AcontextClient(
base_url="http://localhost:8029/api/v1", api_key="sk-ac-your-root-api-bearer-token"
)
# Create a project and session
session = client.sessions.create()
# Conversation messages
messages = [
{"role": "user", "content": "I need to write a landing page of iPhone 15 pro max"},
{
"role": "assistant",
"content": "Sure, my plan is below:\n1. Search for the latest news about iPhone 15 pro max\n2. Init Next.js project for the landing page\n3. Deploy the landing page to the website",
},
{
"role": "user",
"content": "That sounds good. Let's first collect the message and report to me before any landing page coding.",
},
{
"role": "assistant",
"content": "Sure, I will first collect the message then report to you before any landing page coding.",
"tool_calls": [
{
"id": "call_001",
"type": "function",
"function": {
"name": "search_news",
"arguments": "{\"query\": \"iPhone news\"}"
}
}
]
},
]
# Send messages in a loop
for msg in messages:
client.sessions.send_message(session_id=session.id, blob=msg, format="openai")
# Wait for task extraction to complete
client.sessions.flush(session.id)
# Display extracted tasks
tasks_response = client.sessions.get_tasks(session.id)
print(tasks_response)
for task in tasks_response.items:
print(f"\nTask #{task.order}:")
print(f" ID: {task.id}")
print(f" Title: {task.data['task_description']}")
print(f" Status: {task.status}")
# Show progress updates if available
if "progresses" in task.data:
print(f" Progress updates: {len(task.data['progresses'])}")
for progress in task.data["progresses"]:
print(f" - {progress}")
# Show user preferences if available
if "user_preferences" in task.data:
print(" User preferences:")
for pref in task.data["user_preferences"]:
print(f" - {pref}")
flushis a blocking call, it will wait for the task extraction to complete. You don't need to call it in production, Acontext has a buffer mechanism to ensure the task extraction is completed right on time.
Example Task Return:
Task #1:
Title: Search for the latest news about iPhone 15 Pro Max and report findings to the user before any landing page coding.
Status: running
Progress updates: 1
- User clarified preference for reporting the collected news before starting coding, and I confirmed that the first step will be reporting before moving on to landing page development.
User preferences:
- user expects a report on latest news about iPhone 15 pro max before any coding work on the landing page.
Task #2:
Title: Initialize a Next.js project for the iPhone 15 Pro Max landing page.
Status: pending
Task #3:
Title: Deploy the completed landing page to the website.
Status: pendingYou can view the session tasks' statuses in the Dashboard:
A Task Demo
Acontext can gather a bunch of sessions and learn skills (SOPs) on how to call tools for certain tasks.
Learn Skills to a Space ๐
A Space can store skills, experiences, and memories in a Notion-like system. You first need to connect a session to Space to enable the learning process:
# Step 1: Create a Space for skill learning
space = client.spaces.create()
print(f"Created Space: {space.id}")
# Step 2: Create a session attached to the space
session = client.sessions.create(space_id=space.id)
# ... push the agent working contextThe learning happens in the background and is not real-time (delay around 10-30s).
What Acontext will do in the background:
graph LR
A[Task Completed] --> B[Task Extraction]
B --> C{Space Connected?}
C -->|Yes| D[Queue for Learning]
C -->|No| E[Skip Learning]
D --> F[Extract SOP]
F --> G{Hard Enough?}
G -->|No - Too Simple| H[Skip Learning]
G -->|Yes - Complex| I[Store as Skill Block]
I --> J[Available for Future Sessions]
Eventually, SOP blocks with tool-call pattern will be saved to Space. You can view every Space in the Dashboard:
A Space Demo
Search Skills from a Space ๐
To search skills from a Space and use them in the next session:
result = client.spaces.experience_search(
space_id=space.id,
query="I need to implement authentication",
mode="fast"
)Acontext supports fast and agentic modes for search. The former uses embeddings to match skills. The latter uses an Experience Agent to explore the entire Space and tries to cover every skill needed.
The return is a list of sop blocks, which look like below:
{
"use_when": "star a github repo",
"preferences": "use personal account. star but not fork",
"tool_sops": [
{"tool_name": "goto", "action": "goto the user given github repo url"},
{"tool_name": "click", "action": "find login button if any, and start to login first"},
...
]
}To understand what Acontext can do better, please view our docs
Star Acontext on Github to support and receive instant notifications โค๏ธ
Join the community for support and discussions:
- Check our roadmap.md first.
- Read contributing.md
This project is currently licensed under Apache License 2.0.
[](https://acontext.io)
[](https://acontext.io)
