Skip to main content

Agentify

Production-ready AI agent library built on the OpenAI SDK

Build and orchestrate AI agents—from simple assistants to complex multi-agent systems. Agentify targets the OpenAI-compatible Chat Completions interface, enabling seamless switching between providers (OpenAI, Azure, DeepSeek, Gemini, Anthropic, Llama, Local LLMs) without code changes. It also includes experimental native Codex support through ChatGPT OAuth.


Why Agentify?

Feature Benefit
Production-first Clear abstractions, explicit config, robust error handling
Multi-provider Switch providers with one line—no agent code changes
Orchestration primitives Uniform run()/arun() across agents, teams, pipelines, hierarchies
Async-native Non-blocking I/O, parallel tool execution, event-loop friendly
Pluggable memory In-memory, SQLite, Redis, Elasticsearch—same API
Local LLMs Support for LM Studio, Ollama and custom local servers
Codex provider Native Codex threads with Agentify memory, tools via runtime MCP, image input, structured output and streaming events

Key Features

  • Single agents & multi-agent patterns
    Agents with tools and memory • Supervisor–worker Teams • Sequential Pipelines • Hierarchical delegation • Dynamic routing

  • Memory system
    Pluggable backends with policies (TTL, message limits, pruning) • Memory isolation per conversation • Async-safe operations

  • Reasoning models
    Configurable thinking depth (reasoning_effort) • Chain-of-thought storage • Real-time reasoning logs

  • Tools
    @tool decorator with automatic JSON Schema • Type-annotated interface • Argument validation

  • Async & parallel execution
    Native arun() for async apps • run() bridge for sync apps • Parallel tool calls

  • Observability
    Callback hooks for logging, monitoring, debugging

  • Multimodal
    Vision/image support • Streaming responses


Installation

pip install agentify-core

Optional backends:

pip install agentify-core[redis]      # Redis memory store
pip install agentify-core[elastic]    # Elasticsearch store
pip install agentify-core[codex]      # Native Codex provider
pip install agentify-core[all]        # All optional dependencies

Quick Start

The Agent helper gets you running in one call — only model is required, and an in-memory store and conversation address are created automatically:

from agentify import Agent, tool

@tool
def get_time() -> dict:
    """Returns the current time."""
    from datetime import datetime
    return {"time": datetime.now().strftime("%H:%M:%S")}

agent = Agent(
    "You are a helpful assistant.",
    model="gpt-5.5",          # provider defaults to "openai"
    tools=[get_time],
)

print(agent.run("What time is it?"))

# Async usage is also available:
# print(await agent.arun("What time is it?"))

Agent is a thin subclass of BaseAgent; extra keyword arguments (reasoning_effort, model_kwargs, temperature, stream, provider, ...) are forwarded to the config.

Full control with BaseAgent

For custom stores, shared memory services, or multi-tenant routing:

from agentify import BaseAgent, AgentConfig, MemoryService, MemoryAddress, InMemoryStore

memory = MemoryService(store=InMemoryStore())
addr = MemoryAddress(conversation_id="session_1")

agent = BaseAgent(
    config=AgentConfig(
        name="Assistant",
        system_prompt="You are a helpful assistant.",
        provider="openai",
        model_name="gpt-5.5",
        reasoning_effort="high",  # optional: "low", "medium", "high"
        model_kwargs={"max_completion_tokens": 5000},
    ),
    memory=memory,
    memory_address=addr,
    tools=[get_time],
)

print(agent.run("What time is it?"))

Native Codex Provider

Codex support is experimental and uses ChatGPT OAuth through the Codex CLI:

pip install agentify-core[codex]
codex login
codex login status

codex login opens the Codex CLI authentication flow. Choose ChatGPT login when you want to use the Codex models available to your ChatGPT account. If the login is successful, codex login status should report that you are logged in. Model availability and quota depend on your Codex CLI version and ChatGPT account.

Then use the same Agentify API:

agent = BaseAgent(
    config=AgentConfig(
        name="CodexAgent",
        system_prompt="You are a helpful assistant.",
        provider="codex",
        model_name="gpt-5.5",
    ),
    memory=memory,
    memory_address=addr,
    tools=[get_time],
)

response = agent.run("Use the tool and answer concisely.")

Agentify keeps memory as the source of truth and sends the current conversation state to Codex. Normal tools=[...] are exposed to Codex through an internal runtime MCP bridge, so users do not need to manually wrap tools for common use.

Supported Codex features include:

  • Agentify-managed memory with SQLite, in-memory, Redis or Elasticsearch stores.
  • Native Codex thread memory with client_config_override={"memory_mode": "codex_thread"} — recommended for interactive multi-turn assistants (~1.5–1.7x faster per turn), with optional thread_map_path to persist sessions across restarts. The system prompt is passed as thread-level instructions every turn (instructions_mode: "developer" default, or "base"), so the persona survives context compaction.
  • Runtime MCP tools with logs and persisted tool-call history, isolated per session.
  • Typed, actionable errors (OAuth/login missing, CLI not found, model unsupported, usage limit) that stop useless retries.
  • stream=True using Codex turn events.
  • image_path=... multimodal input when supported by the installed Codex SDK.
  • Structured output with model_kwargs={"output_schema": ...} or OpenAI-style response_format.

For long-running apps, call agent.close() or await agent.aclose() to release provider resources.


Memory Backends

from agentify.memory.stores import InMemoryStore
from agentify.memory.stores.sqlite_store import SQLiteStore
from agentify.memory.stores.redis_store import RedisStore

# In-memory (default, for development)
store = InMemoryStore()

# SQLite (persistent, zero-config)
store = SQLiteStore(db_path="./agent.db")

# Redis (production, distributed)
store = RedisStore(url="redis://localhost:6379/0")

Composable Flows

All primitives share the same run()/arun() interface:

  • BaseAgent — Single agent with tools
  • Team — Supervisor routes to worker agents
  • SequentialPipeline — Output flows step-to-step
  • HierarchicalTeam — Tree structures for delegation

Nest freely: Teams of Pipelines, Pipelines of Teams, dynamic routing at runtime.



License

MIT License

Author

Fabian Melchor — fabianmp_98@hotmail.com

Metadata

Release files for agentify-core 0.6.3

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

Source distribution (sdist)

Source distribution for agentify-core 0.6.3
File Size Uploaded
agentify_core-0.6.3.tar.gz 94.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agentify-core 0.6.3
File Interpreter ABI Platform
agentify_core-0.6.3-py3-none-any.whl Python 3 none any Details

Total release size: 180.9 kB

Release files / agentify_core-0.6.3.tar.gz

Download URL agentify_core-0.6.3.tar.gz
Size 94.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d607f4d854864689787f926f070a9255a9314d827d257bcd0a6b87badc73bfa3
BLAKE2b-256 checksum
How to use checksums
f602e8f55561715a090e5a47c03c19f53b0e486f54beac4a3eba964c1563df13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / agentify_core-0.6.3-py3-none-any.whl

Download URL agentify_core-0.6.3-py3-none-any.whl
Size 86.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95db6d48990513a686b752a45ec3001c6bbed8edd10369c05c0c13a232d4345a
BLAKE2b-256 checksum
How to use checksums
8d652d25f353988908e7b70ea63f2e8c717ed3587c2e675fa1bad9004eccf06e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.6.3 This release

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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