AI Agents
Sidian's AI Agents are intelligent assistants that help you write, understand, and refactor code. This guide explains how to interact with AI Agents and leverage their capabilities to enhance your development process.
AI Agent Overview
Sidian provides several specialized AI Agents to assist with different aspects of development:
Code Assistant
- Code completion and suggestions
- Function and class generation
- Code refactoring assistance
- Bug detection and fixes
Explanation Agent
- Code explanation and documentation
- Algorithm analysis
- Architecture insights
- Learning recommendations
Interacting with AI Agents
There are multiple ways to interact with Sidian's AI Agents:
Chat Interface
- Open AI chat panel from the sidebar
- Type your question or request in natural language
- The AI will provide contextual responses based on your current code
- Follow up with additional questions for clarification
Inline Assistance
- Select code and press Ctrl+Shift+L for explanations
- Right-click on code for context menu options
- Use keyboard shortcuts for quick AI actions
- Hover over errors for AI-powered fix suggestions
Pro Tip: The AI Agents understand your project context, including imported libraries, coding patterns, and project structure. This enables more accurate and relevant assistance.
Agent Capabilities
Code Generation
- Function creation: Describe what you want and get complete functions
- Class scaffolding: Generate class structures with methods and properties
- Test generation: Create unit tests for your existing code
- Documentation: Generate comments and documentation
Code Analysis
- Bug detection: Identify potential issues in your code
- Performance optimization: Suggest improvements for better performance
- Security analysis: Find security vulnerabilities
- Code quality: Recommend best practices and patterns
Refactoring Assistance
- Extract methods: Break down large functions
- Rename variables: Consistent naming across files
- Organize imports: Clean up and optimize imports
- Code formatting: Apply consistent styling
Best Practices
Effective Communication
- Be specific: Provide clear, detailed requests
- Include context: Mention the programming language and framework
- Ask follow-ups: Don't hesitate to ask for clarification
- Provide examples: Show what you're trying to achieve
Code Review
- Always review: Never accept AI-generated code without review
- Test thoroughly: Run tests and verify functionality
- Understand changes: Make sure you understand what the AI did
- Maintain style: Ensure consistency with your codebase
Privacy and Security
- Sensitive data: Be cautious with proprietary or sensitive code
- API keys: Never share API keys or credentials
- Review suggestions: Verify security implications of AI suggestions
- Local processing: Use offline mode for sensitive projects
Advanced Features
Custom Prompts
Create reusable prompts for common tasks:
Context Management
- File context: AI considers the current file and related files
- Project context: Understanding of project structure and dependencies
- History context: Previous conversations inform current responses
- Selection context: Focus on selected code for targeted assistance
Model Selection
Choose the right AI model for your task:
- Fast models: Quick responses for simple tasks
- Advanced models: Complex reasoning and code generation
- Specialized models: Language-specific or domain-specific models
- Local models: Privacy-focused offline processing
Troubleshooting
Common Issues
AI not responding
- For cloud models: Check internet connection
- For local models: Verify Ollama/LM Studio is running
- Verify account status and subscription
- Try refreshing the AI connection
Inaccurate suggestions
- Provide more context in your request
- Be more specific about requirements
- Try rephrasing your question
- Use a different AI model
Performance issues
- Close unnecessary files and tabs
- Clear AI conversation history
- Switch to a faster AI model
- Check system resources
Getting Help
- Documentation: Comprehensive guides and tutorials
- Support: Direct assistance from the Sidian team
- Feedback: Report issues and suggest improvements
The AI Agents in Sidian are designed to be your coding companions, helping you write better code faster while learning and improving your skills along the way.