Skip to main content

Netweb Enterprise Agent Engineering Framework

Project description

Netweb SDK

Netweb SDK is an enterprise-grade agent engineering framework for building, orchestrating, and deploying AI assistants with custom tools and multiple LLM providers.

Key capabilities:

  • Custom tool integration with the @nw_tool decorator
  • Composable agents via create_agent
  • Deterministic, structured tool invocation (JSON/structured calls)
  • Multiple built-in provider adapters (OpenAI, Anthropic, Google, open-source)
  • Pluggable memory stores (ConversationMemory, VectorMemory, PersistentMemory)
  • Tracing integration (LangSmith-compatible) via enable_tracing

Why use Netweb SDK

Netweb SDK is intended for production AI applications that require:

  • Reliable tool invocation from generated outputs
  • Reusable agent components and configurable system prompts
  • Provider-agnostic integrations for deploying across clouds and local runtimes

Installation

Install from PyPI:

pip install netweb-sdk

Or install from source:

pip install .

Quick Start

The SDK exports common helpers from sdk (see sdk/__init__.py): create_agent, get_tool, get_tools, list_tools, nw_tool, provider classes, memory helpers, and tracing utilities.

  1. Define a custom tool with @nw_tool:
from sdk import nw_tool

@nw_tool("add", description="Add two integers together")
def add(a: int, b: int) -> int:
    return a + b
  1. Create an agent. Note: current create_agent signature accepts name, role, llm, tools, memory (bool or instance), input_schema, output_schema, prompt_path, system_prompt, retries, and retry_delay.
from sdk import create_agent, OpenAIProvider

llm = OpenAIProvider(model="gpt-4o-mini")

agent = create_agent(
    name="calculator_agent",
    role="calculator",
    llm=llm,
    tools=[add],
    system_prompt="You are a precise calculator. Use the add tool for addition operations.",
    memory=True,
)
  1. Run the agent (sync or streamed):
resp = await agent.nw_run("Add 5 and 3 together")
print(resp.output)

# Streamed
async for chunk in agent.nw_run_streamed("Tell me a short joke"):
    print(chunk, end="", flush=True)

Providers

The SDK includes adapters for multiple LLM providers. Examples exported from sdk:

  • OpenAIProvider
  • AnthropicProvider
  • GoogleProvider
  • OpenSourceProvider (HuggingFace, Ollama, local runtimes)

Provider classes wrap the API surface for sync/async generation and streaming and are pluggable when creating agents.

Memory

Memory implementations available in the SDK:

  • ConversationMemory: in-memory conversation history
  • VectorMemory: vector-store backed memory for retrieval-augmented generation
  • PersistentMemory: durable stores (e.g., redis/postgres checkpointers supported in runtime)

Pass memory=True to create_agent to enable default conversation memory (a ConversationMemory instance).

Tools API

Tool utilities exported from sdk:

  • nw_tool: decorator for registering tools
  • get_tools(names: list[str]): fetch tool instances by name
  • get_tool(name: str): fetch a single tool
  • list_tools(): list available tool metadata

Tools are executed by the agent via ToolRunner and are registered in the ToolRegistry on agent creation.

Tracing

Enable LangSmith-compatible tracing using:

from sdk.tracing import enable_tracing
enable_tracing(project_name="my_project")

Tracing hooks into execution to capture runs, tool calls, and metadata.

Prompts and Templates

Prompts are managed via abstractions.agents.prompts with utilities for loading prompt files, templating, and prompt composition. You can pass prompt_path to create_agent to use a custom prompt file, or provide system_prompt directly.

Testing & Development

  • Unit tests use pytest and pytest-asyncio (see tests/).
  • During development, run the test suite:
py -m pytest -q

Extending the SDK

  • Add new provider adapters under abstractions/providers/llm.
  • Add tools under abstractions/tools/builtins/ or register dynamic tools with @nw_tool.
  • Implement new memory backends under abstractions/memory.

Contributing

Contributions are welcome. Please open issues or PRs, follow the repository style, and add tests for new functionality.

License

See LICENSE in the repository root for license details.


If you want, I can also generate a short examples/ README and add runnable example scripts for: basic agent, memory demo, and tools demo. Want me to add those now?

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

netweb_sdk-0.1.2.tar.gz (51.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netweb_sdk-0.1.2-py3-none-any.whl (83.0 kB view details)

Uploaded Python 3

File details

Details for the file netweb_sdk-0.1.2.tar.gz.

File metadata

  • Download URL: netweb_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 51.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for netweb_sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3ee1af14b55c47215f2909dcef8fad5c520986b3e62f1634287e861fd56de07d
MD5 91e8d844774f00442f458ccd7fed5b99
BLAKE2b-256 9d5afc43393d6679de975b0f6dda34da1b995e5f104e00df569ce39ff5e26667

See more details on using hashes here.

File details

Details for the file netweb_sdk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: netweb_sdk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 83.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for netweb_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c59810c288db881f3afbd80cc7ca4243ba6038027cb88a3e93b2539f382ff72e
MD5 e100144693caabe283c1f82c326b1106
BLAKE2b-256 61e597a215dab706a40aabb26729487fdf3e493452c423d066f6dd0c84c74d48

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