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.16.tar.gz (69.0 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.16-py3-none-any.whl (80.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nfactorial-0.1.16.tar.gz
  • Upload date:
  • Size: 69.0 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.16.tar.gz
Algorithm Hash digest
SHA256 dcceba77f40901ea6153baa5e54493e17a9009f4229ac453829a3460aa70a69c
MD5 e864b47bb1bf9ef474fe50855651311d
BLAKE2b-256 253a6742ed1ae277d71e46544c9a7abf9d26b1d9dc313a7f6b67b7b8c92021e9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nfactorial-0.1.16-py3-none-any.whl
  • Upload date:
  • Size: 80.7 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.16-py3-none-any.whl
Algorithm Hash digest
SHA256 a8af5529c1cefca9e757ef2f84fa57568aa9c38aacf3425901b64d57b6fcd53f
MD5 ef82df26e5e2ea2763c4911e92ad7df1
BLAKE2b-256 84f6641e7012cae0a67fe81435952c1dfa2a7090edb23542681f0af4db059a5f

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