Home Gallery AISPA Paper GitHub Follow

higress system prompt

Category: General-purpose assistants. Audited against the AISPA standard.

2 Prompts on record
0 Flagged instructions
AI audit Audit source
D1 · Identity Transparency D2 · Truthfulness & Information Integrity D3 · Privacy & Data Protection D4 · Tool/Action Safety D5 · User Agency & Manipulation Prevention D6 · Unsafe Request Handling D7 · Harm Prevention & User Safety D8 · Fairness, Inclusion & Neutrality

higress - plugins wasm rust extensions ai intent README

2905 characters

--- title: AI 意图识别 keywords: [ AI网关, AI意图识别 ] description: AI 意图识别插件配置参考 --- ## 功能说明 LLM 意图识别插件,能够智能判断用户请求与某个领域或agent的功能契合度,从而提升不同模型的应用效果和用户体验 ## 运行属性 插件执行阶段:`默认阶段` 插件执行优先级:`700` ## 配置说明 > 1.该插件的优先级高于ai-proxy等后续使用意图的插件,后续插件可以通过proxywasm.GetProperty([]string{"intent_category"})方法获取到意图主题,按照意图主题去做不同缓存库或者大模型的选择 > 2.需新建一条higress的大模型路由,供该插件访问大模型,如:路由以 /intent 作为前缀,服务选择大模型服务,为该路由开启ai-proxy插件 > 3.需新建一个固定地址的服务(如:intent-service),服务指向127.0.0.1:80 (即自身网关实例+端口),ai-intent插件内部需要该服务进行调用,以访问上述新增的路由,服务名对应 llm.proxyServiceName(也可以新建DNS类型服务,使插件访问其他大模型) > 4.如果使用固定地址的服务调用网关自身,需把127.0.0.1加入到网关的访问白名单中 | 名称 | 数据类型 | 填写要求 | 默认值 | 描述 | | -------------- | --------------- | -------- | ------ | ------------------------------------------------------------ | | `scene.categories[].use_for` | string | 必填 | - | | | `scene.categories[].options` | array of string | 必填 | - | | | `scene.prompt` | string | 非必填 | You are an intelligent category recognition assistant, responsible for determining which preset category a question belongs to based on the user's query and predefined categories, and providing the corresponding category. <br>The user's question is: '${question}'<br>The preset categories are: <br>${categories}<br><br>Please respond directly with the category in the following manner:<br>useFor:scene1;result:result1;<br>useFor:scene2;result:result2;<br>Ensure that different `useFor` are on different lines, and that `useFor` and `result` appear on the same line. | llm请求prompt模板 | | `llm.proxy_service_name` | string | 必填 | - | 新建的higress服务,指向大模型 (取higress中的 FQDN 值)| | `llm.proxy_url` | string | 必填 | - | 大模型路由请求地址全路径,可以是网关自身的地址,也可以是其他大模型的地址(openai协议),例如:http://127.0.0.1:80/intent/compatible-mode/v1/chat/completions | | `llm.proxy_domain` | string | 非必填 | proxyUrl中解析获取 | 大模型服务的domain| | `llm.proxy_port` | number | 非必填 | proxyUrl中解析获取 | 大模型服务端口号 | | `llm.proxy_api_key` | string | 非必填 | - | 当使用外部大模型服务时需配置 对应大模型的 API_KEY | | `llm.proxy_model` | string | 非必填 | qwen-long | 大模型类型 | | `llm.proxy_timeout` | number | 非必填 | 10000 | 调用大模型超时时间,单位ms,默认:10000ms | ## 配置示例 ```yaml scene: category: - use_for: intent-route options: - Finance - E-commerce - Law - Others - use_for: disable-cache options: - Time-sensitive - An innovative response is needed - Others llm: proxy_service_name: "intent-service.static" proxy_url: "http://127.0.0.1:80/intent/compatible-mode/v1/chat/completions" proxy_domain: "127.0.0.1" proxy_port: 80 proxy_model: "qwen-long" proxy_api_key: "" proxy_timeout: 10000 ```

higress - hgctl pkg agent prompt agent guide

8044 characters

// Copyright (c) 2025 Alibaba Group Holding Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. # Agent Development Guide Welcome to this AgentScope agent directory! This guide helps AI CLI tools (like Claude Code) understand the structure and assist you in building powerful agents. ## Directory Overview This is an automatically generated agent directory with the following structure: - **agent.py** - Main agent class (generated from agent.tmpl) - **toolkit.py** - Agent's tools and MCP integrations (generated from toolkit.tmpl) - **prompt.md** - User-provided system prompt for the agent - **as_runtime_main.py** / **agentrun_main.py** - Deployment runtime files - **agent.tmpl** / **toolkit.tmpl** / **agentscope.tmpl** - Generation templates ## What You Should Do ### Primary Focus: Improve Agent Intelligence Your role is to help users build more capable, "agentic" agents by: 1. **Editing agent.py** - Enhance the agent class with: - Custom reasoning logic - Agent-specific hooks and behaviors - Memory management strategies - Multi-step task handling 2. **Editing toolkit.py** - Expand agent capabilities by: - Adding new tool functions - Integrating MCP (Model Context Protocol) servers - Configuring tool access and permissions 3. **Editing prompt.md** (when requested) - Refine the system prompt to: - Improve agent behavior and personality - Add domain-specific instructions - Define task-specific guidelines ### Critical Constraints **DO NOT MODIFY** these deployment files: - `as_runtime_main.py` - `agentrun_main.py` These files handle agent deployment and runtime orchestration. They are managed by the agent framework and should not be changed during development. ## Learning AgentScope Before helping users, you should become proficient with AgentScope: ### Use the DeepWiki MCP Server You have access to the `mcp-deepwiki` server. Use it to learn about AgentScope: ```python # Query the AgentScope repository ask_question( repoName="agentscope-ai/agentscope", question="How does the ReActAgent work?" ) ``` Study these key concepts: - ReActAgent architecture (Reasoning + Acting loop) - Agent hooks and lifecycle methods - Toolkit and tool registration - Memory systems (short-term and long-term) - Message formatting and model integration - MCP integration for external tools ### Testing Your Agent Use the `agentscope-test-runner` subagent to test agent functionality: ```python # Launch test runner to validate agent behavior Task( subagent_type="agentscope-test-runner", prompt="Test the agent's ability to handle multi-step tasks", description="Testing agent functionality" ) ``` **Don't** write your own test harness - use this specialized subagent. ## Building Great Agents: Examples ### Example 1: Browser Automation Agent Based on the AgentScope BrowserAgent, here's how to build a specialized web agent: **Key Patterns:** 1. **Extend ReActAgent** - Inherit from ReActAgent for reasoning-acting loop 2. **Use Hooks** - Register instance hooks to customize behavior at different lifecycle points: - `pre_reply` - Run before generating responses - `pre_reasoning` - Execute before reasoning phase - `post_reasoning` - Execute after reasoning phase - `post_acting` - Execute after taking actions 3. **Manage Memory** - Implement memory summarization to prevent context overflow 4. **Leverage MCP Tools** - Connect to MCP servers (like Playwright browser tools) via toolkit ```python class Agent(ReActAgent): def __init__(self, name, model, formatter, memory, toolkit, ...): super().__init__(name, sys_prompt, model, formatter, memory, toolkit, max_iters) # Register custom hooks self.register_instance_hook( "pre_reply", "custom_hook_name", custom_hook_function ) ``` ### Example 2: Research Agent For research and analysis tasks: **Key Features:** - Knowledge base integration for RAG (Retrieval-Augmented Generation) - Long-term memory for persistent context - Plan notebook for complex multi-step research - Query rewriting for better information retrieval ```python class Agent(ReActAgent): def __init__( self, name, sys_prompt, model, formatter, toolkit, memory, long_term_memory=None, knowledge=None, enable_rewrite_query=True, plan_notebook=None, ... ): # Initialize with research-focused capabilities super().__init__(...) ``` ### Example 3: Code Assistant Agent For software development tasks: **Key Capabilities:** - File operation tools (read, write, insert) - Code execution (execute_python_code, execute_shell_command) - Image/audio processing for multimodal interactions - MCP integration for IDE tools ### Common Agent Patterns 1. **Tool Registration** (in toolkit.py): ```python from agentscope.tool import Toolkit from agentscope.tool import execute_shell_command, view_text_file toolkit = Toolkit() toolkit.register_tool_function(execute_shell_command) toolkit.register_tool_function(view_text_file) ``` 2. **MCP Integration** (in toolkit.py): ```python from agentscope.mcp import HttpStatelessClient async def register_mcp(toolkit): client = HttpStatelessClient( name="browser-tools", transport="sse", url="http://localhost:3000/sse" ) await toolkit.register_mcp_client(client) ``` 3. **Custom Hooks** (in agent.py): ```python async def pre_reasoning_hook(self, *args, **kwargs): """Custom logic before reasoning""" # Add context, check conditions, etc. pass # In __init__: self.register_instance_hook("pre_reasoning", "my_hook", pre_reasoning_hook) ``` ## More Examples and Resources Explore official AgentScope examples: - https://github.com/modelscope/agentscope/tree/main/examples/agent Key examples to study: - **ReAct Agent** - Basic reasoning-acting agent - **Conversation Agent** - Multi-turn dialogue handling - **User Agent** - Human-in-the-loop interactions - **Tool Agent** - Advanced tool usage patterns ## Development Workflow 1. **Understand Requirements** - Clarify what the agent should do 2. **Learn Patterns** - Use DeepWiki to research relevant AgentScope patterns 3. **Design Agent** - Choose base class and required capabilities 4. **Implement in agent.py** - Write custom agent logic 5. **Add Tools in toolkit.py** - Register needed tools and MCP servers 6. **Test with agentscope-test-runner** - Validate functionality 7. **Iterate** - Refine based on test results ## Best Practices 1. **Start Simple** - Begin with basic ReActAgent, add complexity as needed 2. **Use Hooks Wisely** - Don't overcomplicate; hooks should have clear purposes 3. **Memory Management** - Implement summarization for long conversations 4. **Tool Selection** - Only add tools the agent actually needs 5. **Clear Prompts** - Write specific, actionable system prompts in prompt.md 6. **Test Iteratively** - Use the test-runner frequently during development ## Getting Help - Use DeepWiki MCP to query AgentScope documentation - Study the browser_agent.py example in this guide - Reference official examples at https://github.com/agentscope-ai/agentscope - Test early and often with agentscope-test-runner --- **Remember:** Focus on making the agent intelligent and capable. The deployment infrastructure is already handled - your job is to build the "brain" of the agent in agent.py and give it the right "tools" in toolkit.py.

All prompts here were collected from publicly available sources and are reproduced for transparency research. Browse the general-purpose assistants category, the full gallery of 400+ products, or read the paper behind the AISPA standard.