Aura Platform - Developer Guide

🚀 Getting Started

Welcome to the Aura Platform developer guide! This document provides step-by-step instructions for setting up your development environment, running the platform, and contributing to the project.

📋 Prerequisites

Required Software

Software
Version
Purpose

Python

3.8+

Core development language

uv

Latest

Python package manager

buf

Latest

Protocol Buffer toolkit

Docker

Latest

Containerization

Docker Compose

Latest

Multi-container orchestration

Git

Latest

Version control

Make

Latest

Build automation

Optional Software

Software
Purpose

PostgreSQL

Local database development

Redis

Local caching development

Jaeger

Distributed tracing UI

Mistral AI Account

LLM-based negotiation testing

🏗️ Setup Instructions

1. Clone the Repository

2. Install Python Dependencies

3. Set Up Environment Variables

Aura uses a modular configuration system powered by Pydantic V2 Settings. Environment variables are prefixed with AURA_ and use __ (double underscore) as a nested delimiter.

Configuration Mapping

Domain
Config Class
Env Prefix
Description

Database

DatabaseSettings

AURA_DATABASE__

Postgres and Redis connections

LLM

LLMSettings

AURA_LLM__

Model selection and API keys

Server

ServerSettings

AURA_SERVER__

gRPC/HTTP ports and Telemetry

Crypto

CryptoSettings

AURA_CRYPTO__

Solana RPC and Private keys

4. Install buf (Protocol Buffer Toolkit)

Follow the official installation guide: https://buf.build/docs/installationarrow-up-right

5. Generate Protocol Buffer Code

🏃 Running the Platform

Running Services Individually

Core Service

1. Train the Brain (Mandatory) Before running the Core service, you must train the DSPy-based negotiation engine:

2. Run the Service

API Gateway

Running with Hot Reload (Development)

🧪 Testing and Quality Assurance

Running Tests

Code Quality

Running Simulators

📦 Database Setup

PostgreSQL Requirement

Aura now requires PostgreSQL with pgvector for all environments. SQLite is no longer supported due to the requirement for vector similarity search and complex concurrent negotiations.

Running Migrations

Seeding the Database

Connecting to PostgreSQL

🔧 Development Workflow

Making Changes to Protocol Buffers

  1. Edit the .proto file:

  2. Regenerate code:

  3. Update implementations:

    • Update API Gateway handlers

    • Update Core Service implementations

    • Update any tests

  4. Test changes:

Adding New Features

  1. Create a feature branch:

  2. Implement the feature:

    • Add new Protocol Buffer definitions if needed

    • Implement backend logic in core-service

    • Add API endpoints in api-gateway

    • Write tests

  3. Update documentation:

    • Update README.md if needed

    • Update API_SPECIFICATION.md if new endpoints

    • Update ARCHITECTURE.md if architectural changes

  4. Commit changes:

git commit -m "feat(negotiation): add new negotiation strategy"

Debugging

🔍 Observability and Monitoring

Distributed Tracing with Jaeger

Logging

Metrics

The platform uses OpenTelemetry for metrics collection. You can integrate with:

  • Prometheus

  • Grafana

  • Datadog

  • New Relic

🛠️ Common Development Tasks

Adding a New Pricing Strategy

  1. Create a new strategy class:

  2. Implement the PricingStrategy protocol:

  3. Update the service to use your strategy:

Adding New API Endpoints

  1. Define the endpoint in Protocol Buffers:

  2. Regenerate code:

  3. Implement in Core Service:

  4. Add HTTP endpoint in API Gateway:

Working with Vector Embeddings

📚 Project Structure Deep Dive

Protocol Buffers (proto/)

Key Concepts:

  • Service Definitions: Define gRPC services and methods

  • Message Types: Define data structures for requests/responses

  • Versioning: Organized by version (v1/)

  • Code Generation: buf generate creates Python classes

Core Service (core-service/)

Key Components:

  • gRPC Server: Handles incoming requests from API Gateway

  • Pricing Strategies: Rule-based and LLM-based decision making

  • Database Layer: SQLAlchemy models and pgvector integration

  • Embedding Generation: Text to vector conversion for search

API Gateway (api-gateway/)

Key Components:

  • FastAPI Application: RESTful API endpoints

  • Request Validation: Header verification and rate limiting

  • gRPC Client: Communication with Core Service

  • Error Handling: Graceful responses and logging

🔒 Security Considerations

Signature Verification

The platform uses Ed25519 signatures for request authentication:

Rate Limiting

JWT Authentication

🤝 Contributing Guidelines

Code Style

  • Python: Follow PEP 8 guidelines

  • Type Hints: Use Python type hints extensively

  • Docstrings: Use Google-style docstrings

  • Imports: Group imports (standard library, third-party, local)

  • Naming: Use snake_case for variables/functions, CamelCase for classes

Commit Messages

  • Format: <type>(<scope>): <description>

  • Types: feat, fix, docs, style, refactor, perf, test, chore

  • Examples:

    • feat(llm): add mistral strategy support

    • fix(api): handle missing signature headers

    • docs(readme): update setup instructions

Pull Request Process

  1. Create a feature branch

  2. Make your changes

  3. Write tests

  4. Update documentation

  5. Run linting and tests

  6. Create Pull Request

  7. Request review

  8. Address feedback

  9. Merge to main

🚨 Troubleshooting

Common Issues

Issue: buf generate fails

Issue: Database connection fails

Issue: gRPC connection refused

Issue: Missing Python dependencies

Debugging Tips

📚 Learning Resources

Protocol Buffers and gRPC

Python Development

Observability

🤝 Community and Support

  • GitHub Issues: Report bugs and request features

  • Discussions: Ask questions and share ideas

  • Contributing: See CONTRIBUTING.md for guidelines

📝 License

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

🙏 Acknowledgments

Thank you for contributing to the Aura Platform! Your work helps build a robust ecosystem for autonomous economic negotiations.

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