CLI tool for managing AI agents in Genesis-Studio using Agent Specifications
Project description
Genesis Agent CLI
A powerful command-line interface for creating, managing, and deploying AI agents in Genesis Studio. This CLI enables you to define agents using YAML specifications and seamlessly integrate them with the Genesis platform.
Features
- Native Genesis Studio Integration: Create flows that work directly with Genesis Studio
- Enhanced Agent Specifications: Support for v2 agent format with comprehensive metadata
- Component Validation: Automatic validation against Genesis Studio's component registry
- Dynamic Component Mapping: Real-time mapping of Genesis types to Langflow components
- Healthcare Templates: Pre-built templates for healthcare workflows
- Multi-Agent Support: Create orchestrators that use other agents as tools
Installation
pip install -e .
Quick Start
- Check Genesis Studio configuration:
genesis-agent config-check
- Create an agent from a template:
genesis-agent create -t templates/healthcare/agents/medication-extractor.yaml
- List your agents:
genesis-agent list
Commands
Configuration
# Check current configuration and connection
genesis-agent config-check
# Show CLI version
genesis-agent version
Creating Agents
# Create a flow from template
genesis-agent create -t <template-path>
# Create with custom name
genesis-agent create -t template.yaml -n "My Custom Agent"
# Create in specific folder
genesis-agent create -t template.yaml -f <folder-id>
# Show agent metadata (goal, KPIs, etc.)
genesis-agent create -t template.yaml --show-metadata
# Create with runtime variables
genesis-agent create -t template.yaml --var key=value --var temperature=0.7
# Create with variables from file
genesis-agent create -t template.yaml --var-file variables.json
# Create with tweaks
genesis-agent create -t template.yaml --tweak component-id.field=value
# Save flow to file instead of creating in Genesis Studio
genesis-agent create -t template.yaml -o flow.json
# Validate only (don't create)
genesis-agent create -t template.yaml --validate-only
# Enable debug output
genesis-agent create -t template.yaml --debug
Managing Agents
# List all agents/flows in Genesis Studio
genesis-agent list
# List with different formats
genesis-agent list -f table # Default table format
genesis-agent list -f detailed # Detailed view
genesis-agent list -f json # JSON output
# Limit number of results
genesis-agent list -l 10
# Delete an agent/flow
genesis-agent delete <agent-id>
# Delete without confirmation prompt
genesis-agent delete <agent-id> -f
Dependency Checking
# Check dependencies for a specific template
genesis-agent check-deps <template-path>
# Check dependencies for all templates
genesis-agent check-deps --all
# Show all available agents in Genesis Studio
genesis-agent check-deps --show-available
Publishing Agents
# Publish an agent as a container image
genesis-agent publish <agent-id> -t myorg/agent:v1
# Publish and push to registry
genesis-agent publish <agent-id> -t myorg/agent:v1 --push
# Use custom base image
genesis-agent publish <agent-id> -t myorg/agent:v1 --base-image python:3.11
Template Format (v2 Enhanced)
The CLI uses an enhanced v2 specification format that includes comprehensive metadata for enterprise agent management.
Basic Structure
# Agent Metadata
id: "urn:agent:genesis:example:1"
name: "Example Agent"
fullyQualifiedName: "genesis.autonomize.ai.example"
description: "Agent description"
domain: "autonomize.ai"
subDomain: "examples"
version: "1.0.0"
environment: "production"
agentOwner: "team@example.com"
agentOwnerDisplayName: "Team Name"
email: "team@example.com"
status: "ACTIVE"
# Tags for categorization
tags:
- "example"
- "reusable"
- "healthcare"
# Agent Configuration
kind: "Single Agent" # Single Agent, Multi Agent, Orchestrator
agentGoal: "Clear description of what the agent accomplishes"
targetUser: "internal" # internal, external, both
valueGeneration: "ProcessAutomation" # ProcessAutomation, InsightGeneration, DecisionSupport, ContentCreation
interactionMode: "RequestResponse" # RequestResponse, MultiTurnConversation, Streaming, Batch
runMode: "RealTime" # RealTime, Scheduled, EventDriven
agencyLevel: "ModelDrivenWorkflow" # StaticWorkflow, ModelDrivenWorkflow, AdaptiveWorkflow, Autonomous
toolsUse: true
learningCapability: "None" # None, Contextual, Persistent, Continuous
# Components using the "provides" pattern
components:
- id: "input"
name: "User Input"
kind: "Data"
type: "genesis:chat_input"
description: "Receive user input"
provides:
- useAs: "input"
in: "main-agent"
description: "User query to agent"
- id: "main-agent"
name: "Main Agent"
kind: "Agent"
type: "genesis:agent" # Using default Agent component
description: "Process user requests"
config:
agent_llm: "OpenAI" # Built-in LLM provider
model_name: "gpt-4"
temperature: 0.7
system_prompt: |
You are a helpful assistant.
provides:
- useAs: "input"
in: "output"
description: "Agent response"
- id: "output"
name: "Response Output"
kind: "Data"
type: "genesis:chat_output"
description: "Display agent response"
Healthcare Agent Example
id: "urn:agent:genesis:medication_extractor:1"
name: "Medication Extractor"
fullyQualifiedName: "genesis.autonomize.ai.medication_extractor"
description: "Extracts medication information from clinical text"
kind: "Single Agent"
agentGoal: "Extract medications with dosages, frequencies, and routes from clinical text"
# Reusability configuration
reusability:
asTools: true
standalone: true
provides:
toolName: "MedicationExtractor"
toolDescription: "Extracts medications from clinical text"
inputSchema:
type: "object"
properties:
clinical_text:
type: "string"
outputSchema:
type: "object"
properties:
medications:
type: "array"
components:
- id: "agent-main"
type: "genesis:agent"
config:
agent_llm: "OpenAI"
model_name: "gpt-4"
system_prompt: |
Extract all medications with dosages...
Multi-Agent Orchestrator Example
kind: "Multi Agent"
agentGoal: "Coordinate multiple agents to process complex requests"
# Define dependencies on other agents
reusability:
dependencies:
- agentId: "urn:agent:genesis:document_processor:1"
version: ">=1.0.0"
- agentId: "urn:agent:genesis:medication_extractor:1"
version: ">=1.0.0"
components:
# Reference other agents as tools
- id: "doc-processor"
type: "$ref:document_processor"
asTools: true
provides:
- useAs: "tools"
in: "coordinator"
- id: "med-extractor"
type: "$ref:medication_extractor"
asTools: true
provides:
- useAs: "tools"
in: "coordinator"
Component Types
Core Components
genesis:agent- Default agent with built-in LLM configurationgenesis:chat_input- User input componentgenesis:chat_output- Response output componentgenesis:memory- Conversation memorygenesis:conversation_memory- Persistent conversation tracking
Healthcare Components
genesis:rxnorm- RxNorm medication extractiongenesis:icd10- ICD-10 diagnosis code validationgenesis:cpt_code- CPT procedure code validationgenesis:knowledge_hub_search- Search clinical documentsgenesis:encoder_pro- Medical coding servicegenesis:pa_lookup- Prior authorization lookupgenesis:qnext_auth_history- Claims and authorization history
Tool Components
genesis:calculator- Mathematical calculationsgenesis:api_component- Generic API integrationgenesis:file_reader- Read files from URLs or pathsgenesis:form_recognizer- OCR and document extraction
Runtime Variables and Tweaks
Runtime Variables
The Genesis Agent CLI supports runtime configuration variables that can be substituted in agent specifications at flow creation time. This feature allows for dynamic configuration without modifying the agent spec files.
Variable Types
- Runtime Variables: Defined using
{variable_name}syntax - Environment Variables: Defined using
${ENV_VAR}syntax - Nested Variables: Access nested values with dot notation
{config.api_key}
Using Variables in Templates
Variables can be used anywhere in your agent specification:
name: {agent_name}
description: A configurable agent for {purpose}
components:
- id: "agent-main"
type: "genesis:agent"
config:
agent_llm: "{llm_provider}"
model_name: "{model_name}"
temperature: {temperature}
api_key: "${OPENAI_API_KEY}" # Environment variable
system_prompt: |
{system_prompt_template}
Your goal is to {agent_goal}.
Setting Variables via CLI
Variables can be provided through multiple methods:
-
Command-line arguments:
genesis-agent create -t template.yaml \ --var agent_name="My Assistant" \ --var temperature=0.7 \ --var 'config={"timeout": 30}'
-
Variable file (JSON or YAML):
genesis-agent create -t template.yaml --var-file variables.json
Example
variables.json:{ "agent_name": "Advanced Assistant", "llm_provider": "OpenAI", "model_name": "gpt-4", "temperature": 0.5, "agent_goal": "help users with complex tasks" }
-
Environment variables:
export OPENAI_API_KEY="sk-..." export LLM_MODEL="gpt-4" genesis-agent create -t template.yaml
Type Preservation
When a variable represents the entire value, its type is preserved:
{count}with value42→42(integer){enabled}with valuetrue→true(boolean){items}with value["a", "b"]→["a", "b"](array)
When embedded in a string, variables are converted to strings:
"Count: {count}"with value42→"Count: 42"
Tweaks
Tweaks allow you to modify specific component configurations after the flow is created. This is useful for adjusting parameters without editing the template.
Applying Tweaks
Use the --tweak flag to modify component fields:
genesis-agent create -t template.yaml \
--tweak agent-main.temperature=0.3 \
--tweak agent-main.max_tokens=2000 \
--tweak 'agent-main.system_prompt="New system prompt"'
Format: component_id.field_name=value
Tweaks with Variables
Tweaks can also use variables:
genesis-agent create -t template.yaml \
--var new_temp=0.3 \
--tweak agent-main.temperature={new_temp}
Complete Example
Here's a complete example using variables and tweaks:
-
Create a template (
agent-template.yaml):name: {agent_name} components: - id: chat-input type: genesis:chat_input config: sender_name: {user_name} provides: - in: main-agent useAs: input - id: main-agent type: genesis:agent config: agent_llm: {llm_provider} model_name: {model_name} temperature: {temperature} system_prompt: | You are {agent_role}. {additional_instructions} provides: - in: chat-output useAs: input - id: chat-output type: genesis:chat_output config: sender_name: {agent_name}
-
Create variables file (
prod-vars.json):{ "agent_name": "Production Assistant", "user_name": "User", "llm_provider": "Azure OpenAI", "model_name": "gpt-4", "temperature": 0.3, "agent_role": "a helpful production assistant", "additional_instructions": "Always be professional and concise." }
-
Create the flow with tweaks:
genesis-agent create -t agent-template.yaml \ --var-file prod-vars.json \ --var agent_name="Custom Assistant" \ --tweak main-agent.temperature=0.1 \ --tweak main-agent.max_tokens=1500
Undefined Variables
If a variable is referenced but not defined, it will be kept as a placeholder for Langflow to potentially resolve:
- Template:
{undefined_var} - Output:
{undefined_var}(preserved)
The CLI will warn you about undefined variables during creation.
Available Templates
Healthcare Agents
medication-extractor- Extract medications from clinical textclinical-validator- Validate clinical requests against guidelineseligibility-checker- Verify insurance eligibilityprior-auth-agent- Process prior authorization requestsdocument-processor- Extract text from healthcare documentsaccumulator-check-agent- Check deductibles and OOP maximumsbenefit-check-agent- Comprehensive benefit validationeoc-check-agent- Evidence of Coverage validationpa-coordinator- Coordinate PA processing with multiple agents
Healthcare Orchestrators
benefit-check-flow- Multi-agent benefit verificationprior-auth-workflow- End-to-end PA processing
Examples
simple-calculator-agent- Basic math calculationscalculator-agent-enhanced- Advanced calculator with memory
Configuration
The CLI stores configuration in .genesis-agent.yaml in your current directory:
genesis_studio:
url: http://localhost:7860
api_key: your-api-key
# Optional LLM integration for enhanced features
llm_integration:
enabled: true
provider: openai
config:
api_key: your-openai-key
Environment variables are also supported:
GENESIS_STUDIO_URLGENESIS_STUDIO_API_KEYOPENAI_API_KEY
Development
Runtime Configuration Roadmap
The Genesis Agent CLI is designed to support runtime configuration through:
- Variables System: Define configurable parameters in agent specs
- Tweaks Integration: Override values at runtime via Langflow
- Environment Support: Different configs for dev/staging/prod
Current implementation status:
- Template structure supports variables ✅
- Flow converter preserves variable references ✅
- Runtime substitution pending implementation ⏳
- Langflow tweaks integration pending ⏳
Project Structure
genesis-agent-cli/
├── src/
│ ├── commands/ # CLI commands
│ ├── converters/ # Flow converters
│ ├── models/ # Agent specification models
│ ├── parsers/ # YAML parsers
│ ├── registry/ # Component registry
│ └── services/ # API services
├── templates/ # Agent templates
│ ├── healthcare/ # Healthcare-specific agents
│ └── examples/ # Example agents
└── tests/ # Test suite
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=src --cov-report=html
# Run specific test
pytest tests/test_flow_converter.py
Adding New Templates
- Create YAML file in appropriate template directory
- Use v2 enhanced format with full metadata
- Check dependencies with
genesis-agent check-deps - Test flow creation and execution
Troubleshooting
Common Issues
- Component not found: Ensure Genesis Studio is running and accessible
- Authentication errors: Check API key configuration
- Template validation errors: Verify component types match Genesis Studio
- Edge connection issues: Ensure proper handle types (use "other" for tools)
Debug Mode
# Enable debug logging
export GENESIS_DEBUG=true
genesis-agent create -t template.yaml
Contributing
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
License
This project is proprietary to Autonomize AI.
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 genesis_agent_cli-0.1.0.tar.gz.
File metadata
- Download URL: genesis_agent_cli-0.1.0.tar.gz
- Upload date:
- Size: 406.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e1f2cd0260202ee0a57f1d7580e07c23be6adee0f26c70864e86b7d4876f552
|
|
| MD5 |
a13ffce1e932fc6d51c15331dfac7b81
|
|
| BLAKE2b-256 |
20c03f7b37b66aef1a226bb81e654d29396559d50e561402625ab630a10a1f03
|
File details
Details for the file genesis_agent_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: genesis_agent_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 52.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a41c4fdea1a611737a242e7ede02a130b9e948f9542795254b091559b787d23f
|
|
| MD5 |
9fe2aa80b4b7696d28eba4259d41e310
|
|
| BLAKE2b-256 |
c69e8d41db506eeef162a0c24a22a4c9ec13e54d0821fb75e3472c1c7b237447
|