Skip to main content

agentics-you — Python SDK

The Python SDK for Agentics: shared memory for AI agents, with a receipt for every write. The same package carries the receipt helpers, the gateway client and the agentics CLI.

Install

Not yet published. agentics-you is not on PyPI, so these installs fail. Install from a checkout of this repo with pip install ./sdks/python. To call the memory API today without it, use the REST API or the hosted MCP server at https://agentics.you/mcp.

pip install agentics-you
pip install "agentics-you[openai]"    # + OpenAI Agents SDK trace processor (agentics_you.openai_agents)
pip install "agentics-you[litellm]"   # + LiteLLM callback (agentics_you.litellm_callback)

The import name is agentics_you. agentics on PyPI belongs to another publisher.

Quickstart

from agentics_you import AgenticsClient
client = AgenticsClient()  # AGENTICS_API_KEY=ak_...
client.memories.add("Dana prefers aisle seats.", wait=True)
hits = client.memories.search("Which seat does Dana want?")["hits"]

Memory in more detail

Create an org API key (ak_...) in the console under API Keys.

export AGENTICS_API_KEY=ak_...
export AGENTICS_AGENT=...   # optional: agent identity token, so writes are attributed to that agent
from agentics_you import AgenticsClient

client = AgenticsClient()

# Write. The API queues an ingest job; wait=True returns once the memory is indexed.
r = client.memories.add("Dana prefers aisle seats on flights over two hours.",
                        metadata={"topic": "travel"}, wait=True)

# Recall. Each hit carries score, why and receipt_hash.
hits = client.memories.search("Which seat does Dana want?", k=5)["hits"]

client.memories.get(r["memory_id"])
client.memories.list(limit=20)
client.memories.delete(r["memory_id"])
Resource Methods Route
client.memories add, search, list, get, delete, export /v1/memories, /v1/memories/search, /v1/memories/export
client.namespaces list, create, get, rename, delete /v1/namespaces
client.ingest get, list, retry, wait /v1/ingest, /v1/ingest/{job_id}

AsyncAgenticsClient has the same methods as coroutines. Errors are typed by status: ValidationError (400/413/422), AuthenticationError (401), PermissionDeniedError (403), NotFoundError (404), ConflictError (409), RateLimitError (429), ServerError (5xx), all subclasses of AgenticsError with code, status and details. Network errors, timeouts, 429, 502, 503 and 504 are retried with backoff (max_retries, default 2), honouring Retry-After. AGENTICS_BASE_URL points the client at another deployment. Stdlib only, Python 3.9+.

Receipts (decorator)

from agentics_you import Network

net = Network(api_key="ak_...")

@net.task(
    agent_id="support-bot",
    foundation_model="anthropic/claude-opus-4-6",
    scope=["read:tickets", "write:reply"],
)
def handle_ticket(ticket_id: str) -> str:
    # your agent logic
    return "Thanks for reaching out!"

reply = handle_ticket("abc-123")
# A receipt was recorded.

Receipts (context manager)

from agentics_you import Agentics

agentics = Agentics(api_key="ak_...")

with agentics.track(
    agent_id="support-bot",
    foundation_model="anthropic/claude-opus-4-6",
    model_version="2026-04-22",
    scope=["read:tickets", "write:reply"],
) as task:
    reply = run_my_agent(...)
    task.set_outputs(reply)
    task.set_outcome("success")

Gateway — drop-in OpenAI-compatible client

Change one base_url and keep your existing OpenAI/Anthropic SDK. Every call is routed, budgeted, guardrailed, and lands a cryptographically verifiable receipt on the trust-ledger — written server-side by Proof Mesh (the SDK never hashes, signs, or sets billable).

from openai import OpenAI                  # your existing SDK, unchanged
from agentics_you import createHeaders

client = OpenAI(
    base_url="https://agentics.you/api/v1",   # the only change
    api_key="ak_...",                              # your Agentics gateway key
    default_headers=createHeaders(user="alice@acme.com",
                                  metadata={"cost_center": "support"}),
)
resp = client.chat.completions.create(
    model="@anthropic/claude-opus-4-8",
    messages=[{"role": "user", "content": "hi"}],
)

Or use the self-contained client (stdlib only, no openai needed):

from agentics_you import AgenticsGateway

gw = AgenticsGateway(base_url="https://agentics.you/api/v1", api_key="ak_...")
resp = gw.with_options(user="alice@acme.com").chat.completions.create(
    model="@anthropic/claude-opus-4-8",
    messages=[{"role": "user", "content": "hi"}],
)

# Auto-instrument CrewAI / LangGraph, or attach LangChain/LlamaIndex handlers:
from agentics_you import LangchainCallbackHandler
chain.invoke(x, config={"callbacks": [LangchainCallbackHandler(user="alice@acme.com")]})

# Browse the Model Garden catalog:
gw.list_models(provider="anthropic")

createHeaders() emits the frozen x-agentics-{trace-id,span-id,user,meta,debug} header set; these become the parent receipt's identity fields, so per-user attribution and provable savings start at your call site. Full quickstart: https://agentics.you/docs/sdk/python.html.

Authentication

The SDK looks for an API key in this order:

  1. api_key= constructor argument
  2. AGENTICS_API_KEY environment variable
  3. ~/.agentics/credentials (set by agentics login --api-key ak_...)

Issue API keys from the dashboard at https://agentics.you/dashboard/api-keys.

CLI

# Save credentials
agentics login --api-key ak_...

# Register / update an agent from a manifest
cat > agentics.json <<EOF
{
  "display_name": "Support Bot",
  "handle": "support-bot",
  "foundation_model": "anthropic/claude-opus-4-6",
  "scope_array": ["read:tickets", "write:reply"],
  "description": "Handles tier-1 support tickets"
}
EOF
agentics deploy

# Or override fields inline
agentics deploy --name "Support Bot" --model anthropic/claude-opus-4-6 \\
                --scope "read:tickets,write:reply"

# Inspect your account
agentics whoami
agentics agents

# Gateway devex verbs
agentics gateway test --url https://agentics.you/api/v1 --user alice@acme.com
agentics config validate gateway-config.json
agentics config publish  gateway-config.json --name default
agentics prompt push     support-greeting.json
agentics log tail --limit 5            # gateway receipts with their trace_id
agentics proof verify    <receipt_hash>  # 4-step end-to-end verify
agentics proof bundle    <receipt_hash>  # offline-verifiable evidence bundle
agentics models --provider anthropic

Publishing (for maintainers)

Published from sdks/python/ to PyPI as agentics-you by .github/workflows/pypi-publish.yml, with PyPI Trusted Publishing (OIDC, no token on this repo):

# Bump version in pyproject.toml and agentics_you/version.py, then tag sdk-py-v<semver>.
git tag sdk-py-v1.2.0
git push origin sdk-py-v1.2.0

The action runs the unit tests, writes the tag's version into both version files, builds the sdist and wheel, runs twine check, and publishes. One-time: add this repo as a trusted publisher for agentics-you at https://pypi.org/manage/account/publishing/ (workflow pypi-publish.yml, environment pypi).

Apache-2.0

Metadata

Release files for agentics-you 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agentics-you 1.2.0
File Size Uploaded Provenance Actions
agentics_you-1.2.0.tar.gz 32.1 kB Without provenance Details for agentics_you-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agentics-you 1.2.0
File Interpreter ABI Platform Actions
agentics_you-1.2.0-py3-none-any.whl Python 3 none any Details for agentics_you-1.2.0-py3-none-any.whl

Total release size: 65.8 kB

Release files / agentics_you-1.2.0.tar.gz

Download URL agentics_you-1.2.0.tar.gz
Size 32.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fb4b739826a73541f72a01f32118b33addc514bbd4cab73d459fa57752256752
BLAKE2b-256 checksum
How to use checksums
3799721cfd55cafde556d6b75cb072988e539c30585c10aaaebf60ab19631464
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Release files / agentics_you-1.2.0-py3-none-any.whl

Download URL agentics_you-1.2.0-py3-none-any.whl
Size 33.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d5411ef7cfa45d7fb1569dff4a97dfb80780ba6507b9981bc772d7a4a251477a
BLAKE2b-256 checksum
How to use checksums
5968d7e58a8cf01d3ea5de2fdaa673d55c91001edb09e6c3e26f91b758789dab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Security for agentics-you 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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