A declarative framework for building AI agents
Project description
Astrolab
A declarative framework for building AI agents with a focus on simplicity and extensibility.
Features
- Declarative Agent Definitions: Define agents using YAML for easy configuration
- Plugin System: Extend functionality with custom plugins
- OpenAI Integration: Built-in support for OpenAI models
- CLI Tool: Command-line interface for managing agents
- Easy Deployment: Simple deployment options for your agents
Installation
Using uv (recommended):
uv pip install astrolab
Using pip:
pip install astrolab
From source:
git clone https://github.com/yourusername/astrolab.git
cd astrolab
make setup
Quick Start
Create an Agent
Create a YAML file my_agent.yaml:
name: "My First Agent"
description: "A simple agent that responds to user queries"
model: "gpt-4o"
instructions: |
You are a helpful assistant that provides concise and accurate information.
Always be polite and professional in your responses.
functions:
- name: get_weather
description: "Get the current weather for a location"
parameters:
- name: location
type: string
description: "The city and state, e.g. San Francisco, CA"
required: true
Run the Agent
astrolab run my_agent.yaml
Create a Plugin
astrolab create-plugin my_plugin
This will create a plugin template in astrolab/plugins/my_plugin/.
Agent Configuration
Agents are defined using YAML files with the following structure:
name: "Agent Name"
description: "Agent description"
model: "gpt-4o" # OpenAI model to use
instructions: "System instructions for the agent"
functions:
- name: function_name
description: "Function description"
parameters:
- name: param_name
type: string # string, number, boolean, array, object
description: "Parameter description"
required: true # or false
Plugin Development
Plugins allow you to extend Astrolab with custom functionality. A plugin consists of:
- A plugin definition file
- One or more function implementations
Example plugin structure:
astrolab/plugins/my_plugin/
├── __init__.py
└── plugin.py
Example plugin implementation:
from astrolab.core.plugin import Plugin
class MyPlugin(Plugin):
name = "my_plugin"
version = "0.1.0"
def get_functions(self):
return [self.my_function]
def my_function(self, param1: str) -> str:
"""
My custom function
Args:
param1: A parameter
Returns:
A result string
"""
return f"Processed: {param1}"
CLI Commands
astrolab run <agent_file>: Run an agent from a YAML fileastrolab create-agent: Interactive agent creation wizardastrolab list-plugins: List available pluginsastrolab create-plugin <name>: Create a new plugin template
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file astrolab-0.1.0.tar.gz.
File metadata
- Download URL: astrolab-0.1.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
492cd3d8dc424781c308bf25e7dd262cc35c4c4c631c6f8abbed79171ee48764
|
|
| MD5 |
014199debe9f51a0e5949b50015c79c6
|
|
| BLAKE2b-256 |
dd51e0fc2ca702c53d8bc9176eca0bb25ddca0bb8b8a0b0d12f458875cbaa752
|
File details
Details for the file astrolab-0.1.0-py3-none-any.whl.
File metadata
- Download URL: astrolab-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
babb49ada4fea5253b22d1ee5c625cd0de5f75bac9e9c220182f6a771a1dfb5b
|
|
| MD5 |
c0f97a02540c459243e8605c8a7c3c30
|
|
| BLAKE2b-256 |
c55fff89906ee2bd2c10294d1308e9424a58a21c107d8cf646402c48ff897142
|