• v1.4.0 8cbc32501d

    FTMahringer released this 2026-05-09 00:00:10 +02:00 | 253 commits to main since this release

    v1.4.0 - Chat Runtime

    Release Date: 2026-05-08
    Milestone: Chat Runtime Backend

    Overview

    Implements complete chat runtime for the Main Agent with conversation management, message persistence, model provider integration, and comprehensive API endpoints.

    Features

    Conversation Management

    • Create Conversations: REST API to start new chat sessions with agents
    • List Conversations: Query conversations by user with pagination
    • Get Conversation Details: Retrieve full conversation history with messages
    • Conversation Status: Track ACTIVE/CLOSED status for conversations

    Message Handling

    • Send Messages: POST user messages to conversations
    • Message Persistence: All messages saved with full metadata
    • Conversation History: Messages loaded in chronological order for context

    Main Agent Integration

    • Prompt Assembly: Loads Main Agent identity files (system-prompt, identity, soul, connections)
    • Model Provider Integration: Routes messages through configured Ollama provider
    • Context Building: Assembles system prompt + conversation history for each request
    • Response Persistence: Saves assistant responses with full metadata

    Response Metadata Tracking

    • Provider Tracking: Links each response to model provider used
    • Model Name: Records specific model (e.g., llama3.2)
    • Latency Tracking: Measures response time in milliseconds
    • Token Breakdown: Tracks prompt_tokens and completion_tokens separately
    • Analytics Ready: Database schema supports future usage analytics

    Error Handling

    • Provider Errors: Catches model provider failures gracefully
    • Timeout Handling: Detects and reports request timeouts
    • Error Messages: Saves error states as assistant messages with ⚠️ prefix
    • Exception Types: ModelProviderException, RequestTimeoutException

    REST API

    • POST /api/conversations - Create new conversation
    • GET /api/conversations - List user conversations
    • GET /api/conversations/{id} - Get conversation with messages
    • POST /api/conversations/{id}/messages - Send message and get response

    Technical Details

    Database Schema

    • New Migration V3: Adds metadata columns to messages table
      • provider_id (FK to model_providers)
      • model_name (VARCHAR)
      • latency_ms (INTEGER)
      • prompt_tokens (INTEGER)
      • completion_tokens (INTEGER)

    Services

    • ConversationService: CRUD operations for conversations
    • MessageService: Message send/receive with provider orchestration
    • MainAgentPromptService: Loads and assembles Main Agent identity
    • OllamaProviderService: Integration with Ollama API

    DTOs

    • CreateConversationRequest (agentId, userId from header)
    • SendMessageRequest (content)
    • ConversationResponse (full conversation data)
    • MessageResponse (message with metadata)

    Resource Files

    • Main Agent identity files copied to classpath: src/main/resources/agents/main/
    • Loaded at runtime via Spring ClassPathResource

    Documentation

    • docs/chat-api.md: Complete REST API reference with examples

    Development Steps

    This milestone consists of 7 development steps (v1.3.1-dev through v1.3.7-dev):

    1. v1.3.1-dev: Conversation CRUD APIs
    2. v1.3.2-dev: Message send API with persistence
    3. v1.3.3-dev: Main Agent prompt assembly
    4. v1.3.4-dev: Model provider integration
    5. v1.3.5-dev: Response metadata tracking
    6. v1.3.6-dev: Error handling
    7. v1.3.7-dev: API documentation

    Hotfixes

    • v1.3.8-hotfix: Fixed 6 compilation errors (ModelProvider method names, DTO entity mismatches, timestamp types)
    • v1.3.9-hotfix: Added missing UUID import in DtoMapper

    Testing

    • Maven compilation successful
    • Docker Compose build successful
    • All 3 Flyway migrations applied (V1, V2, V3)
    • Backend starts and passes health check
    • PostgreSQL 18.3 database initialized
    • All services (backend, postgres, redis, qdrant, dashboard) running

    Next Steps

    • v1.5.0 - Agent Lifecycle: Agent versioning, lifecycle hooks, state management
    • v1.6.0 - Memory Layer: Short-term/long-term memory with vector embeddings
    • v1.7.0 - Tool System: Tool definition, invocation, and response handling
    • v1.8.0 - Dashboard UI: Web interface for chat, agents, and settings

    Dependencies

    • Spring Boot 4.0.0
    • PostgreSQL 18.3
    • Hibernate 7.1.8
    • Flyway 11.2.0
    • Ollama API integration

    Migration Path

    No breaking changes. New installations will automatically run all migrations (V1, V2, V3).

    Contributors

    Implemented in collaboration with GitHub Copilot CLI.

    Downloads