Story 3: Asynchronous AI Task Pipeline (Kafka Integration)
User Story: As a system architect, I want to establish a Kafka-based "circulatory system" between the backend and AI services so that long-running ML/LLM tasks do not block the web interface.
Task 3.1: Kafka Infrastructure Setup. Update dc-micronaut.yml to include a Kafka broker and Zookeeper node to facilitate asynchronous messaging
.
Task 3.2: Implement LLM Task Producer. Create a Kotlin-based @KafkaClient in Micronaut to publish prompt data and user metadata to an llm-tasks topic
.
Task 3.3: Implement AI Worker (Python). Scaffold a Python service that uses a Kafka poll loop to retrieve messages from llm-tasks, processes them through the local Ollama/Keras routines, and produces the response to an llm-results topic
.
Task 3.4: Implement Backend Result Listener. Create a Kotlin @KafkaListener in the backend to consume messages from llm-results and update the task status in PostgreSQL, triggering a notification to the Vue 3 frontend
Story 3: Asynchronous AI Task Pipeline (Kafka Integration)
User Story: As a system architect, I want to establish a Kafka-based "circulatory system" between the backend and AI services so that long-running ML/LLM tasks do not block the web interface.
.
Task 3.2: Implement LLM Task Producer. Create a Kotlin-based @KafkaClient in Micronaut to publish prompt data and user metadata to an llm-tasks topic
.
Task 3.3: Implement AI Worker (Python). Scaffold a Python service that uses a Kafka poll loop to retrieve messages from llm-tasks, processes them through the local Ollama/Keras routines, and produces the response to an llm-results topic
.
Task 3.4: Implement Backend Result Listener. Create a Kotlin @KafkaListener in the backend to consume messages from llm-results and update the task status in PostgreSQL, triggering a notification to the Vue 3 frontend