Agent Foundation
Java Spring Boot base platform for multiple enterprise agents (CRM assistant, knowledge-base assistant, customer service assistant).
Core API
- POST
/v1/chat/completions - GET
/v1/healthz
Agent Gateway Architecture
agent-foundation is the company AI gateway and agent orchestration service.
It should stay focused on:
- WeCom / API entrypoints
- user identity and permission context
- intent recognition
- capability routing
- model gateway calls
- logs, audit, and runtime diagnostics
Business-heavy features such as CRM data, knowledge base, PPT generation, bidding documents, reports, and media operations should be implemented as separate capability handlers first, and can later be split into independent services.
Current runtime flow:
WeCom / API
-> AgentOrchestratorService
-> IntentRecognitionService
-> CapabilityRegistry
-> AgentCapabilityHandler
To add a new business skill:
- Add a new intent in
AgentIntent. - Add keyword / LLM routing rules in
IntentRecognitionService. - Implement
AgentCapabilityHandler. - Mark it as a Spring
@Component. - Test it through
/v1/agent/messagesor WeCom.
Agent Runtime API
- POST
/v1/agent/messages - GET
/v1/agent/capabilities
Example:
curl -X POST "http://127.0.0.1:8880/v1/agent/messages" \
-H "Content-Type: application/json" \
-H "X-Agent-Id: crm-assistant" \
-H "X-Internal-Key: crm-dev-key" \
-d '{"wecomUserId":"YiNianYiQingJing","message":"今日客资情况"}'
WeCom CRM Bot Integration
- Callback URL:
/v1/integrations/wecom/callback - Receive enterprise WeCom text messages and route to
crm-assistant - Send the model response back to the same WeCom user
Required env vars
DEEPSEEK_API_KEYWECOM_CORP_IDWECOM_AGENT_IDWECOM_SECRETWECOM_TOKEN
WeCom backend settings
- Create a WeCom self-built app.
- Enable message receive API and set callback URL to:
https://your-domain/v1/integrations/wecom/callback
- Set callback Token equal to
WECOM_TOKEN. - Make sure app has send-message permission to internal users.
Run
- Set env vars.
- Start app from IDE or
mvn spring-boot:run.
Description
Languages
Java
100%