Skip to main content

A distributed task queue for building reliable multi-agent systems.

Project description

nFactorial

Factorial is a distributed task queue for building reliable multi-agent systems. It makes the following trivial to implement:

  • Agent Reliability: Automatic retries, backoff strategies, and recovery of dropped tasks from crashed workers.
  • In-flight Task Management: Cancel, steer, and monitor running tasks.
  • Spawning Sub Agents: Having an agent spawn multiple sub agents and wait for their completion before continuing.
  • Deferred Tools: Pause the agent while it waits for long running tools to complete externally or wait for user approval before continuing.
  • Observability: Built-in metrics dashboard and comprehensive logging

Dashboard

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.8.tar.gz (50.6 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.8-py3-none-any.whl (61.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nfactorial-0.1.8.tar.gz
  • Upload date:
  • Size: 50.6 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.8.tar.gz
Algorithm Hash digest
SHA256 62b3970b3929bd79f05dab73463984ad35abeb40f54b024c2769447827b9ee0d
MD5 a73a7ee9ac70e8654025485d7fa7e15a
BLAKE2b-256 5035782736b5e321a6a4d1f12a4b653dbbb4ac47d74e1f1f4b4fde5ed4464e46

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nfactorial-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 61.9 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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 47f0cfb74c26cd4b63f58036ef45f78cb89411eb15eafcd41c7a745b649c97d5
MD5 0a6f92c55c39ef1ac16d573ec564d43b
BLAKE2b-256 03a65e5306274eb6661e51ca13d2c716b1e5afd5e6d9763039b3778eedd7f5f8

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