Skip to main content

Python SDK for agenttool.dev — memory and tools for AI agents

Project description

agenttool-sdk · Python

Persistent memory, reasoning traces, fact verification, tool access, and agent-to-agent payments — one API key.

PyPI Python License: MIT API Status

pip install agenttool-sdk

What is this?

AgentTool gives AI agents the infrastructure they need to operate reliably:

Service What it does
agent-memory Persistent semantic memory — store facts, retrieve by similarity
agent-tools Web search, page scraping, sandboxed code execution
agent-verify Fact-check claims with AI-powered evidence gathering
agent-economy Wallets, spending policies, escrow, agent-to-agent payments
agent-trace Reasoning provenance — log and search decision traces

All five services, one API key, one SDK.

Quick start (60 seconds)

1. Get your API key — create a free project at app.agenttool.dev

2. Set your key:

export AT_API_KEY=at_your_key_here

3. Store and retrieve a memory:

from agenttool import AgentTool

at = AgentTool()  # reads AT_API_KEY from env

# Store a memory
memory = at.memory.store(
    content="The user prefers dark mode and concise responses",
    agent_id="my-assistant",
    tags=["preference", "ui"]
)

# Retrieve it later (semantic search)
results = at.memory.search("what does the user prefer?", limit=5)
for r in results:
    print(f"{r.score:.2f}  {r.content}")

Usage

Memory

at = AgentTool(api_key="at_...")  # or use AT_API_KEY env var

# Store
mem = at.memory.store("User is based in London, timezone Europe/London")

# Semantic search
results = at.memory.search("where is the user?", limit=5)
for r in results:
    print(f"{r.score:.2f}  {r.content}")

# Retrieve by ID
mem = at.memory.get(memory_id="mem_abc123")

# Usage stats
stats = at.memory.usage()
print(stats.memories_stored, stats.searches_performed)

Tools

# Web search
results = at.tools.search("latest papers on RAG", num_results=5)
for r in results:
    print(r.title, r.url, r.snippet)

# Scrape a page
page = at.tools.scrape("https://example.com")
print(page.content)   # HTML/text content
print(page.status_code)

# Execute code (sandboxed — Python, JavaScript, Bash)
result = at.tools.execute("import math; print(math.pi)", language="python")
print(result.output)      # stdout
print(result.error)       # stderr
print(result.exit_code)   # 0 = success

Verify

# Fact-check a claim with AI-powered evidence gathering
result = at.verify.check("The Eiffel Tower is 330 metres tall.")
print(result.verdict)      # "verified" | "false" | "disputed" | "unverifiable"
print(result.confidence)   # 0.0 – 1.0
print(result.caveats)      # list of nuances

# With domain hint for better evidence
result = at.verify.check(
    "Bitcoin was created in 2009.",
    domain="finance",           # "finance" | "science" | "medical" | "legal" | "general"
    context="On the Bitcoin whitepaper date"
)
print(result.is_verified)  # True / False

# Batch verify (up to 10 claims in parallel)
results = at.verify.batch([
    {"claim": "Water boils at 100°C at sea level."},
    {"claim": "The moon is made of cheese.", "domain": "science"},
])
for r in results:
    print(r.verdict, r.confidence)

Economy (wallets & escrows)

# Create a wallet for an agent
wallet = at.economy.create_wallet("agent-wallet", agent_id="agent-42")

# Fund it from your project's credit balance
at.economy.fund_wallet(wallet.id, amount=500, description="Weekly budget")

# Spend credits (subject to spending policy)
at.economy.spend(
    wallet.id,
    amount=10,
    counterparty="wal_target_id",
    description="Payment for research task"
)

# Set a spending policy (keep agents within bounds)
at.economy.set_policy(wallet.id,
    max_per_transaction=50,
    max_per_hour=200,
    max_per_day=1000,
)

# Escrow: lock credits until work is done
escrow = at.economy.create_escrow(
    creator_wallet_id=wallet.id,
    amount=100,
    description="Summarise 50 research papers",
    deadline="2026-03-14T12:00:00Z",
)
# Worker accepts:
at.economy.accept_escrow(escrow.id, worker_wallet_id="wal_worker")
# Release on completion:
at.economy.release_escrow(escrow.id)

Traces (reasoning provenance)

# Store a reasoning trace
trace = at.traces.store(
    observations=[
        "User asked about climate solutions",
        "Searched web: found 3 relevant papers",
        "Papers focus on renewable energy + carbon capture",
    ],
    conclusion="Renewable energy is the most actionable near-term solution",
    decision_type="decision",       # decision | tool_call | plan | verification | other
    confidence=0.87,
    tags=["climate", "research"],
    agent_id="research-agent",
)
print(trace.trace_id)  # "tr_a1b2c3d4e5f6"

# Retrieve by trace_id
trace = at.traces.get(trace.trace_id)

# Semantic search across traces
results = at.traces.search("decisions about climate data", limit=5)

# Get a chain of reasoning steps
chain = at.traces.chain(trace.trace_id)

# Delete
at.traces.delete(trace.trace_id)

Integration example — LangChain

from langchain.tools import tool
from agenttool import AgentTool

at = AgentTool()

@tool
def remember(content: str) -> str:
    """Store a memory for later retrieval."""
    mem = at.memory.store(content, agent_id="langchain-agent")
    return f"Stored memory {mem.id}"

@tool
def recall(query: str) -> str:
    """Search past memories by semantic similarity."""
    results = at.memory.search(query, limit=3)
    return "\n".join(r.content for r in results)

@tool
def fact_check(claim: str) -> str:
    """Verify whether a factual claim is true."""
    result = at.verify.check(claim)
    return f"{result.verdict} (confidence: {result.confidence:.0%})"

Integration example — agent loop with memory

from agenttool import AgentTool

at = AgentTool()

def agent_loop(user_message: str) -> str:
    # Recall relevant memories
    memories = at.memory.search(user_message, limit=5)
    context = "\n".join(m.content for m in memories)

    # Call your LLM with context
    response = your_llm(f"Context:\n{context}\n\nUser: {user_message}")

    # Store the exchange
    at.memory.store(f"User: {user_message}\nAgent: {response}")

    return response

Free tier

Resource Free Seed ($29/mo) Grow ($99/mo)
Memory ops/day 100 10,000 100,000
Tool calls/day 10 500 5,000
Verifications/day 5 100 1,000
Traces/day 100 10,000 100,000

Upgrade at app.agenttool.dev/billing

Configuration

from agenttool import AgentTool

at = AgentTool(
    api_key="at_...",          # default: AT_API_KEY env var
    base_url="https://api.agenttool.dev",  # default
    timeout=30.0,              # seconds
)

Links

License

MIT

Project details


Download files

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

Source Distribution

agenttool_sdk-0.3.0.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

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

agenttool_sdk-0.3.0-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file agenttool_sdk-0.3.0.tar.gz.

File metadata

  • Download URL: agenttool_sdk-0.3.0.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for agenttool_sdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b31bb7f02f8f9e6670b84c1180621d5fceed1b708eca8818bd2e3687578cec19
MD5 34640a779d3a3fc76aad29551a0581f2
BLAKE2b-256 b28f27421d556d3a9f2506054fdee585d2c38921fb0c871a84f36c9136c8aa35

See more details on using hashes here.

File details

Details for the file agenttool_sdk-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: agenttool_sdk-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 20.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for agenttool_sdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad18a010c55c0deee38aa18aace090eac9c7c04fe71511159f18774c56aacbc4
MD5 e59701c0df83bf4877bf39b4d25a4dff
BLAKE2b-256 8e9a9251f8631b90b345e2174f7c506efd3c985e80e555f3f16a57bb76045b12

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page