Skip to main content

A Python framework for building AI agents with advanced orchestration capabilities

Project description

nFactorial

Factorial is a Python framework for reliably running high-concurrency agents asynchronously. It's designed for production workloads where you need to process thousands of agent tasks concurrently with built-in retries, monitoring, and distributed execution.

Dashboard

Features

  • Distributed execution: Run agents across multiple workers and machines with Redis-based coordination
  • Fault tolerance: Automatic retries, backoff strategies, and recovery of dropped tasks from crashed workers
  • Real-time events: Stream progress updates and results via WebSocket or Redis pub/sub
  • In-flight agent task management: Cancel, steer, and monitor running tasks
  • Observability: Built-in metrics dashboard and comprehensive logging
  • Deferred tools: Support for long-running operations that complete outside the agent execution

Installation

pip install nfactorial

Quick Start

from factorial import Agent, Orchestrator, AgentWorkerConfig, gpt_41


def get_weather(location: str) -> str:
    return f"The weather in {location} is sunny and 72°F"


agent = Agent(
    instructions="You help users get weather information.",
    model=gpt_41,
    tools=[get_weather],
)

# Create orchestrator
orchestrator = Orchestrator(
    redis_host="localhost",
    redis_port=6379,
    redis_db=0,
    redis_max_connections=50,
)
orchestrator.register_runner(
    agent=agent, agent_worker_config=AgentWorkerConfig(workers=1)
)

# Run the system
if __name__ == "__main__":
    orchestrator.run()

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

nfactorial-0.1.5.tar.gz (44.3 kB view details)

Uploaded Source

Built Distribution

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

nfactorial-0.1.5-py3-none-any.whl (50.3 kB view details)

Uploaded Python 3

File details

Details for the file nfactorial-0.1.5.tar.gz.

File metadata

  • Download URL: nfactorial-0.1.5.tar.gz
  • Upload date:
  • Size: 44.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for nfactorial-0.1.5.tar.gz
Algorithm Hash digest
SHA256 0e801381976d44ec0e2b5a74d061f33906c45f52a4a1376122ad0606f33857d8
MD5 c5937ba08e64aeb97857dec967ac9b08
BLAKE2b-256 ead2d9f05582f30f78f3ffb8aad008999d719b168b48f9fe8e9e612c1523648c

See more details on using hashes here.

File details

Details for the file nfactorial-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: nfactorial-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 50.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for nfactorial-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 355b7555d04325af6d7d7c2d70c15be0b15c84c2a39a90cfa362cf0c0a4d9b59
MD5 1ed42a0f9ce87b5bad3cbfaa74ba0b64
BLAKE2b-256 c454963d06a286721489b3477502cb2aa332792e79cd8e27cb66291e136c68b5

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