System Prompt
Last Updated: 2025-11-14
Overview
The System Prompt is the core setting that defines the AI assistant's behavior and response style. Through carefully designed system prompts, you can have the AI assistant play specific roles, follow specific rules, and respond in ways that meet your business needs.
Place the role description and instructions for the AI assistant, including rules and SOPs to follow when responding. Think of it as rules that must be followed with each response. Only place the essential parts, as too many system prompt instructions may cause the AI to be unable to absorb too many rules, leading to non-compliance. Large amounts of data or data that only needs to be retrieved when relevant questions are asked should be placed in the knowledge base.
Metadata Processing Mechanism
What is Metadata
Metadata is additional information describing knowledge base documents, such as:
Document classification
Creation date
Author information
Permission tags
Other custom attributes
In RAG (Retrieval Augmented Generation) systems, Metadata plays an important role in helping the AI assistant more precisely filter and use knowledge base content.
Metadata Exclusion Logic Optimization
The MaiAgent platform has optimized Metadata processing logic to ensure the system handles metadata more accurately:
Optimization Details
Removed Duplicate Exclusion Logic
In previous versions, the system might repeatedly check and exclude certain Metadata keys, causing unnecessary performance overhead. The new version has removed this duplicate logic, ensuring:
Improved processing efficiency: Reduced redundant checking steps
Clearer logic: Avoid repeated execution of the same exclusion rules
Better maintainability: More concise code structure
Impact Scope
This optimization primarily affects the system's internal Metadata processing flow. For users:
✅ Metadata filtering functionality works normally
✅ Retrieval performance improved
✅ Answer accuracy remains consistent
✅ No need to adjust existing settings
Metadata Application in System Prompts
Basic Usage
In system prompts, you can instruct the AI assistant on how to use Metadata:
Advanced Metadata Applications
Permission Management
Timeliness Control
Multi-language Support
Metadata Best Practices
1. Define Clear Metadata Structure
Establish standardized Metadata architecture:
2. Clearly Explain Metadata Usage Rules in System Prompt
3. Regularly Review Metadata Settings
Confirm whether Metadata classification meets actual usage needs
Check for unused Metadata keys
Evaluate Metadata's impact on retrieval performance
Technical Details
Metadata Processing Flow
Performance Considerations
Index creation: Metadata indexes are created when files are uploaded
Query efficiency: Simple Metadata filtering typically completes in milliseconds
Complex queries: Multi-condition Metadata filtering may take longer
System Limitations
Each document should not exceed 20 Metadata keys
Metadata values should use short strings or numbers
Avoid storing large amounts of text content in Metadata
System Prompt Examples
You are a professional XXX AI assistant.
\ You should (enhance responses):
Provide clear, accurate, and helpful answers
Maintain a friendly and professional conversational attitude
Respond in the user's language, using Traditional Chinese for Chinese
Avoid providing harmful or inappropriate advice
Respect user privacy and do not disclose sensitive information
Use correct Traditional Chinese in responses
Adjust answer detail level based on context
Provide extended suggestions or related information when appropriate
When responding, first confirm whether user information is clearly provided, then provide an answer if clear
Use examples to explain complex concepts when appropriate
You should not (limit responses):
Spread misinformation or unverified claims
Make biased or discriminatory statements
Discuss illegal or inappropriate content
Pretend to be a real person
Exceed the AI assistant's capabilities
For questions outside the knowledge base scope, respond with "Sorry, I cannot answer this question at the moment"
System Prompt Template
Related Resources
Last updated
Was this helpful?
