How tuniucorp/aigc-agents works
Project Type and Purpose
• This is a full-stack, modular Java 17 application built on Spring Boot and Spring AI.
• It implements an intelligent agent framework (“Niu Travel Agent”) that allows you to register, configure and invoke “agents” (e.g., flight search, hotel booking, trip planning) which are powered by large language models (LLMs) such as OpenAI.
• Four Maven modules:
• agents-opensource-core – the agent engine (factory, lifecycle, prompts, memory, command pattern)
• agents-opensource-app – concrete domain agent implementations (flight, hotel, train, trip, evaluators)
• agents-opensource-tools – tool integration layers (Spring auto-configuration for flight/ hotel/train/ trip APIs, widgets)
• agents-opensource-web – REST/web UI, persistent storage services (MySQL for chat records, Redis for memory), configuration
File Structure Analysis
• Top-level pom.xml aggregates the four submodules.
• agents-opensource-web hosts:
• Application.java, Spring Boot configs (RedisConfig, I18nConfig, SpringAiConfig, FilterConfig)
• Controllers/Services for chat record persistence, antispam, trace logs
• Static UI (index.html, index.js, CSS) served under /static
• agents-opensource-core provides packages:
• agent (AgentManager, factory, base classes)
• command (Command, actions, lifecycle, storage)
• prompt (PromptManager + template directory under /resources/prompt)
• memory/advisor (in-memory or Redis chat memory)
• chat client (OpenAIHttpClient)
• util, common, message, evaluator interfaces
• agents-opensource-app builds on core:
• impl/base (Coordinator, Dispatcher, Analyst) for orchestration of agent chains
• impl/flight, hotel, train, trip, evaluators – domain-specific Agent subclasses, prompt templates, stream handlers
• controllers: AssistantController, SuggestionController, ToolController – generic endpoints for agent calls
• services: chat record, trace log, antispam, file/process, i18n, freemarker, rewrite, transfer
• agents-opensource-tools provides Spring Boot auto-configuration of external APIs:
• FlightAutoConfiguration, HotelAutoConfiguration, TrainAutoConfiguration, TripAutoConfiguration, WidgetsAutoConfiguration
• Tools implement FlightInformationQueryTool, HotelDetail, SearchTrainDetailTool, TripExtractorTool, RestaurantListTool, WeatherListTool
README Insights
• Confirms four-module architecture: core engine, app implementations, tools integration, web service.
• Highlights key components: AgentManager, PromptManager, conversation flow (history, stream), multi-model support, i18n, domain applications.
• Mentions Redis (for memory) and MySQL (optional) for persistent storage.