Skip to main content

agentic

The agent/knowledge/orchestration/workflow engine that powers the Powabase stack — a well-documented Python library you can also import on its own.

Features

  • Agent: Single LLM-powered agent with a clean run() interface
  • Session Management: Built-in conversation history tracking
  • Multi-Model Support: Uses litellm for 100+ LLM providers
  • Type-Safe: Full type hints and dataclass-based outputs
  • Orchestration: Multi-agent coordination (sequential, supervisor, router, parallel)
  • Workflow: Multi-step pipelines with conditional logic, loops, and a sandboxed code-execution block

Installation

Published on PyPI as powabase-agentic; the import module is agentic (same split as scikit-learn → import sklearn).

# Using pip
pip install powabase-agentic

# Using uv
uv add powabase-agentic

# From source
git clone https://github.com/powabase-ai/agentic.git
cd agentic
pip install -e .

Optional extras: pip install "powabase-agentic[rerankers]" adds local cross-encoder reranking models.

Quick Start

from agentic import Agent

# Create an agent
agent = Agent(
    model="gpt-4o-mini",
    system_prompt="You are a helpful assistant.",
)

# Run the agent
output = agent.run("What is 2+2?")
print(output.content)  # "2 + 2 equals 4."

# Check execution details
print(output.status)  # ExecutionStatus.COMPLETED
print(output.usage)   # {"prompt_tokens": 15, "completion_tokens": 8, ...}

Multi-Turn Conversations

Use AgentSession to maintain conversation history:

from agentic import Agent, AgentSession

agent = Agent(
    model="gpt-4o-mini",
    system_prompt="You are a helpful assistant.",
)

# Create a session
session = AgentSession()

# First turn
output1 = agent.run("My name is Alice", session=session)
session.add_output(output1)

# Second turn - agent remembers the name
output2 = agent.run("What's my name?", session=session)
session.add_output(output2)
print(output2.content)  # "Your name is Alice."

# Get conversation history
messages = session.get_messages()

Async Support

import asyncio
from agentic import Agent

async def main():
    agent = Agent(model="gpt-4o-mini", system_prompt="You are helpful.")
    output = await agent.arun("Hello!")
    print(output.content)

asyncio.run(main())

Model Selection

agentic uses litellm under the hood, supporting 100+ LLM providers:

# OpenAI
agent = Agent(model="gpt-4o")

# Anthropic
agent = Agent(model="claude-3-opus-20240229")

# Azure OpenAI
agent = Agent(model="azure/my-deployment")

# Local models (Ollama)
agent = Agent(model="ollama/llama2")

Set up API keys via environment variables:

export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."

Core Concepts

Agent

An Agent wraps an LLM with a system prompt. It provides a simple run() method that handles message formatting, LLM calls, and response parsing.

AgentOutput

The result of agent.run(). Contains:

  • content: The LLM's response text
  • status: Execution status (COMPLETED, FAILED, etc.)
  • messages: All messages exchanged
  • usage: Token usage statistics
  • Timing information (started_at, completed_at)

AgentSession

Container for conversation history. Pass a session to run() to include previous messages in the context.

ExecutionContext

Runtime context carrying execution_id, session_id, and custom metadata. Created automatically or can be provided explicitly.

See docs/CONCEPTS.md for detailed documentation.

Project Structure

agentic/src/agentic/
├── agent/           # Agent implementation
│   ├── agent.py     # Agent class
│   ├── output.py    # AgentOutput dataclass
│   └── session.py   # AgentSession for history
├── orchestration/   # Multi-agent coordination (sequential, supervisor, router, parallel)
├── workflow/        # Pipeline execution (blocks, conditions, sandboxed functions)
└── execution/       # Shared infrastructure
    ├── context.py   # ExecutionContext
    ├── status.py    # ExecutionStatus enum
    └── base.py      # BaseOutput class

Development

# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Type checking
mypy src/agentic

License

Apache-2.0 — see LICENSE.

Contributing

Contributions are welcome! Please read our contributing guidelines and submit a pull request.

Metadata

Release files for powabase-agentic 0.5.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 powabase-agentic 0.5.0
File Size Uploaded
powabase_agentic-0.5.0.tar.gz 545.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for powabase-agentic 0.5.0
File Interpreter ABI Platform
powabase_agentic-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 818.5 kB

Release files / powabase_agentic-0.5.0.tar.gz

Download URL powabase_agentic-0.5.0.tar.gz
Size 545.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0cd88423356488c0fb59eb21e42d4a3be5086f8376e2553b853558969cda98cf
BLAKE2b-256 checksum
How to use checksums
100d04f91d7d4e2ab8a12e6a9bd57861586057f685cb614704716292d04b61f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release files / powabase_agentic-0.5.0-py3-none-any.whl

Download URL powabase_agentic-0.5.0-py3-none-any.whl
Size 273.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b091f5938c09a2646221779cbe95ae62faf044202d875f79c42cb96fee1fa391
BLAKE2b-256 checksum
How to use checksums
d4c3fce2e471fb8e54f5fe5b4133d5c8a765394389987a0c9c84894725b2b4c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log
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