AI Execution Layer SDK (contracts + registry + decorators)
Project description
aiel-sdk
AI Execution Layer SDK: local contracts + decorators + registry for code that runs server-side.
This package is intentionally lightweight. It provides importable symbols, typing, and a stable contract surface that mirrors the server runtime. Your local code can type-check, lint, and run basic smoke tests without depending on the full server implementation.
Install
pip install aiel-sdk
Quickstart
Use the aiel.* namespace for explicit library-style imports:
from aiel.langgraph.graph import StateGraph, MessagesState, START, END
from aiel.llangchain.agents import create_agent
g = StateGraph(MessagesState).add_node("x", lambda s: s).add_edge(START, END)
app = g.compile()
print("OK", app.invoke({"messages": []}), create_agent)
You can also import everything from the SDK surface directly:
from aiel_sdk.sdk import (
StateGraph, MessagesState, START, END, InMemorySaver,
tools_condition, ToolNode,
ChatPromptTemplate, PromptTemplate, Runnable, RunnableConfig,
tool, agent, flow, flow_graph, http, mcp_server
)
Core Concepts
Contract-first SDK
This SDK mirrors the server runtime contracts. Most symbols are shims or stubs and do not execute real server logic locally. They exist so your code can:
- import familiar library surfaces
- type-check and validate signatures
- build graphs and registry entries that the server can later execute
Registry + decorators (travel agency example)
Use decorators to register tools, agents, flows, flow graphs, and HTTP handlers. The registry is in-memory and used as the local source of truth before deployment.
from aiel_sdk.sdk import tool, agent, flow, flow_graph, http, mcp_server
from aiel.langgraph.graph import StateGraph, MessagesState, START, END, tools_condition
from aiel.langchain import ChatPromptTemplate, RunnableConfig
# Tool: discrete action callable by an agent or graph.
@tool("search_flights")
def search_flights(ctx, payload):
origin = payload.get("origin")
destination = payload.get("destination")
return {"options": [{"flight": "AE101", "from": origin, "to": destination}]}
# Tool: another discrete action.
@tool("quote_hotel")
def quote_hotel(ctx, payload):
city = payload.get("city")
return {"hotel": "Skyline Inn", "nightly_usd": 180, "city": city}
# Agent: orchestration entry point.
@agent("travel_agent")
def travel_agent(ctx, input):
prompt = ChatPromptTemplate.from_messages([
{"role": "system", "content": "You are a travel agent."},
{"role": "user", "content": input.get("request", "")},
])
_ = prompt.format_messages()
return {"intent": "plan_trip", "request": input}
# Flow: simple function flow.
@flow("daily_deals")
def daily_deals(ctx, input):
flights = search_flights(ctx, input)
hotels = quote_hotel(ctx, {"city": input.get("destination")})
return {"flights": flights, "hotels": hotels}
# Flow graph: build a LangGraph-style state graph.
def build_trip_planner():
g = StateGraph(MessagesState)
g.add_node("agent", lambda s: s).add_edge(START, "agent").add_edge("agent", END)
g.add_conditional_edges("agent", tools_condition, path_map={"continue": END})
return g
flow_graph("trip_planner", build_trip_planner)
# HTTP handler: exposes a REST entry point (server-side at runtime).
@http.post("/travel/quote")
def travel_quote(ctx, body: dict):
return daily_deals(ctx, body)
# MCP server: register tools exposed via MCP.
mcp = mcp_server("travel_agency")
@mcp.tool("search_flights")
def mcp_search_flights(ctx, origin: str, destination: str):
return {"options": [{"flight": "AE202", "from": origin, "to": destination}]}
@mcp.tool("quote_hotel")
def mcp_quote_hotel(ctx, city: str):
return {"hotel": "Harbor View", "nightly_usd": 210, "city": city}
# RunnableConfig is accepted by contract shims for IDE and typing support.
_config = RunnableConfig(trace_id="req-123")
LangGraph contract surface
The aiel.langgraph.graph module mirrors core LangGraph symbols used for building
state graphs. Execution is local only for simple checks; the real runtime happens
server-side.
from aiel.langgraph.graph import StateGraph, MessagesState, START, END, tools_condition
g = StateGraph(MessagesState)
g.add_node("x", lambda s: s)
g.add_edge(START, END)
app = g.compile()
print(tools_condition({}), app.invoke({"messages": []}))
LangChain contract surface
The aiel.langchain and aiel.llangchain modules expose minimal prompt and runnable
shims plus placeholder agent helpers.
from aiel.langchain import ChatPromptTemplate, PromptTemplate, RunnableConfig
prompt = ChatPromptTemplate.from_messages([])
print(prompt.format_messages(), RunnableConfig(trace_id="abc"))
Import map
aiel.langgraph.graphmirrorslanggraph.graphsurface.aiel.langchainmirrors a minimallangchainprompt/runnable surface.aiel.llangchain.agentsmirrors agent factory helpers (contract stub).aiel_sdk.sdkexposes the full SDK surface in one import.
Explicit import mapping (LangGraph / LangChain Core / Community)
The SDK provides an explicit surface for the essential imports used in the LangGraph customer-support tutorial. Use these as drop-in local contracts:
# LangGraph
from aiel.langgraph.graph import END, StateGraph, START, InMemorySaver, ToolNode, tools_condition
# LangChain Core (contract shims provided by this SDK)
from aiel.langchain import ChatPromptTemplate, Runnable, RunnableConfig
# LangChain Core messages + runnables
from aiel.langchain_core.messages import ToolMessage
from aiel.langchain_core.runnables import RunnableLambda
# LangGraph message helpers
from aiel.langgraph.graph.message import AnyMessage, add_messages
# LangGraph checkpointer
from aiel.langgraph.checkpoint.memory import InMemorySaver
# LangChain Community tools (planned shim)
# from aiel.langchain_community.tools.tavily_search import TavilySearchResults
Planned mirrors for the tutorial (not yet implemented in this repo):
aiel.langchain_community.tools.tavily_search.TavilySearchResults
Project layout
src/aiel_sdk/sdk/*core decorators, registry, HTTP/MCP, and shim surfaces.src/aiel/*explicitaiel.*namespace mirror for library-style imports.src/aiel_sdk/examples/*small smoke examples.
What runs locally vs server-side
Local:
- decorators and registry updates
- basic graph wiring
- type-checking and IDE support
Server-side (not implemented in this repo):
- actual agent/tool execution
- graph runtime
- HTTP/MCP serving
Status
Backend integration: not implemented yet (planned per sprint output)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aiel_sdk-1.0.6.tar.gz.
File metadata
- Download URL: aiel_sdk-1.0.6.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7f4924666d6faa28becee814b4a461cc970babe0741adf2c432d458e02d950c
|
|
| MD5 |
676ea890d4d5f5dac4049a2242d5aedf
|
|
| BLAKE2b-256 |
e773817c9fa3841ef0ed1f6f8836bfef5d639f8b04f8b5b787681b1369594c65
|
Provenance
The following attestation bundles were made for aiel_sdk-1.0.6.tar.gz:
Publisher:
publish.yml on aldenirsrv/AI_EXECUTION_LAYER_SDK
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiel_sdk-1.0.6.tar.gz -
Subject digest:
f7f4924666d6faa28becee814b4a461cc970babe0741adf2c432d458e02d950c - Sigstore transparency entry: 805123602
- Sigstore integration time:
-
Permalink:
aldenirsrv/AI_EXECUTION_LAYER_SDK@aa160f17330190c9fbc5f61c554d10ae60d7349c -
Branch / Tag:
refs/tags/v1.0.6 - Owner: https://github.com/aldenirsrv
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@aa160f17330190c9fbc5f61c554d10ae60d7349c -
Trigger Event:
push
-
Statement type:
File details
Details for the file aiel_sdk-1.0.6-py3-none-any.whl.
File metadata
- Download URL: aiel_sdk-1.0.6-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
458a07e37840ade67736bfdc920802fe079aa772bfbef212d4ccafce624552ca
|
|
| MD5 |
a5c08b78d036270714493c5a6b726869
|
|
| BLAKE2b-256 |
0ecd3f349c6f028abec614cb37c2fd7dd367c27f0de1bbaf4bc5b078f20f4d42
|
Provenance
The following attestation bundles were made for aiel_sdk-1.0.6-py3-none-any.whl:
Publisher:
publish.yml on aldenirsrv/AI_EXECUTION_LAYER_SDK
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiel_sdk-1.0.6-py3-none-any.whl -
Subject digest:
458a07e37840ade67736bfdc920802fe079aa772bfbef212d4ccafce624552ca - Sigstore transparency entry: 805123604
- Sigstore integration time:
-
Permalink:
aldenirsrv/AI_EXECUTION_LAYER_SDK@aa160f17330190c9fbc5f61c554d10ae60d7349c -
Branch / Tag:
refs/tags/v1.0.6 - Owner: https://github.com/aldenirsrv
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@aa160f17330190c9fbc5f61c554d10ae60d7349c -
Trigger Event:
push
-
Statement type: