This guide walks you through installing Blueprint Agents, scaffolding your first project, and running a development server.
- Python 3.13+ -- Verify with
python --version - pip or uv -- Either package manager works; examples below show both
pip install avs-blueprint-agentsOr with uv:
uv add avs-blueprint-agentsFor pre-release versions, configure a supplemental index in your pyproject.toml:
[[tool.uv.index]]
name = "test-pypi"
url = "https://test.pypi.org/simple/"
priority = "supplemental"Then install as usual:
uv add avs-blueprint-agentsuv will fall back to the TestPyPI index when a version is not found on the primary index.
git clone https://github.com/your-org/AVS.AI.Blueprint.AgenticService.git
cd AVS.AI.Blueprint.AgenticService
pip install -e ".[dev]"This installs the package in editable mode with development dependencies (testing, linting, type checking).
asbs --versionUse the asbs CLI to scaffold a new agent project:
asbs setup my-first-agentThis generates the following project structure:
my-first-agent/
├── src/
│ ├── __init__.py
│ ├── main.py # AppBuilder wiring
│ ├── handlers/ # Event handlers
│ ├── services/ # Business logic
│ ├── api/ # REST endpoints
│ ├── models/ # Pydantic models
│ └── prompts/ # LLM prompt files
├── tests/
├── settings.toml # Configuration
├── secrets.toml # Secrets (gitignored)
├── pyproject.toml
└── Dockerfile
| Directory / File | Purpose |
|---|---|
src/main.py |
Entry point. Assembles all components using the AppBuilder fluent API. |
src/handlers/ |
Event handler classes that process incoming messages and events. |
src/services/ |
Service classes containing your core business logic. |
src/api/ |
REST API endpoint classes exposed via FastAPI. |
src/models/ |
Pydantic models for request/response schemas and domain objects. |
src/prompts/ |
Prompt template files used by LLM-powered agents. |
settings.toml |
Application configuration managed by Dynaconf. |
secrets.toml |
Sensitive values (API keys, connection strings). Gitignored by default. |
Start the development server with:
asbs devThis will:
- Load configuration from
settings.tomlandsecrets.toml - Register all handlers, services, and API endpoints
- Start the FastAPI server with hot-reload enabled
Once running, open your browser to view the interactive API documentation:
http://localhost:8000/docs
The asbs create command generates boilerplate for new components:
# Create a new event handler
asbs create handler
# Create a new service
asbs create service
# Create a new REST API endpoint
asbs create api
# Create a new scheduler
asbs create schedulerEach command scaffolds a new file in the appropriate directory with the correct base class, imports, and method stubs.
The main.py file is where you wire all components together using the AppBuilder fluent API. Here is a typical example:
from blueprint.agents import AppBuilder, AgentBuilder, AgentRuntime, Config
from blueprint.agents.handler.event_handler_base import EventHandlerBase
from blueprint.agents.services.service_base import ServiceBase
from blueprint.agents.io.api.rest_api_base import RestApiBase
from blueprint.agents.io.api.scheduling.scheduler import SchedulerBase
from src.handlers.my_handler import MyHandler
from src.services.my_service import MyService
from src.api.my_api import MyApi
app = (
AppBuilder()
.with_config(Config())
.with_handler(MyHandler)
.with_service(MyService)
.with_api(MyApi)
.with_agent(
AgentBuilder()
.with_name("my-agent")
.with_prompt_file("src/prompts/system.md")
.build()
)
.build()
)AppBuilderis the central assembly point. It uses a fluent (method-chaining) API to register each component.Configloads values fromsettings.tomlandsecrets.tomlvia Dynaconf. Environment variables can override any setting.- Handlers (
EventHandlerBasesubclasses) process incoming events from message queues or other sources. - Services (
ServiceBasesubclasses) encapsulate reusable business logic and are injected into handlers and APIs. - APIs (
RestApiBasesubclasses) define REST endpoints that are automatically mounted on the FastAPI server. - Agents are configured with
AgentBuilder, which accepts a name, prompt files, and other LLM-specific settings. AgentRuntimemanages the lifecycle of all registered components at runtime.
Blueprint Agents uses Dynaconf for configuration. The two primary files are:
settings.toml -- General application configuration:
[default]
app_name = "my-first-agent"
log_level = "INFO"
server_port = 8000secrets.toml -- Sensitive values (API keys, credentials):
[default]
openai_api_key = "sk-..."
database_url = "postgresql://..."Environment variables override file-based settings. For example, DYNACONF_SERVER_PORT=9000 overrides the server_port value.
Now that your project is running, explore the component guides to build out your agent:
- Event Handlers -- Process events and route messages
- Services -- Write business logic with dependency injection
- REST APIs -- Expose HTTP endpoints
- Agents -- Configure LLM-powered agents
- Schedulers -- Automate recurring tasks
- CLI Reference -- Full
asbscommand reference - Configuration -- Deep dive into Dynaconf settings
- Testing -- Write tests for your components