Agent CD/CI
Lexia's CD/CI (Continuous Deployment & Continuous Integration) pipeline automates how agents are tested, built, and deployed — ensuring smooth updates across environments.
Image: Diagram showing Lexia agent workflow — Code → Build → Test → Deploy → Monitor
1. Overview
Lexia provides a built-in CD/CI mechanism for deploying agents safely and consistently.
It integrates directly with the Lexia CLI, enabling you to:
- Validate code and schema changes
- Deploy new agent versions to dev/staging/prod
- Automate testing and rollback
- Track deployment history through Tracing
2. Deployment Environments
Each workspace supports three isolated environments:
| Environment | Purpose | Example Command |
|---|---|---|
dev | Local or internal testing | lexia deploy dev |
staging | Pre-production validation | lexia deploy staging |
prod | Live production environment | lexia deploy prod |
Image: Diagram of dev → staging → prod flow between workspaces
3. Deployment Workflow
A standard Lexia CD/CI pipeline consists of:
- Code Commit — push changes to repository
- Build Phase — package agent and dependencies
- Validation — run syntax, security, and schema checks
- Deploy — send agent image/config to Lexia cloud
- Verify — automatic smoke test after deployment
Example pipeline config (,[object Object],):
pipeline:
build:
- command: pip install -r requirements.txt
validate:
- command: lexia lint
deploy:
- command: lexia deploy staging
4. Environment Variables
During build and deploy phases, Lexia automatically injects environment variables:
| Variable | Description |
|---|---|
LEXIA_ENV | Current environment (dev, staging, prod) |
LEXIA_API_KEY | Auth key for deployment |
LEXIA_DB_URL | Database connection string |
LEXIA_STORAGE_URL | Storage endpoint |
LEXIA_VECTOR_DB_URL | Vector DB endpoint |
Image: Environment variable injection flow from Lexia cloud into container build
5. Rollback & Versioning
Every deployment automatically creates a version checkpoint. You can roll back to any previous version:
lexia deploy rollback --to v1.4.2
Each version includes:
- Commit hash
- Agent build metadata
- Environment configuration snapshot
Image: Timeline of deployments with version tags and rollback arrows
6. Testing & Validation
Before deployment, agents can run automated test suites or static checks:
lexia test
These tests validate:
- Agent startup
- API connectivity
- Guardrail compliance
- DB and Storage access
Results appear in Lexia Tracing with detailed logs.
7. Monitoring Deployments
The Lexia Dashboard shows:
- Deployment status (success/failure)
- Build logs
- Environment variables used
- Resource usage metrics
For advanced automation, use the API endpoint:
GET /api/v1/deployments?workspace_id=...
Image: Dashboard screenshot showing build logs and deployment summary
8. Integration with GitHub Actions (Optional)
You can integrate Lexia CD/CI with external systems like GitHub Actions or GitLab CI:
name: Deploy to Lexia
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: pip install lexia
- run: lexia deploy prod --token ${{{ secrets.LEXIA_TOKEN }}}
Image: Example of GitHub Actions workflow deploying an agent automatically to Lexia