NavaiaForge Python SDK
Official Python client for the NavaiaForge AI workforce platform — a typed, real-time client for building multi-agent AI workforces that work like teams.
Use it standalone (scripts, services, CI, notebooks) or alongside the NavaiaForge dashboard. Both speak to the same backend, so anything created in code shows up in the UI and vice versa.
Why a workforce, not just an agent?
A single LLM call solves a single prompt; real work rarely is. NavaiaForge models work the way teams do:
- Many specialized agents with their own roles, instructions, and models — not one generalist.
- Edges route work between them (reviewer → tester → deployer).
- Shared knowledge bases ground every agent in the same facts via RAG.
- Shared tools (HTTP, MCP, code executors, plugins) give the team hands.
- One coordinator — submit a task to the workforce, not to a specific agent.
The SDK exposes every primitive directly.
⚠️ Run the backend first
This SDK is a client. It needs a NavaiaForge backend to talk to. There's no hosted service yet — today the only way to get a backend is to run it yourself with Docker. That sounds like a chore; it's actually the point:
- Your data stays on your infrastructure — prompts, agent outputs, KBs, conversations.
- No per-token markup, no rate limits — you pay your LLM provider directly.
- Air-gapped friendly — works offline, on-prem, in regulated environments.
- No vendor lock-in — the image and database are yours.
Your options: run it on your laptop (dev / learning), on your own VM or cluster (production), or air-gapped on-prem (compliance). Same image, same SDK code, just a different base_url.
curl -fLO https://raw.githubusercontent.com/NavaiaSolutions/navaia-forge-sdk/main/docker-compose.dist.yml
# create .env with your secrets (see .env.example), then:
docker compose -f docker-compose.dist.yml up -d
# → API at http://localhost:8001
Always point base_url at your local backend (e.g. http://localhost:8001). Full walkthrough: SETUP.md.
Installation
pip install navaia-forge
Quickstart
from navaia_forge import NavaiaForgeClient
# Point at the backend you started with `docker compose up`.
client = NavaiaForgeClient(base_url="http://localhost:8001", api_key="nf_...")
# Build the team
wf = client.workforces.create(name="Code Review Team")
reviewer = client.agents.create(workforce_id=wf.id, name="Reviewer", role="review",
instructions="Review PRs for correctness and security.",
model_provider="anthropic", model_name="sonnet")
tester = client.agents.create(workforce_id=wf.id, name="Tester", role="qa",
instructions="Generate and run tests for approved diffs.",
model_provider="anthropic", model_name="sonnet")
# Wire reviewer → tester
client.workforces.edges.create(workforce_id=wf.id,
source_agent_id=reviewer.id,
target_agent_id=tester.id)
# Hand work to the team
task = client.tasks.create(workforce_id=wf.id, title="Review PR #482 and add tests")
final = client.tasks.wait_for_completion(task.id)
print(final.status, final.result)
All resource methods return typed Pydantic v2 models. Errors raise navaia_forge.NavaiaForgeError (or a subclass: NotFoundError, RateLimitError, ValidationError, AuthenticationError, PermissionError, ServerError, TaskNotRetryable, TimeoutError).
Retrying a failed task
client.tasks.retry(task_id) resets a failed or cancelled task back to pending and resets its retry_count to 0 (a manual retry restores the automatic-retry budget). Only those two states are retryable — retrying a running or already-completed task raises TaskNotRetryable:
from navaia_forge import TaskNotRetryable
try:
task = client.tasks.retry(task.id) # -> status="pending", retry_count reset to 0
except TaskNotRetryable:
... # still running or already succeeded — nothing to retry
Requires a backend that exposes
POST /tasks/{id}/retry(see the backend version note in the local-stack setup).
Real-time events
from navaia_forge import NavaiaForgeWs, HttpConfig
ws = NavaiaForgeWs(HttpConfig(base_url="http://localhost:8001", api_key="nf_..."))
ws.on("task:status", lambda e: print("task:", e["task_id"], e["status"]))
ws.on("agent:status", lambda e: print("agent:", e["agent_id"], e["status"]))
ws.on("chat:message", lambda e: print(e["role"], e["content"]))
ws.connect()
ws.run_forever()
Channels: task:status, agent:status, chat:message, system:*.
What you can do
| Namespace | What it does | Why you'd use it |
|---|---|---|
client.workforces |
CRUD; manage edges; link tools / knowledge bases | Define the team and how work flows through it |
client.agents |
CRUD; list_featured, clone, export; attach/detach to workforces |
Compose specialists with their own models and instructions |
client.tasks |
create, approve, reject, retry, logs, wait_for_completion |
Hand work to the team, sync or async |
client.pipelines |
list, get, create, update, delete, run, list_runs, report_run |
Define and trigger reusable multi-step workflows |
client.conversations |
Open chats, send messages targeted at agents | Build chat UIs / interactive assistants |
client.knowledge |
Knowledge bases, document upload, semantic search, featured, download |
Ground agents in your data via RAG |
client.templates |
Workforce templates + templates.agents for agent templates |
Don't rebuild the same team twice |
client.marketplace |
list, get, install |
Browse and install published workforces |
client.tools |
Full CRUD, list_featured, attach/detach to workforces |
Give the team hands (HTTP, MCP, code-exec, custom) |
client.integrations |
list, list_plugins, CRUD |
Connect Slack / GitHub / Linear / other plugins |
client.setup |
options, validate, complete |
First-run onboarding / provider configuration |
client.observability |
summary, cost, agent_metrics, agent_evaluations, log_token_usage |
See what the team is doing and what it costs |
client.auth |
me, register, login, refresh, create_key, validate, OAuth URL helpers |
Build your own UI on top of NavaiaForge |
client.sync |
export_bundle, import_bundle, push, pull (+ export_to_file / import_from_file) |
Two-way local ↔ cloud workforce sync |
LangGraph integration
Already have a LangGraph workforce? Run it inside Forge with one wrapper — keep your graph code, gain Forge observability and backend access.
pip install "navaia-forge[langgraph]"
from langchain_core.runnables import RunnableConfig
from navaia_forge import NavaiaForgeClient
from navaia_forge.integrations.langgraph import LangGraphWorkforce, get_forge_context
# Annotate `config` as RunnableConfig — modern LangGraph only injects
# the config dict into nodes that explicitly opt in via this type hint.
def search_node(state: dict, config: RunnableConfig) -> dict:
forge = get_forge_context(config)
hits = forge.client.knowledge.search(forge.workforce_id, state["query"])
return {"hits": [h.model_dump() for h in hits.results]}
# Wrap a compiled graph; the wrapper installs the Forge callback and
# injects `ForgeContext` on `RunnableConfig.configurable` for you.
wf = LangGraphWorkforce(
graph=my_compiled_graph,
client=NavaiaForgeClient(base_url="http://localhost:8001", api_key="nf_..."),
workforce_id="wf_existing",
)
result = wf.run({"query": "..."}, task_id="task_123")
Token usage from every LLM call lands on the workforce's cost dashboard. See examples/python/langgraph_workforce.py for a full end-to-end run.
Standalone or with the UI
- Standalone: the SDK is sufficient on its own — no dashboard required. Drive everything from Python: scripts, services, Airflow / Prefect tasks, Jupyter, custom CLIs, internal tools.
- Alongside the dashboard: anything you create programmatically appears in the NavaiaForge UI immediately, and anything created in the UI is reachable from
client.*. Two views over one backend.
Development
python3.12 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest --cov=navaia_forge
ruff check navaia_forge tests
License
Apache-2.0
Metadata
Release files for navaia-forge 0.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| navaia_forge-0.2.6.tar.gz | 52.6 kB | Without provenance | Details for navaia_forge-0.2.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| navaia_forge-0.2.6-py3-none-any.whl | Python 3 | none | any | Details for navaia_forge-0.2.6-py3-none-any.whl |
Total release size: 103.6 kB
Security for navaia-forge 0.2.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.