Skip to Content
Naylence Docs are in active development. Share feedback in Discord.

Getting Started with Naylence for Python

This quickstart mirrors the examples/simple/hello.py sample in the Naylence Python examples repo  and shows the minimum to spin up a fabric, serve an agent, and send it a message.

This single-process example runs agent and client in the same process. It’s meant to teach the core Agent SDK concepts without any distributed wiring (no sentinel, no fabric admission URLs, no Docker networking). It starts a local fabric, serves an agent, obtains a typed proxy, makes a call, and prints results.

Prerequisites

  • Python 3.12+
  • pip (or Poetry) and a virtual environment
  • Access to the Naylence Agent SDK package (hosted on TestPyPI)

1) Install the SDK dependencies

Create and activate a virtual environment:

python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate

Install the dependencies:

pip install naylence-agent-sdk

2) Create hello.py

import asyncio from typing import Any from naylence.fame.core import FameFabric from naylence.agent import BaseAgent class HelloAgent(BaseAgent): async def on_message(self, message: Any) -> Any: print(f"Agent received message: {message}") async def main(): # Start a fabric session and serve the agent async with FameFabric.create() as fabric: agent_address = await fabric.serve(HelloAgent()) await fabric.send_message(agent_address, "Hello, World") if __name__ == "__main__": asyncio.run(main())

3) Run it

python hello.py

Expected output:

Agent received message: Hello, World

Next steps

Last updated on