Aura Platform

Aura is a distributed microservices platform for autonomous economic negotiations between AI agents and service providers. It provides a scalable architecture with separate API Gateway and Core Service components, using Protocol Buffers for efficient communication and gRPC for internal service-to-service communication.

🏗️ Architecture

spinner

🚀 Quick Start

Prerequisites

  • Python 3.8+

  • uv (Python package manager) - pip install uv

  • buf (Protocol Buffer toolkit) - Installation Guidearrow-up-right

  • Docker and Docker Compose

  • Mistral AI API key (for LLM-based negotiation)

  • Redis and PostgreSQL (provided via Docker)

Setup

  1. Clone the repository:

    git clone https://github.com/zaebee/aura.git
    cd aura
  2. Install Python dependencies:

    uv sync
  3. Set up environment variables:

    cp .env.example .env
    # Edit .env and add your API keys using the new nested structure:
    # AURA_LLM__API_KEY="your_mistral_key"
    # AURA_DATABASE__URL="postgresql://user:password@localhost:5432/aura_db"
  4. Train the Brain (DSPy):

    make train
  5. Generate Protocol Buffer code:

    buf generate

🏗️ Running the Platform

This will start:

  • PostgreSQL with pgvector extension (port 5432)

  • Redis for caching and rate limiting (port 6379)

  • Prometheus for metrics (port 9090)

  • Core Service (gRPC on port 50051)

  • API Gateway (HTTP on port 8000)

  • Telegram Bot (Telegram interface)

  • Jaeger for distributed tracing (UI on port 16686)

  • Frontend Agent Console (port 3000)

Running Services Individually

Core Service:

API Gateway:

🧪 Testing and Simulation

Run Tests

Run Simulators

Agent Negotiation Simulator:

Autonomous Buyer (Continuous Loop):

📂 Project Structure

Services & Adapters

  • Core Service: The brain of the platform. Uses DSPy for ML-optimized negotiation strategies and PostgreSQL/pgvector for semantic search.

  • API Gateway: Secure entry point for autonomous agents. Handles signature verification and rate limiting.

  • Telegram Bot: User-friendly interface for manual search and negotiation via Telegram.

  • MCP Server: Allows AI agents (Claude/Cursor) to natively use Aura tools.

🔧 Development Workflow

Code Generation

After modifying .proto files:

Linting and Formatting

Database Migrations

📖 API Endpoints

Negotiation Endpoint

Request:

Response:

Search Endpoint

Request:

Response:

🔒 Security

The platform now includes cryptographic signature verification using Ed25519:

Security Features

  • Signed Headers: Agents must sign requests with X-Agent-ID, X-Timestamp, and X-Signature

  • Replay Protection: Timestamps validated within ±60 seconds

  • Request Integrity: Body hash included in signature to prevent tampering

  • Agent Authentication: DID-based identity verification using Ed25519

  • Rate Limiting: Prevents abuse through Redis-backed rate limiting

  • Hidden Knowledge: Floor prices are never exposed to agents

Running with Security

  1. Generate agent keys:

  2. Run the secure gateway:

  3. Run secure simulators:

  4. Test security:

Security Implementation Details

  • Algorithm: Ed25519 (PyNaCl library)

  • Signature Format: METHOD + PATH + TIMESTAMP + BodyHash

  • DID Format: did:key:public_key_hex

  • Timestamp Validation: ±60 seconds tolerance for clock skew

See docs/SECURITY.md for comprehensive security documentation.

📊 Observability

  • Distributed Tracing: Jaeger integration for end-to-end request tracing

  • Structured Logging: JSON logging with request IDs

  • Metrics: OpenTelemetry for performance monitoring

🤝 Contributing

  1. Follow the existing code style

  2. Update Protocol Buffers as needed

  3. Regenerate code after proto changes (buf generate)

  4. Add tests for new functionality

  5. Update documentation

📄 License

This project is licensed under the MIT Licensearrow-up-right.

Последнее обновление