Move blockchain app READMEs to centralized documentation
Some checks failed
API Endpoint Tests / test-api-endpoints (push) Successful in 10s
Blockchain Synchronization Verification / sync-verification (push) Failing after 3s
CLI Tests / test-cli (push) Failing after 4s
Documentation Validation / validate-docs (push) Successful in 8s
Documentation Validation / validate-policies-strict (push) Successful in 4s
Integration Tests / test-service-integration (push) Successful in 38s
Multi-Node Blockchain Health Monitoring / health-check (push) Successful in 2s
P2P Network Verification / p2p-verification (push) Successful in 3s
Security Scanning / security-scan (push) Successful in 40s
Smart Contract Tests / test-solidity (map[name:aitbc-token path:packages/solidity/aitbc-token]) (push) Successful in 15s
Smart Contract Tests / lint-solidity (push) Successful in 8s
Some checks failed
API Endpoint Tests / test-api-endpoints (push) Successful in 10s
Blockchain Synchronization Verification / sync-verification (push) Failing after 3s
CLI Tests / test-cli (push) Failing after 4s
Documentation Validation / validate-docs (push) Successful in 8s
Documentation Validation / validate-policies-strict (push) Successful in 4s
Integration Tests / test-service-integration (push) Successful in 38s
Multi-Node Blockchain Health Monitoring / health-check (push) Successful in 2s
P2P Network Verification / p2p-verification (push) Successful in 3s
Security Scanning / security-scan (push) Successful in 40s
Smart Contract Tests / test-solidity (map[name:aitbc-token path:packages/solidity/aitbc-token]) (push) Successful in 15s
Smart Contract Tests / lint-solidity (push) Successful in 8s
- Relocate blockchain-event-bridge README content to docs/apps/blockchain/blockchain-event-bridge.md - Relocate blockchain-explorer README content to docs/apps/blockchain/blockchain-explorer.md - Replace app READMEs with redirect notices pointing to new documentation location - Consolidate documentation in central docs/ directory for better organization
This commit is contained in:
15
docs/apps/agents/README.md
Normal file
15
docs/apps/agents/README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Agent Applications
|
||||
|
||||
Agent services and AI engine for autonomous operations.
|
||||
|
||||
## Applications
|
||||
|
||||
- [Agent Services](agent-services.md) - Agent bridge, compliance, protocols, registry, and trading
|
||||
- [AI Engine](ai-engine.md) - AI engine for autonomous agent operations
|
||||
|
||||
## Features
|
||||
|
||||
- Agent communication protocols
|
||||
- Agent compliance checking
|
||||
- Agent registry and discovery
|
||||
- Agent trading capabilities
|
||||
211
docs/apps/agents/agent-services.md
Normal file
211
docs/apps/agents/agent-services.md
Normal file
@@ -0,0 +1,211 @@
|
||||
# Agent Services
|
||||
|
||||
## Status
|
||||
✅ Operational
|
||||
|
||||
## Overview
|
||||
Collection of agent-related services including agent bridge, compliance, protocols, registry, and trading capabilities.
|
||||
|
||||
## Architecture
|
||||
|
||||
### Components
|
||||
- **Agent Bridge**: Bridge service for agent communication across networks
|
||||
- **Agent Compliance**: Compliance checking and validation for agents
|
||||
- **Agent Coordinator**: Coordination service for agent management
|
||||
- **Agent Protocols**: Communication protocols for agent interaction
|
||||
- **Agent Registry**: Central registry for agent registration and discovery
|
||||
- **Agent Trading**: Trading capabilities for agent-based transactions
|
||||
|
||||
## Quick Start (End Users)
|
||||
|
||||
### Prerequisites
|
||||
- Python 3.13+
|
||||
- Network connectivity for agent communication
|
||||
- Valid agent credentials
|
||||
|
||||
### Installation
|
||||
```bash
|
||||
cd /opt/aitbc/apps/agent-services
|
||||
# Install individual service dependencies
|
||||
cd agent-bridge && pip install -r requirements.txt
|
||||
cd agent-compliance && pip install -r requirements.txt
|
||||
# ... repeat for other services
|
||||
```
|
||||
|
||||
### Configuration
|
||||
Each service has its own configuration file. Configure environment variables for each service:
|
||||
```bash
|
||||
# Agent Bridge
|
||||
export AGENT_BRIDGE_ENDPOINT="http://localhost:8001"
|
||||
export AGENT_BRIDGE_API_KEY="your-api-key"
|
||||
|
||||
# Agent Registry
|
||||
export REGISTRY_DATABASE_URL="postgresql://user:pass@localhost/agent_registry"
|
||||
```
|
||||
|
||||
### Running Services
|
||||
```bash
|
||||
# Start individual services
|
||||
cd agent-bridge && python main.py
|
||||
cd agent-compliance && python main.py
|
||||
# ... repeat for other services
|
||||
```
|
||||
|
||||
## Developer Guide
|
||||
|
||||
### Development Setup
|
||||
1. Clone the repository
|
||||
2. Navigate to the specific service directory
|
||||
3. Create virtual environment: `python -m venv .venv`
|
||||
4. Install dependencies: `pip install -r requirements.txt`
|
||||
5. Configure environment variables
|
||||
6. Run tests: `pytest tests/`
|
||||
|
||||
### Project Structure
|
||||
```
|
||||
agent-services/
|
||||
├── agent-bridge/ # Agent communication bridge
|
||||
├── agent-compliance/ # Compliance checking service
|
||||
├── agent-coordinator/ # Agent coordination (see coordinator/agent-coordinator.md)
|
||||
├── agent-protocols/ # Communication protocols
|
||||
├── agent-registry/ # Agent registration and discovery
|
||||
└── agent-trading/ # Agent trading capabilities
|
||||
```
|
||||
|
||||
### Testing
|
||||
```bash
|
||||
# Run tests for specific service
|
||||
cd agent-bridge && pytest tests/
|
||||
|
||||
# Run all service tests
|
||||
pytest agent-*/tests/
|
||||
```
|
||||
|
||||
## API Reference
|
||||
|
||||
### Agent Bridge
|
||||
|
||||
#### Register Bridge
|
||||
```http
|
||||
POST /api/v1/bridge/register
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"agent_id": "string",
|
||||
"network": "string",
|
||||
"endpoint": "string"
|
||||
}
|
||||
```
|
||||
|
||||
#### Send Message
|
||||
```http
|
||||
POST /api/v1/bridge/send
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"from_agent": "string",
|
||||
"to_agent": "string",
|
||||
"message": {},
|
||||
"protocol": "string"
|
||||
}
|
||||
```
|
||||
|
||||
### Agent Registry
|
||||
|
||||
#### Register Agent
|
||||
```http
|
||||
POST /api/v1/registry/agents
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"agent_id": "string",
|
||||
"agent_type": "string",
|
||||
"capabilities": ["string"],
|
||||
"metadata": {}
|
||||
}
|
||||
```
|
||||
|
||||
#### Query Agents
|
||||
```http
|
||||
GET /api/v1/registry/agents?type=agent_type&capability=capability
|
||||
```
|
||||
|
||||
### Agent Compliance
|
||||
|
||||
#### Check Compliance
|
||||
```http
|
||||
POST /api/v1/compliance/check
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"agent_id": "string",
|
||||
"action": "string",
|
||||
"context": {}
|
||||
}
|
||||
```
|
||||
|
||||
#### Get Compliance Report
|
||||
```http
|
||||
GET /api/v1/compliance/report/{agent_id}
|
||||
```
|
||||
|
||||
### Agent Trading
|
||||
|
||||
#### Submit Trade
|
||||
```http
|
||||
POST /api/v1/trading/submit
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"agent_id": "string",
|
||||
"trade_type": "buy|sell",
|
||||
"asset": "string",
|
||||
"quantity": 100,
|
||||
"price": 1.0
|
||||
}
|
||||
```
|
||||
|
||||
#### Get Trade History
|
||||
```http
|
||||
GET /api/v1/trading/history/{agent_id}
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### Agent Bridge
|
||||
- `AGENT_BRIDGE_ENDPOINT`: Bridge service endpoint
|
||||
- `AGENT_BRIDGE_API_KEY`: API key for authentication
|
||||
- `BRIDGE_PROTOCOLS`: Supported communication protocols
|
||||
|
||||
### Agent Registry
|
||||
- `REGISTRY_DATABASE_URL`: Database connection string
|
||||
- `REGISTRY_CACHE_TTL`: Cache time-to-live
|
||||
- `REGISTRY_SYNC_INTERVAL`: Sync interval for agent updates
|
||||
|
||||
### Agent Compliance
|
||||
- `COMPLIANCE_RULES_PATH`: Path to compliance rules
|
||||
- `COMPLIANCE_CHECK_INTERVAL`: Interval for compliance checks
|
||||
- `COMPLIANCE_ALERT_THRESHOLD`: Threshold for compliance alerts
|
||||
|
||||
### Agent Trading
|
||||
- `TRADING_FEE_PERCENTAGE`: Trading fee percentage
|
||||
- `TRADING_MIN_ORDER_SIZE`: Minimum order size
|
||||
- `TRADING_MAX_ORDER_SIZE`: Maximum order size
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
**Bridge connection failed**: Check network connectivity and endpoint configuration.
|
||||
|
||||
**Agent not registered**: Verify agent registration with registry service.
|
||||
|
||||
**Compliance check failed**: Review compliance rules and agent configuration.
|
||||
|
||||
**Trade submission failed**: Check agent balance and trading parameters.
|
||||
|
||||
## Security Notes
|
||||
|
||||
- Use API keys for service authentication
|
||||
- Encrypt agent communication channels
|
||||
- Validate all agent actions through compliance service
|
||||
- Monitor trading activities for suspicious patterns
|
||||
- Regularly audit agent registry entries
|
||||
179
docs/apps/agents/ai-engine.md
Normal file
179
docs/apps/agents/ai-engine.md
Normal file
@@ -0,0 +1,179 @@
|
||||
# AI Engine
|
||||
|
||||
## Status
|
||||
✅ Operational
|
||||
|
||||
## Overview
|
||||
AI engine for autonomous agent operations, decision making, and learning capabilities.
|
||||
|
||||
## Architecture
|
||||
|
||||
### Core Components
|
||||
- **Decision Engine**: AI-powered decision making module
|
||||
- **Learning System**: Real-time learning and adaptation
|
||||
- **Model Management**: Model deployment and versioning
|
||||
- **Inference Engine**: High-performance inference for AI models
|
||||
- **Task Scheduler**: AI-driven task scheduling and optimization
|
||||
|
||||
## Quick Start (End Users)
|
||||
|
||||
### Prerequisites
|
||||
- Python 3.13+
|
||||
- GPU support (optional for accelerated inference)
|
||||
- AI model files
|
||||
|
||||
### Installation
|
||||
```bash
|
||||
cd /opt/aitbc/apps/ai-engine
|
||||
.venv/bin/pip install -r requirements.txt
|
||||
```
|
||||
|
||||
### Configuration
|
||||
Set environment variables in `.env`:
|
||||
```bash
|
||||
AI_MODEL_PATH=/path/to/models
|
||||
INFERENCE_DEVICE=cpu|cuda
|
||||
MAX_CONCURRENT_TASKS=10
|
||||
LEARNING_ENABLED=true
|
||||
```
|
||||
|
||||
### Running the Service
|
||||
```bash
|
||||
.venv/bin/python main.py
|
||||
```
|
||||
|
||||
## Developer Guide
|
||||
|
||||
### Development Setup
|
||||
1. Clone the repository
|
||||
2. Create virtual environment: `python -m venv .venv`
|
||||
3. Install dependencies: `pip install -r requirements.txt`
|
||||
4. Download or train AI models
|
||||
5. Configure model paths
|
||||
6. Run tests: `pytest tests/`
|
||||
|
||||
### Project Structure
|
||||
```
|
||||
ai-engine/
|
||||
├── src/
|
||||
│ ├── decision_engine/ # Decision making logic
|
||||
│ ├── learning_system/ # Learning and adaptation
|
||||
│ ├── model_management/ # Model deployment
|
||||
│ ├── inference_engine/ # Inference service
|
||||
│ └── task_scheduler/ # AI-driven scheduling
|
||||
├── models/ # AI model files
|
||||
├── tests/ # Test suite
|
||||
└── pyproject.toml # Project configuration
|
||||
```
|
||||
|
||||
### Testing
|
||||
```bash
|
||||
# Run all tests
|
||||
pytest tests/
|
||||
|
||||
# Run specific test
|
||||
pytest tests/test_inference.py
|
||||
|
||||
# Run with GPU support
|
||||
CUDA_VISIBLE_DEVICES=0 pytest tests/
|
||||
```
|
||||
|
||||
## API Reference
|
||||
|
||||
### Decision Making
|
||||
|
||||
#### Make Decision
|
||||
```http
|
||||
POST /api/v1/ai/decision
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"context": {},
|
||||
"options": ["option1", "option2"],
|
||||
"constraints": {}
|
||||
}
|
||||
```
|
||||
|
||||
#### Get Decision History
|
||||
```http
|
||||
GET /api/v1/ai/decisions?limit=10
|
||||
```
|
||||
|
||||
### Learning
|
||||
|
||||
#### Trigger Learning
|
||||
```http
|
||||
POST /api/v1/ai/learning/train
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"data_source": "string",
|
||||
"epochs": 100,
|
||||
"batch_size": 32
|
||||
}
|
||||
```
|
||||
|
||||
#### Get Learning Status
|
||||
```http
|
||||
GET /api/v1/ai/learning/status
|
||||
```
|
||||
|
||||
### Inference
|
||||
|
||||
#### Run Inference
|
||||
```http
|
||||
POST /api/v1/ai/inference
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"model": "string",
|
||||
"input": {},
|
||||
"parameters": {}
|
||||
}
|
||||
```
|
||||
|
||||
#### Batch Inference
|
||||
```http
|
||||
POST /api/v1/ai/inference/batch
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"model": "string",
|
||||
"inputs": [{}],
|
||||
"parameters": {}
|
||||
}
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### Environment Variables
|
||||
- `AI_MODEL_PATH`: Path to AI model files
|
||||
- `INFERENCE_DEVICE`: Device for inference (cpu/cuda)
|
||||
- `MAX_CONCURRENT_TASKS`: Maximum concurrent inference tasks
|
||||
- `LEARNING_ENABLED`: Enable/disable learning system
|
||||
- `LEARNING_RATE`: Learning rate for training
|
||||
- `BATCH_SIZE`: Batch size for inference
|
||||
- `MODEL_CACHE_SIZE`: Cache size for loaded models
|
||||
|
||||
### Model Management
|
||||
- **Model Versioning**: Track model versions and deployments
|
||||
- **Model Cache**: Cache loaded models for faster inference
|
||||
- **Model Auto-scaling**: Scale inference based on load
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
**Model loading failed**: Check model path and file integrity.
|
||||
|
||||
**Inference slow**: Verify GPU availability and batch size settings.
|
||||
|
||||
**Learning not progressing**: Check learning rate and data quality.
|
||||
|
||||
**Out of memory errors**: Reduce batch size or model size.
|
||||
|
||||
## Security Notes
|
||||
|
||||
- Validate all inference inputs
|
||||
- Sanitize model outputs
|
||||
- Monitor for adversarial attacks
|
||||
- Regularly update AI models
|
||||
- Implement rate limiting for inference endpoints
|
||||
Reference in New Issue
Block a user