Skip to main content

AgentOS

The operating memory and learning runtime for AI agents. Turn every execution into reusable intelligence that continuously improves future autonomous work.

License: Apache 2.0 Python PyPI CI Tests

Memory is not the product. Learning is. The atomic unit of value is the Experience = knowledge + context + outcome.

AgentOS gives your agents a memory that learns: it reflects on each run, distills durable experiences, generalizes them into best practices and failure patterns, and serves the most useful knowledge back — with a recommended, guard‑railed plan — for the next task.


Why AgentOS

Most "agent memory" is a vector store: it remembers text. AgentOS is different — it learns from outcomes.

  • Experience‑centric — every execution becomes a structured Experience (what worked, why, when it applies).
  • Blended usefulness ranking — retrieval ranks on similarity + empirical usefulness, confidence, reward, and recency — not cosine alone.
  • Learns across runs — repeated successes → best practices; repeated failures → failure patterns you can plan around.
  • Plans, not just recallsplan() synthesizes prior experience into concrete steps + guardrails derived from past failures.
  • Bring your own LLM — Ollama (local), OpenAI‑compatible, and Anthropic (Claude). Per‑engine routing.
  • Runs anywhere — the same API embedded (SQLite/numpy) or self‑hosted (FastAPI + Qdrant/Postgres/Redis).

Install

pip install agentos-memory                      # core   (import stays `import agentos`)
pip install "agentos-memory[ollama,cli]"        # + local models + CLI
pip install "agentos-memory[server]"            # + FastAPI server (Qdrant/Postgres/Redis)
pip install "agentos-memory[mcp]"               # + MCP server for coding agents (Claude Code/Cursor/Roo…)
pip install "agentos-memory[chroma]"            # BYO vector store (also: [pgvector], [pinecone])

Quickstart (embedded, local)

AgentOS requires a real LLM provider — a local model via Ollama or a cloud model with your own key. There are no mock providers.

ollama serve
ollama pull llama3.1:8b
ollama pull nomic-embed-text
from agentos import AgentOS, Execution

memory = AgentOS(
    path="./agent_memory",
    llm={
        "reflection": {"provider": "ollama", "model": "llama3.1:8b"},
        "learning":   {"provider": "ollama", "model": "llama3.1:8b"},
        "planning":   {"provider": "ollama", "model": "llama3.1:8b"},
        "embeddings": {"provider": "ollama", "model": "nomic-embed-text"},
    },
)

memory.learn(Execution(task="Deploy app", output="ok", status="success"))
memory.flush()                              # let async reflection settle (scripts only)
result = memory.retrieve("deploy an app")   # most useful experiences
plan = memory.plan("deploy an app safely")  # recommended approach + guardrails

Cloud models (bring your own key)

# OpenAI (or any OpenAI-compatible endpoint via base_url)
memory = AgentOS(path="./mem", llm={
    "reflection": {"provider": "openai", "model": "gpt-4o-mini", "api_key": "sk-..."},
    "embeddings": {"provider": "openai", "model": "text-embedding-3-small"},
})

# Anthropic (Claude) — for reasoning, paired with a local embeddings model
memory = AgentOS(path="./mem", llm={
    "reflection": {"provider": "anthropic", "model": "claude-sonnet-4-20250514", "api_key": "..."},
    "learning":   {"provider": "anthropic", "model": "claude-sonnet-4-20250514"},
    "planning":   {"provider": "anthropic", "model": "claude-sonnet-4-20250514"},
    "embeddings": {"provider": "ollama", "model": "nomic-embed-text"},
})

Auto‑capture with @remember

Wrap any function so each call is learned from automatically — successes and failures:

from agentos.integrations import remember

@remember(memory)
def resolve_ticket(ticket: str) -> str:
    ...

Framework adapters are included for LangChain, CrewAI, LlamaIndex, and OpenAI Agents.

Coding agents (MCP) — memory that persists across sessions

Give Claude Code, Cursor, Roo Code, Cline, Windsurf, or Codex a persistent, per‑repository memory. One integration works with every MCP client: the agent calls recall before a task and learn after, so knowledge carries across sessions and tools.

pip install "agentos-memory[mcp]"    # provides the `agentos-mcp` stdio server
// e.g. Cursor .cursor/mcp.json — see agentos/mcp/examples for every client
{
  "mcpServers": {
    "agentos": { "command": "agentos-mcp", "env": {} }
  }
}

Tools: recall, learn, record_failure, plan, search_memory, status, and visualize (opens the dashboard for the current repo). Memory is auto‑scoped per repo (git remote → folder). Add the AGENTS.md snippet so agents use it habitually. Full guide: agentos/mcp/README.md.

Per‑user memory (chatbots)

Building a chatbot? Give each end‑user their own private memory — and a short‑term conversation buffer — with the same verbs. Pass user_id and knowledge learned for that user stays private to them; shared knowledge (no user_id) is visible to everyone.

# Learn a private preference for one user
memory.learn(Execution(
    task="preference",
    output="Alice prefers window seats and vegetarian meals.",
    status="success", user_id="alice",
))

# Recall folds in the user's private memory + shared knowledge
memory.recall("what are my seat preferences?", user_id="alice")   # sees Alice's
memory.recall("what are my seat preferences?", user_id="bob")     # does NOT
memory.recall("refund policy")                                    # shared only

Short‑term working memory — a TTL'd, per‑session rolling buffer of turns (distinct from long‑term experiences), backed by the KV store:

memory.remember_turn("user", "Book me a flight to Tokyo",
                     user_id="alice", session_id="chat-42")
memory.remember_turn("assistant", "Sure — window or aisle?",
                     user_id="alice", session_id="chat-42")

memory.render_working_memory(user_id="alice", session_id="chat-42")  # prompt-ready
memory.clear_working_memory(user_id="alice", session_id="chat-42")   # on reset

user_id is an orthogonal axis to org→project→agent tenancy: privacy is enforced in the TenancyGuard, so a user never sees another user's private memory, and an anonymous request never sees any user's private memory.

Bring your own vector store (RAG builders)

Already have a vector DB? Point AgentOS at it — AgentOS adds the memory + learning layer (experiences, GraphRAG, usefulness ranking) on top of your existing store instead of owning one. Every driver implements the same VectorStore contract, so the engines are unchanged.

# Chroma (embedded/persistent or a remote server)
memory = AgentOS(path="./mem", storage={"vector": {"driver": "chroma", "path": "./chroma"}})

# Postgres + pgvector (one DB for metadata + vectors)
memory = AgentOS(path="./mem", storage={
    "vector": {"driver": "pgvector", "url": "postgresql://user:pw@host:5432/db"}})

# Pinecone (managed; AgentOS collections → namespaces in one index)
memory = AgentOS(path="./mem", storage={
    "vector": {"driver": "pinecone", "api_key": "...", "index_name": "agentos"}})

# Qdrant
memory = AgentOS(path="./mem", storage={"vector": {"driver": "qdrant", "url": "http://localhost:6333"}})

Supported vector drivers: numpy (embedded default), qdrant, pgvector, chroma, pinecone. Install the matching extra (agentos[pgvector|chroma|pinecone]). Storage is per‑concern — you can swap only the vector store and keep the rest embedded. See docs/12-storage-plug-and-play.md.

Self‑host + dashboard

agentos server start                 # FastAPI on :6333
agentos console start                # Next.js dashboard on :3000

The console makes the learning loop visible: an Experiences browser, a Retrieval Explorer with per‑signal score breakdowns, a Learning view (best practices + failure patterns), and interactive 3D Vector Space and Knowledge Graph visualizations.

CLI

agentos init
agentos models pull llama3.1:8b
agentos config set-llm --provider ollama --model llama3.1:8b
agentos retrieve "deploy shopify app"
agentos plan "deploy shopify app"
agentos server start
agentos console start

Architecture

Six engines behind a small, tier‑agnostic core:

Engine Role
Memory persist experiences across vector / metadata / graph / KV / blob
Retrieval return the most useful experiences (blended ranking, not cosine alone)
Reflection turn one execution → an experience (LLM, schema‑constrained)
Learning many experiences → best practices, failure patterns, workflows
Planning recommend an approach using experiences + best practices + failures
Org Intelligence scope + share across Org → Project → Agent

Everything sits behind pluggable interfaces:

Reflection & Learning run asynchronously on a durable in‑process JobQueue.

See docs/ for the full project, technical, SDK, backend, and deployment docs.

Tests

Deterministic unit tests (storage, ranking, tenancy, queue, config) run without any LLM:

pip install -e ".[dev]"
pytest
ruff check .

Contributing

Contributions are welcome! Please read CONTRIBUTING.md and our CODE_OF_CONDUCT.md. Security issues: see SECURITY.md.

License & Open‑core

AgentOS is open source under Apache‑2.0. The embedded SDK, the intelligence verbs, framework adapters, the CLI, the self‑hosted server, and the dashboard are all free and open.

A commercial Enterprise tier (SSO/RBAC, audit, managed cloud, priority support) is available for teams that need it — see ENTERPRISE.md and the OSS‑vs‑Enterprise matrix in docs/10-open-core.md.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentos_memory-0.1.0.tar.gz (108.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentos_memory-0.1.0-py3-none-any.whl (130.4 kB view details)

Uploaded Python 3

File details

Details for the file agentos_memory-0.1.0.tar.gz.

File metadata

  • Download URL: agentos_memory-0.1.0.tar.gz
  • Upload date:
  • Size: 108.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for agentos_memory-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ceb3db3aec29e9860581fceb572b9555b723bcfbbd88b960fd8e1f0bed887086
MD5 58fed26ff65d174914e2876755cacb4b
BLAKE2b-256 c5ddca43e38af5431bc21c01f2c01554105f88045abed970ebc271c6a626ea6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentos_memory-0.1.0.tar.gz:

Publisher: publish.yml on nivera-ai/AgentOS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentos_memory-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: agentos_memory-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 130.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for agentos_memory-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0f3e9daff5c60628334b1a7f6d79458290390380af73ea3179179401785ce28
MD5 331e015e43f348b58f7236fc34d78274
BLAKE2b-256 8f078f01871ac2b31df07cdda625b79290307610f9321b6eb2bc9f16e9d657b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentos_memory-0.1.0-py3-none-any.whl:

Publisher: publish.yml on nivera-ai/AgentOS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page