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.15.tar.gz (68.7 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.15-py3-none-any.whl (80.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nfactorial-0.1.15.tar.gz
  • Upload date:
  • Size: 68.7 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.15.tar.gz
Algorithm Hash digest
SHA256 29dc7cc71cdccd5ea90d1bf59cbe4247d16240403d3e68f334d6dc764fee1641
MD5 20be8f30e566da3b64911835eda96a1a
BLAKE2b-256 05066beec4c58c2bbac8865d0fe84b4c732dfc00daf6923e817cbe19bfd44592

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nfactorial-0.1.15-py3-none-any.whl
  • Upload date:
  • Size: 80.6 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.15-py3-none-any.whl
Algorithm Hash digest
SHA256 d0861fd0ac0d8c2ccefd79864b3a9d0ef9099051a019f06f4a8da5c5e070dd20
MD5 491c7763cf67b34c06b3456cdffbc991
BLAKE2b-256 0ce1093c9079a5c0af6c3befd608408a2a6462421c60f84f59b3b088eec27e5a

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