near-ai
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNEAR AI Development
NEAR AI开发
Comprehensive guide for building AI agents and AI-powered applications on NEAR Protocol, including NEAR AI integration, agent workflows, and AI model deployment.
这是一份在NEAR Protocol上构建AI Agent和AI驱动应用的综合指南,涵盖NEAR AI集成、Agent工作流以及AI模型部署等内容。
When to Apply
适用场景
Reference these guidelines when:
- Building AI agents on NEAR
- Integrating AI models with NEAR smart contracts
- Creating agent-based workflows
- Implementing AI-powered dApps
- Using NEAR AI infrastructure
- Building with NEAR AI Assistant
在以下场景中可参考本指南:
- 在NEAR上构建AI Agent
- 将AI模型与NEAR智能合约集成
- 创建基于Agent的工作流
- 实现AI驱动的dApp
- 使用NEAR AI基础设施
- 基于NEAR AI Assistant进行开发
Rule Categories by Priority
按优先级划分的规则类别
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Agent Architecture | CRITICAL | |
| 2 | AI Integration | HIGH | |
| 3 | Agent Communication | HIGH | |
| 4 | Model Deployment | MEDIUM-HIGH | |
| 5 | Agent Workflows | MEDIUM | |
| 6 | Security & Privacy | MEDIUM | |
| 7 | Best Practices | MEDIUM | |
| 优先级 | 类别 | 影响程度 | 前缀 |
|---|---|---|---|
| 1 | Agent架构 | 关键 | |
| 2 | AI集成 | 高 | |
| 3 | Agent通信 | 高 | |
| 4 | 模型部署 | 中高 | |
| 5 | Agent工作流 | 中 | |
| 6 | 安全与隐私 | 中 | |
| 7 | 最佳实践 | 中 | |
Quick Reference
快速参考
1. Agent Architecture (CRITICAL)
1. Agent架构(关键)
- - Design modular agent architecture
arch-agent-structure - - Manage agent state on-chain vs off-chain
arch-state-management - - Register agents in NEAR AI registry
arch-agent-registry - - Build composable agents
arch-composability - - Define clear agent capabilities
arch-agent-capabilities
- - 设计模块化Agent架构
arch-agent-structure - - 管理Agent的链上与链下状态
arch-state-management - - 在NEAR AI注册表中注册Agent
arch-agent-registry - - 构建可组合的Agent
arch-composability - - 定义清晰的Agent能力
arch-agent-capabilities
2. AI Integration (HIGH)
2. AI集成(高)
- - Choose appropriate AI models
ai-model-selection - - Use NEAR AI inference endpoints
ai-inference-endpoints - - Design effective prompts for agents
ai-prompt-engineering - - Manage conversation context
ai-context-management - - Validate and sanitize AI responses
ai-response-validation
- - 选择合适的AI模型
ai-model-selection - - 使用NEAR AI推理端点
ai-inference-endpoints - - 为Agent设计有效的提示词
ai-prompt-engineering - - 管理对话上下文
ai-context-management - - 验证并清理AI响应
ai-response-validation
3. Agent Communication (HIGH)
3. Agent通信(高)
- - Implement standard agent communication protocols
comm-agent-protocol - - Use structured message formats
comm-message-format - - Handle asynchronous agent communication
comm-async-messaging - - Coordinate multiple agents
comm-multi-agent - - Implement human-in-the-loop patterns
comm-human-in-loop
- - 实现标准的Agent通信协议
comm-agent-protocol - - 使用结构化消息格式
comm-message-format - - 处理Agent异步通信
comm-async-messaging - - 协调多个Agent
comm-multi-agent - - 实现人在回路模式
comm-human-in-loop
4. Model Deployment (MEDIUM-HIGH)
4. 模型部署(中高)
- - Deploy models on NEAR AI infrastructure
model-hosting - - Version and update AI models
model-versioning - - Optimize models for inference
model-optimization - - Monitor model performance
model-monitoring - - Implement fallback strategies
model-fallbacks
- - 在NEAR AI基础设施上部署模型
model-hosting - - 对AI模型进行版本管理与更新
model-versioning - - 优化模型以提升推理性能
model-optimization - - 监控模型性能
model-monitoring - - 实现降级策略
model-fallbacks
5. Agent Workflows (MEDIUM)
5. Agent工作流(中)
- - Implement agent task planning
workflow-task-planning - - Execute multi-step workflows
workflow-execution - - Handle workflow errors gracefully
workflow-error-handling - - Persist workflow state
workflow-state-persistence - - Compose workflows from smaller tasks
workflow-composability
- - 实现Agent任务规划
workflow-task-planning - - 执行多步骤工作流
workflow-execution - - 优雅处理工作流错误
workflow-error-handling - - 持久化工作流状态
workflow-state-persistence - - 基于小型任务组合工作流
workflow-composability
6. Security & Privacy (MEDIUM)
6. 安全与隐私(中)
- - Validate user inputs to agents
security-input-validation - - Sanitize agent outputs
security-output-sanitization - - Implement agent access control
security-access-control - - Protect user data privacy
security-data-privacy - - Prevent prompt injection attacks
security-prompt-injection
- - 验证Agent的用户输入
security-input-validation - - 清理Agent输出内容
security-output-sanitization - - 实现Agent访问控制
security-access-control - - 保护用户数据隐私
security-data-privacy - - 防范提示词注入攻击
security-prompt-injection
7. Best Practices (MEDIUM)
7. 最佳实践(中)
- - Provide clear error messages
best-error-messages - - Log agent interactions for debugging
best-logging - - Test agent behavior comprehensively
best-testing - - Document agent capabilities and APIs
best-documentation - - Collect and incorporate user feedback
best-user-feedback
- - 提供清晰的错误提示信息
best-error-messages - - 记录Agent交互信息用于调试
best-logging - - 全面测试Agent行为
best-testing - - 记录Agent能力与API
best-documentation - - 收集并整合用户反馈
best-user-feedback
How to Use
使用方法
Read individual rule files for detailed explanations and code examples:
rules/arch-agent-structure.md
rules/ai-inference-endpoints.mdEach rule file contains:
- Brief explanation of why it matters
- Incorrect code example with explanation
- Correct code example with explanation
- Additional context and NEAR AI-specific patterns
阅读单个规则文件以获取详细说明和代码示例:
rules/arch-agent-structure.md
rules/ai-inference-endpoints.md每个规则文件包含:
- 简要说明该规则的重要性
- 错误代码示例及解释
- 正确代码示例及解释
- 额外背景信息与NEAR AI特定模式
NEAR AI Components
NEAR AI组件
NEAR AI Hub
NEAR AI Hub
Central registry for AI agents, models, and datasets on NEAR.
NEAR上AI Agent、模型和数据集的中央注册表。
NEAR AI Assistant
NEAR AI Assistant
Infrastructure for building conversational AI agents.
用于构建对话式AI Agent的基础设施。
Agent Registry
Agent注册表
On-chain registry for discovering and interacting with agents.
用于发现和与Agent交互的链上注册表。
Inference Endpoints
推理端点
Decentralized inference infrastructure for AI models.
为AI模型提供的去中心化推理基础设施。
Resources
相关资源
- NEAR AI Documentation: https://docs.near.ai/
- NEAR AI Hub: https://app.near.ai/
- NEAR AI GitHub: https://github.com/near/nearai
- Agent Examples: https://github.com/near/nearai/tree/main/examples
- NEAR AI Research: https://near.ai/research
- NEAR AI文档:https://docs.near.ai/
- NEAR AI Hub:https://app.near.ai/
- NEAR AI GitHub:https://github.com/near/nearai
- Agent示例:https://github.com/near/nearai/tree/main/examples
- NEAR AI研究:https://near.ai/research
Full Compiled Document
完整编译文档
For the complete guide with all rules expanded:
AGENTS.md如需包含所有扩展规则的完整指南,请查看:
AGENTS.md