What are Naptha Modules?
Naptha Modules are the building blocks of Naptha multi-agent applications, which enable them to run across multiple nodes. There are currently six types of modules:
- Agent modules
- Agent orchestrator modules
- Tool modules
- Persona modules
- Knowledge Base modules
- Environment modules
Modules are stored on GitHub, HuggingFace, IPFS, or DockerHub with the URL registered on the Naptha Hub.
As shown in the diagram above, modules can be:
- Deployed across different nodes
- Combined on single nodes for efficiency
- Scaled horizontally as needed
Running a Module
You can run modules locally, or deploy to a Naptha Node using naptha run
commands from the Naptha SDK. Modules are executed within Poetry virtual environments or Docker containers on Naptha Nodes.
Structure of a Module
If you're familiar with Kubeflow Pipelines, modules are a bit like Components. Modules are based on Poetry Python packages, with some additions like schemas, configs, and an entrypoint. A typical module has the following structure:
my_module/
├── my_module/
│ ├── __init__.py
│ ├── configs/
│ │ ├── agent_deployments.json
│ │ ├── deployment.json
│ │ ├── kb_deployments.json
│ │ ├── llm_configs.json
│ │ └── tool_deployments.json
│ ├── run.py
│ └── schemas.py
├── tests/
│ └── __init__.py
├── pyproject.toml
├── poetry.lock
├── README.md
├── LICENSE
├── .env
├── .gitignore
└── Dockerfile
You can make changes to the configs in the configs
folder. The deployment.json
file is the main config file for the module. You may also have other config files for subdeployments such as agent_deployments.json
, tool_deployments.json
, kb_deployments.json
, memory_deployments.json
, and environment_deployments.json
.
The Naptha Module template provides the basic structure for creating new:
- Agent modules
- Agent orchestrator modules
- Tool modules
- Knowledge Base modules
- Persona modules
- Environment modules
Explore Examples
You can also browse our GitHub repositories for real-world examples e.g. The simple chat agent module for running simple chat with LLMs.
Discover Available Modules
To see a full list of modules currently registered on the Naptha Hub, install the Naptha SDK and use these CLI commands:
naptha agents # explore available agent modules
naptha tools # explore available tool modules
naptha orchestrators # explore available orchestrator modules
naptha kbs # explore available knowledge base modules
#naptha memories # explore available memory modules
naptha personas # explore available personas to use with your agents
naptha environments # explore available environment modules