A distributed task queue for building reliable multi-agent systems.
Project description
nFactorial
Build distributed agents that spawn more distributed sub-agents.
nFactorial 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()
Usage Examples:
IDE Coding Agent
/docs/examples/code_agent
Multi-Agent
/docs/examples/multi_agent
Deliberations.ai
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
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.27.tar.gz.
File metadata
- Download URL: nfactorial-0.1.27.tar.gz
- Upload date:
- Size: 72.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be69e8a662e8a1770ed98dc1f6bbfbd558c8554a9c636f1ab6a358656bbe2dac
|
|
| MD5 |
d956c1cce742192fbe25760b0fe4a0e2
|
|
| BLAKE2b-256 |
0d43f8c22ab035381a35845b48a256fddb914d881e056055807453618381dedf
|
File details
Details for the file nfactorial-0.1.27-py3-none-any.whl.
File metadata
- Download URL: nfactorial-0.1.27-py3-none-any.whl
- Upload date:
- Size: 83.7 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 |
98a1600685007f8f697d29da8cc43ffebe2adb4aef1d23d73e6e2dabb9b4e03a
|
|
| MD5 |
2864835d4c78da8eb06d6d8ecf79b7f1
|
|
| BLAKE2b-256 |
262e7e74352bf0de358834f747a3ac8a81b03f4c158dffa6e46a37c915484291
|