MCPHub LabRegistryspring-ai-alibaba/AssistantAgent
spring-ai-alibaba

spring ai alibaba/AssistantAgent

Built by spring-ai-alibaba β€’ 384 stars

What is spring ai alibaba/AssistantAgent?

Framework for building enterprise-level assistant agents.

How to use spring ai alibaba/AssistantAgent?

1. Install a compatible MCP client (like Claude Desktop). 2. Open your configuration settings. 3. Add spring ai alibaba/AssistantAgent using the following command: npx @modelcontextprotocol/spring-ai-alibaba-assistantagent 4. Restart the client and verify the new tools are active.
πŸ›‘οΈ Scoped (Restricted)
npx @modelcontextprotocol/spring-ai-alibaba-assistantagent --scope restricted
πŸ”“ Unrestricted Access
npx @modelcontextprotocol/spring-ai-alibaba-assistantagent

Key Features

Native MCP Protocol Support
Real-time Tool Activation & Execution
Verified High-performance Implementation
Secure Resource & Context Handling

Optimized Use Cases

Extending AI models with custom local capabilities
Automating system workflows via natural language
Connecting external data sources to LLM context windows

spring ai alibaba/AssistantAgent FAQ

Q

Is spring ai alibaba/AssistantAgent safe?

Yes, spring ai alibaba/AssistantAgent follows the standardized Model Context Protocol security patterns and only executes tools with explicit user-granted permissions.

Q

Is spring ai alibaba/AssistantAgent up to date?

spring ai alibaba/AssistantAgent is currently active in the registry with 384 stars on GitHub, indicating its reliability and community support.

Q

Are there any limits for spring ai alibaba/AssistantAgent?

Usage limits depend on the specific implementation of the MCP server and your system resources. Refer to the official documentation below for technical details.

Official Documentation

View on GitHub

Assistant Agent

English | δΈ­ζ–‡

License Java Spring Boot Spring AI GraalVM

✨ Technical Features

  • πŸš€ Code-as-Action: Agent generates and executes code to complete tasks, rather than just calling predefined tools
  • πŸ”’ Secure Sandbox: AI-generated code runs safely in GraalVM polyglot sandbox with resource isolation
  • πŸ“Š Multi-dimensional Evaluation: Multi-layer intent recognition through Evaluation Graph, precisely guiding Agent behavior
  • πŸ”„ Dynamic Prompt Builder: Dynamically inject context (experiences, knowledge, etc.) into prompts based on scenarios and evaluation results
  • 🧠 Experience Learning: Automatically accumulates successful experiences to continuously improve performance on subsequent tasks
  • ⚑ Fast Response: For familiar scenarios, skip LLM reasoning process and respond quickly based on experience

πŸ“– Introduction

Assistant Agent is an enterprise-grade intelligent assistant framework built on Spring AI Alibaba, adopting the Code-as-Action paradigm to orchestrate tools and complete tasks by generating and executing code. It's an intelligent assistant solution that understands, acts, and learns.

  • <a href="https://java2ai.com/agents/assistantagent/quick-start" target="_blank">Documentation</a>
  • <a href="https://java2ai.com/docs/overview" target="_blank">Spring AI Alibaba</a>

What Can Assistant Agent Do?

Assistant Agent is a fully-featured intelligent assistant with the following core capabilities:

  • πŸ” Intelligent Q&A: Supports unified retrieval architecture across multiple data sources (extensible via SPI for knowledge base, Web, etc.), providing accurate, traceable answers
  • πŸ› οΈ Tool Invocation: Supports MCP, HTTP API (OpenAPI) and other protocols, flexibly access massive tools, combine multiple tools to implement complex business workflows
  • ⏰ Proactive Service: Supports scheduled tasks, delayed execution, event callbacks, letting the assistant proactively serve you
  • πŸ“¬ Multi-channel Delivery: Built-in IDE reply, extensible to DingTalk, Feishu, WeCom, Webhook and other channels via SPI

Why Choose Assistant Agent?

ValueDescription
Cost Reduction24/7 intelligent customer service, significantly reducing manual support costs
Quick IntegrationBusiness platforms can integrate with simple configuration, no extensive development required
Flexible CustomizationConfigure knowledge base, integrate enterprise tools, build your exclusive business assistant
Continuous OptimizationAutomatically learns and accumulates experience, the assistant gets smarter with use

Use Cases

  • Intelligent Customer Service: Connect to enterprise knowledge base, intelligently answer user inquiries
  • Operations Assistant: Connect to monitoring and ticketing systems, automatically handle alerts, query status, execute operations
  • Business Assistant: Connect to CRM, ERP and other business systems, assist employees in daily work

πŸ’‘ The above are just typical scenario examples. By configuring knowledge base and integrating tools, Assistant Agent can adapt to more business scenarios. Feel free to explore.

QA_comparison_en.png Tool_comparison_en.png

Overall Working Principle

Below is an end-to-end flow example of how Assistant Agent processes a complete request:

workflow_en.png

Project Structure

AssistantAgent/
β”œβ”€β”€ assistant-agent-common          # Common tools, enums, constants
β”œβ”€β”€ assistant-agent-core            # Core engine: GraalVM executor, tool registry
β”œβ”€β”€ assistant-agent-extensions      # Extension modules:
β”‚   β”œβ”€β”€ dynamic/               #   - Dynamic tools (MCP, HTTP API)
β”‚   β”œβ”€β”€ experience/            #   - Experience management and FastIntent configuration
β”‚   β”œβ”€β”€ learning/              #   - Learning extraction and storage
β”‚   β”œβ”€β”€ search/                #   - Unified search capability
β”‚   β”œβ”€β”€ reply/                 #   - Multi-channel reply
β”‚   β”œβ”€β”€ trigger/               #   - Trigger mechanism
β”‚   └── evaluation/            #   - Evaluation integration
β”œβ”€β”€ assistant-agent-prompt-builder  # Prompt dynamic assembly
β”œβ”€β”€ assistant-agent-evaluation      # Evaluation engine
β”œβ”€β”€ assistant-agent-autoconfigure   # Spring Boot auto-configuration
└── assistant-agent-start           # Startup module

πŸš€ Quick Start

Prerequisites

  • Java 17+
  • Maven 3.8+
  • DashScope API Key

1. Clone and Build

git clone https://github.com/spring-ai-alibaba/AssistantAgent.git
cd AssistantAgent
mvn clean install -DskipTests

2. Configure API Key

export DASHSCOPE_API_KEY=your-api-key-here

3. Minimal Configuration

The project has built-in default configuration, just ensure the API Key is correct. For customization, edit assistant-agent-start/src/main/resources/application.yml:

spring:
  ai:
    dashscope:
      api-key: ${DASHSCOPE_API_KEY}
      chat:
        options:
          model: qwen-max

4. Start the Application

cd assistant-agent-start
mvn spring-boot:run

All extension modules are enabled by default with sensible configurations; no additional configuration is required for a quick start.

5. Configure Knowledge Base (Connect to Business Knowledge)

πŸ’‘ The framework provides a Mock knowledge base implementation by default for demonstration and testing. Production environments need to connect to real knowledge sources (such as vector databases, Elasticsearch, enterprise knowledge base APIs, etc.) so that the Agent can retrieve and answer business-related questions.

Option 1: Quick Experience (Using Built-in Mock Implementation)

The default configuration has knowledge base search enabled, you can experience it directly:

spring:
  ai:
    alibaba:
      codeact:
        extension:
          search:
            enabled: true
            knowledge-search-enabled: true  # Enabled by default

Option 2: Connect to Real Knowledge Base (Recommended)

Implement the SearchProvider SPI interface to connect to your business knowledge sources:

package com.example.knowledge;

import com.alibaba.assistant.agent.extension.search.spi.SearchProvider;
import com.alibaba.assistant.agent.extension.search.model.*;
import org.springframework.stereotype.Component;
import java.util.*;

@Component  // Add this annotation, Provider will be auto-registered
public class MyKnowledgeSearchProvider implements SearchProvider {

    @Override
    public boolean supports(SearchSourceType type) {
        return SearchSourceType.KNOWLEDGE == type;
    }

    @Override
    public List<SearchResultItem> search(SearchRequest request) {
        List<SearchResultItem> results = new ArrayList<>();
        
        // 1. Query from your knowledge source (vector database, ES, API, etc.)
        // Example: List<Doc> docs = vectorStore.similaritySearch(request.getQuery());
        
        // 2. Convert to SearchResultItem
        // for (Doc doc : docs) {
        //     SearchResultItem item = new SearchResultItem();
        //     item.setId(doc.getId());
        //     item.setSourceType(SearchSourceType.KNOWLEDGE);
        //     item.setTitle(doc.getTitle());
        //     item.setSnippet(doc.getSummary());
        //     item.setContent(doc.getContent());
        //     item.setScore(doc.getScore());
        //     results.add(item);
        // }
        
        return results;
    }

    @Override
    public String getName() {
        return "MyKnowledgeSearchProvider";
    }
}

Common Knowledge Source Integration Examples

Knowledge Source TypeIntegration Method
Vector Database (Alibaba Cloud AnalyticDB, Milvus, Pinecone)Call vector similarity search API in search() method
ElasticsearchUse ES client for full-text or vector search
Enterprise Knowledge Base APICall internal knowledge base REST API
Local DocumentsRead and index local Markdown/PDF files

πŸ“– For more details, refer to: Knowledge Search Module Documentation

🧩 Core Modules

For detailed documentation on each module, please visit our Documentation Site.

Core Modules

ModuleDescriptionDocumentation
EvaluationMulti-dimensional intent recognition through Evaluation Graph with LLM and rule-based enginesQuick Start | Advanced
Prompt BuilderDynamic prompt assembly based on evaluation results and runtime contextQuick Start | Advanced

Tool Extensions

ModuleDescriptionDocumentation
MCP ToolsIntegration with Model Context Protocol servers for tool ecosystem reuseQuick Start | Advanced
Dynamic HTTP ToolsREST API integration through OpenAPI specificationQuick Start | Advanced
Custom CodeAct ToolsBuild custom tools using the CodeactTool interfaceQuick Start | Advanced

Intelligence Capabilities

ModuleDescriptionDocumentation
ExperienceAccumulate and reuse historical successful execution experiences with FastIntent supportQuick Start | Advanced
LearningAutomatically extract valuable experiences from Agent execution historyQuick Start | Advanced
SearchMulti-source unified search engine for knowledge-based Q&AQuick Start | Advanced

Interaction Capabilities

ModuleDescriptionDocumentation
Reply ChannelMulti-channel message reply with routing supportQuick Start | Advanced
TriggerScheduled tasks, delayed execution, and event callback triggersQuick Start | Advanced

Additional Resources

ResourceLink
Quick Start GuideAssistantAgent Quick Start
Secondary Development GuideDevelopment Guide

πŸ“š Reference Documentation

🀝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

πŸ“„ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

πŸ™ Acknowledgments

Global Ranking

8.5
Trust ScoreMCPHub Index

Based on codebase health & activity.

Manual Config

{ "mcpServers": { "spring-ai-alibaba-assistantagent": { "command": "npx", "args": ["spring-ai-alibaba-assistantagent"] } } }