Python SDK
Use Algenta from Python — install algenta-sdk, authenticate, and call the engine with a typed client. Includes runnable examples.
This page is the reference for the live Python package Algenta ships today: algenta-sdk (imported as decision_engine), a thin typed HTTP client for the Algenta API. Use it for direct, typed access to hosted or self-hosted Algenta.
Install
Install the published HTTP client from PyPI.
# Typed HTTP client. Imported as `decision_engine`.
pip install algenta-sdkThe package requires Python 3.12 or newer. Pull-request CI builds the wheel and verifies a fresh install of it on Python 3.12, 3.13 and 3.14. It depends on httpx>=0.28 and pydantic>=2.7.
Authentication and configuration
The client reads its API key, in order, from the api_key= argument, then ALGENTA_API_KEY, then the legacy DE_API_KEY. If none are set, the constructor raises ValueError.
The constructor accepts four arguments.
api_key
str | None
None
Falls back to ALGENTA_API_KEY, then DE_API_KEY.
base_url
str | None
https://api.algenta.ai
Point at your self-hosted engine, e.g. http://localhost:8000.
timeout
float
120.0
Request timeout in seconds.
max_retries
int
3
Retries on 429 and 5xx.
Advanced: contract constants
The package re-exports the platform contract so you can read endpoint paths and defaults without hard-coding them.
Datasets and the data contract
list_datasets
page
int
1
1-based page index.
limit
int
200
Page size.
search
str | None
None
Free-text match over dataset names.
status
str | None
None
Filter by ingestion status.
source_name
str | None
None
Filter by source.
compact
bool
False
Drop heavy fields for a lighter list.
get_dataset_summary
get_contract
get_contract() returns the live platform contract. If the deployment predates the /v1/meta/contract endpoint, the client falls back to deriving the contract from the OpenAPI document.
Querying data
The query surface targets the /v1/query family. Requests are plain dicts; you can also pass keyword arguments, which are merged into the request body.
query_with_metadata
Returns the query result plus execution metadata (request id, timing) and the raw response headers.
query_batch
Send several queries in one round trip to /v1/query/batch.
query_sql_report
Run a structured SQL-style report against /v1/query/sql-report.
Typed query filters
QueryFilterSpec and QueryFilterCondition are exported for building filters with types rather than raw dicts.
Decisions and simulation
These methods target the decision and simulation endpoints. simulate and recommend take keyword arguments; plan_decision takes a request dict.
verify (POST /v1/verify) and explain (which runs a query and annotates it) complete the decision surface:
Capability plane
The capability plane lets an agent discover, route, and execute capabilities (tools, skills, MCP-backed providers).
Capability plane method reference
list_capability_providers()
GET /v1/capability-providers
list of CapabilityProviderResult
get_capability(capability_id, include_instruction=False)
GET /v1/capabilities/{id}
CapabilityCatalogEntryResult
list_capabilities(kinds=, provider_ids=, binding_ids=)
GET /v1/capabilities
catalog list
route_capabilities(request)
POST /v1/capabilities/route
CapabilityRoutePlanResult
execute_capability(request)
POST /v1/capabilities/execute
CapabilityExecutionResult
list_skills()
GET /v1/capabilities?kinds=skill
skill catalog
list_mcp_providers()
filtered providers
MCP providers
Agent runs
Create a run, then poll its state and event log.
create_agent_run posts to /v1/agent/runs. get_agent_run reads /v1/agent/runs/{run_id}; get_agent_run_events reads /v1/agent/runs/{run_id}/events. For a live feed, stream_agent_run_events(run_id) returns an iterator over server-sent events.
Repository intelligence
The repository methods take a repository_id and a request dict. triage_repository and apply_repository map to the same endpoints the agent uses internally.
Async client
Every method above has an async equivalent on AsyncAlgentaClient. The async client is an async context manager and exposes the same surface, split across the async_client_* modules internally.
Errors
The client raises typed exceptions, all subclasses of DecisionEngineError.
Related pages
Authentication & API keysCLI referenceSelf-hostingAPI endpoint referenceLast updated
Was this helpful?