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
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
Release history Release notifications | RSS feed
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.21.tar.gz
(69.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nfactorial-0.1.21.tar.gz.
File metadata
- Download URL: nfactorial-0.1.21.tar.gz
- Upload date:
- Size: 69.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a6b4899313dab18e1e6772e60b4339c959bc66479bdf9af5512411c4abb0642
|
|
| MD5 |
19db255b431af552997cb01f924aa2d6
|
|
| BLAKE2b-256 |
4f63c894f9fe8858dddfc132bd56f96bd39adfb5a29c48a3f98c2ad8de777d1e
|
File details
Details for the file nfactorial-0.1.21-py3-none-any.whl.
File metadata
- Download URL: nfactorial-0.1.21-py3-none-any.whl
- Upload date:
- Size: 81.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8357b49aca66a34d3bad93624150962e86274e1d1bf8d0f881be8ef31f233715
|
|
| MD5 |
ef2035ae1ef07ac1438387e1c3ac1ca0
|
|
| BLAKE2b-256 |
2d753ac329e3c704b4dc5c86aa8b68fd5a2837c9c92816b5a999a4039a0bb0af
|