102 lines
2.8 KiB
Markdown
102 lines
2.8 KiB
Markdown
# Technology Stack
|
|||
|
|
|
||
|
|
## Core Technologies
|
||
|
|
|
||
|
|
- **Python 3.8+**: Primary programming language
|
||
|
|
- **asyncio**: Asynchronous programming for concurrent operations
|
||
|
|
- **aiohttp**: HTTP client for API interactions
|
||
|
|
- **PyYAML**: Configuration file management
|
||
|
|
- **Anthropic Claude API**: AI-powered content analysis and understanding
|
||
|
|
- **Obsidian Local REST API**: Integration with Obsidian vault
|
||
|
|
|
||
|
|
## Key Dependencies
|
||
|
|
|
||
|
|
```
|
||
|
|
anthropic>=0.25.0 # Claude API client
|
||
|
|
aiohttp>=3.9.0 # Async HTTP client
|
||
|
|
pyyaml>=6.0 # YAML configuration parsing
|
||
|
|
```
|
||
|
|
|
||
|
|
## Architecture Patterns
|
||
|
|
|
||
|
|
### Command + Skill Pattern
|
||
|
|
- **Commands**: High-level operations that orchestrate multiple Skills
|
||
|
|
- **Skills**: Atomic functional units for specific tasks (READ, WRITE, ANALYZE, TRANSFORM, INTEGRATE)
|
||
|
|
- **Agent Core**: Base framework defining interfaces and interaction logic
|
||
|
|
|
||
|
|
### Async/Await Pattern
|
||
|
|
- All Skills and Commands use async/await for non-blocking operations
|
||
|
|
- HTTP API calls are asynchronous using aiohttp
|
||
|
|
- Supports concurrent execution of multiple operations
|
||
|
|
|
||
|
|
### Configuration-Driven Design
|
||
|
|
- YAML-based configuration files for all settings
|
||
|
|
- Environment variable support for sensitive data
|
||
|
|
- Separation of code and configuration
|
||
|
|
|
||
|
|
## Common Commands
|
||
|
|
|
||
|
|
### Development Setup
|
||
|
|
```bash
|
||
|
|
# Install dependencies
|
||
|
|
pip install -r requirements.txt
|
||
|
|
|
||
|
|
# Copy and configure settings
|
||
|
|
cp config.example.yaml config.yaml
|
||
|
|
# Edit config.yaml with your API keys and paths
|
||
|
|
```
|
||
|
|
|
||
|
|
### Running the Application
|
||
|
|
|
||
|
|
#### v1.0 - Direct Commands
|
||
|
|
```bash
|
||
|
|
# Organize today's journal
|
||
|
|
python -m journal_organizer organize
|
||
|
|
|
||
|
|
# Organize specific date
|
||
|
|
python -m journal_organizer organize --date 2025-12-31
|
||
|
|
|
||
|
|
# List available commands
|
||
|
|
python -m journal_organizer list
|
||
|
|
|
||
|
|
# Get help for specific command
|
||
|
|
python -m journal_organizer help organize
|
||
|
|
```
|
||
|
|
|
||
|
|
#### v2.0 - Conversational Interface
|
||
|
|
```bash
|
||
|
|
# Start interactive chat
|
||
|
|
python -m journal_organizer.chat_main
|
||
|
|
|
||
|
|
# Single query mode
|
||
|
|
python -m journal_organizer.chat_main --query "整理今天的日记"
|
||
|
|
```
|
||
|
|
|
||
|
|
### Configuration
|
||
|
|
```bash
|
||
|
|
# Use custom config file
|
||
|
|
python -m journal_organizer --config /path/to/config.yaml organize
|
||
|
|
|
||
|
|
# Set log level
|
||
|
|
python -m journal_organizer --log-level DEBUG organize
|
||
|
|
```
|
||
|
|
|
||
|
|
## API Integration Requirements
|
||
|
|
|
||
|
|
### Obsidian Setup
|
||
|
|
1. Install "Local REST API" plugin in Obsidian
|
||
|
|
2. Generate API key in plugin settings
|
||
|
|
3. Configure API URL (default: https://localhost:27123)
|
||
|
|
4. Disable SSL verification for local development
|
||
|
|
|
||
|
|
### Claude API Setup
|
||
|
|
1. Obtain Anthropic API key
|
||
|
|
2. Set environment variable: `ANTHROPIC_API_KEY`
|
||
|
|
3. Configure model in config.yaml (default: claude-3-5-sonnet-20241022)
|
||
|
|
|
||
|
|
## Error Handling Patterns
|
||
|
|
|
||
|
|
- All Skills return `SkillResult` objects with success/failure status
|
||
|
|
- Comprehensive logging at DEBUG, INFO, WARNING, ERROR levels
|
||
|
|
- Graceful degradation when external APIs are unavailable
|
||
|
|
- SSL context configuration for local HTTPS endpoints
|