How aliens983/campusbrain works
CampusBrain is a unified campus platform combining CAS appointments and a knowledge-base assistant. A user asks a question through the KB workflow: context-aware conversation and hybrid retrieval feed answer generation, which can call CAS for live appointment data; proposed bookings remain drafts until explicitly confirmed. The CAS branch covers campus-scoped service discovery, resource booking, review, chat, and notifications. The README documents these product capabilities and cross-service links; sampled source shows the QA orchestration and assistant-service contract, but not every controller, persistence adapter, or integration implementation.
Main entry points: SearchService.java Hybrid retrieval · BookServiceImpl.java Booking lifecycle · DocumentApplicationService.java Document ingestion · QaApplicationService.java QA orchestration
Components 23
Web experience
- Vue application
frontend/src/App.vue
Knowledge assistant
- QA endpoint
backend/kb-service/src/main/java/com/kb/interfaces/rest/QaController.java - QA orchestration
backend/kb-service/src/main/java/com/kb/application/service/QaApplicationService.java - Conversation state
backend/kb-service/src/main/java/com/kb/domain/conversation/Conversation.java - Answer pipeline
backend/kb-service/src/main/java/com/kb/application/service/AnswerPipeline.java - Hybrid retrieval
backend/kb-service/src/main/java/com/kb/domain/rag/SearchService.java - Embedding provider
backend/kb-service/src/main/java/com/kb/infrastructure/rag/embedding/OpenAiEmbeddingService.java - LLM and tools
backend/kb-service/src/main/java/com/kb/infrastructure/rag/llm/LangChain4jLlmService.java - Document ingestion
backend/kb-service/src/main/java/com/kb/application/service/DocumentApplicationService.java - Search index
backend/kb-service/src/main/java/com/kb/infrastructure/persistence/elasticsearch/EsIndexService.java - Vector store
backend/kb-service/src/main/java/com/kb/infrastructure/persistence/qdrant - Appointment tool
backend/kb-service/src/main/java/com/kb/infrastructure/rag/tool/AppointmentTool.java - Answer caches
backend/kb-service/src/main/java/com/kb/infrastructure/cache/SemanticCacheService.java
Campus appointments
- CAS assistant API
backend/cas-service/cas-module-appointment/src/main/java/com/laoliu/cas/appointment/interfaces/controller/assistant/AppointmentAssistantController.java - Appointment assistant
backend/cas-service/cas-module-appointment/src/main/java/com/laoliu/cas/appointment/application/service/AppointmentAssistantService.java - Booking lifecycle
backend/cas-service/cas-module-appointment/src/main/java/com/laoliu/cas/appointment/application/service/impl/BookServiceImpl.java - Campus service catalog
backend/cas-service/cas-module-appointment/src/main/java/com/laoliu/cas/appointment/application/service/impl/ServiceItemServiceImpl.java - Consultation chat
backend/cas-service/cas-module-appointment/src/main/java/com/laoliu/cas/appointment/application/service/impl/ConsultChatServiceImpl.java - Appointment events
backend/cas-service/cas-module-appointment/src/main/java/com/laoliu/cas/appointment/infrastructure/mq/BookingEventPublisher.java
Identity and services
- API gateway
backend/gateway/src/main/java/com/laoliu/gateway/GatewayApplication.java - Account and RBAC
backend/cas-service/cas-module-system/src/main/java/com/laoliu/cas/system/application/service/AuthService.java - Email service
backend/cas-service/cas-module-infra-api/src/main/java/com/laoliu/cas/infra/api/email/EmailService.java
Other components
- Campus user
Connections 25
- Campus user → Vue application: uses
README.md - Vue application → API gateway: calls APIs
README.md - API gateway → QA endpoint: routes requests
- QA endpoint → QA orchestration: delegates
- QA orchestration → Conversation state: maintains context
backend/kb-service/src/main/java/com/kb/application/service/QaApplicationService.java - QA orchestration → Answer pipeline: retrieves and generates
backend/kb-service/src/main/java/com/kb/application/service/QaApplicationService.java - Answer pipeline → Hybrid retrieval: retrieves
- Hybrid retrieval → Search index: keyword search
- Hybrid retrieval → Vector store: vector search
- Hybrid retrieval → Embedding provider: embeds queries
- Answer pipeline → LLM and tools: generates answers
- Document ingestion → Embedding provider: embeds chunks
- Document ingestion → Search index: indexes documents
- Document ingestion → Vector store: stores vectors
- LLM and tools → Appointment tool: calls tools
backend/kb-service/src/main/java/com/kb/infrastructure/rag/llm/LangChain4jLlmService.java - Appointment tool → CAS assistant API: queries CAS
README.md - CAS assistant API → Appointment assistant: delegates
- Appointment assistant → Booking lifecycle: confirms drafts
backend/cas-service/cas-module-appointment/src/main/java/com/laoliu/cas/appointment/application/service/AppointmentAssistantService.java - Appointment assistant → Campus service catalog: queries services
backend/cas-service/cas-module-appointment/src/main/java/com/laoliu/cas/appointment/application/service/AppointmentAssistantService.java - Campus user → Booking lifecycle: books services
README.md - Booking lifecycle → Appointment events: publishes changes
README.md - Appointment events → Answer caches: invalidates caches
README.md - Campus user → Consultation chat: messages teacher
README.md - Campus user → Account and RBAC: authenticates
README.md - Booking lifecycle → Email service: sends review notices
README.md