AI/ML satellite for AnNa file-sync platform. Provides intelligent file analysis, categorization, and metadata extraction without bloating the core AnNa sync engine.
AnNa (AnNa) = Peer-to-peer file synchronization (pure sync, zero AI)
AnNa-ML (this repo) = Optional AI/ML analysis layer (pluggable, independent)
- Decoupled: No dependencies on AnNa internals; communicates via REST API only
- Optional: AnNa works perfectly without this layer; ML features are add-ons
- Standalone: Runs as separate service; can be scaled independently
- Specialized: ML models and tensor operations stay here, not in AnNa
// File type classification beyond MIME types
- Document classification (memo, report, contract, etc.)
- Code language detection + syntax awareness
- Image content recognition (photo, diagram, screenshot)
- Media type inference (video quality, audio codec)// Smart extraction from file content
- Document: Title, author, creation date, summary
- Code: Language, framework, dependencies, test coverage
- Images: Dimensions, EXIF data, text extraction (OCR)
- Archives: Contents inventory without extraction// Beyond hash-based dedup
- Similar file detection (fuzzy matching)
- Duplicate image detection (perceptual hashing)
- Text similarity for near-duplicates// Malware and threat assessment
- File signature validation
- Malware detection integration (ClamAV, VirusTotal)
- Suspicious pattern detection// Full-text and semantic search
- OCR + text extraction indexing
- Image reverse search integration
- Semantic search via embeddings// All communication via REST/HTTP, no shared data structures
POST /analyze
{
"file_hash": "abc123...",
"file_path": "path/to/file.pdf",
"file_size": 1024000,
"mime_type": "application/pdf"
}
Response:
{
"classification": {
"document_type": "report",
"language": "english",
"confidence": 0.95
},
"metadata": {
"title": "Q3 Report",
"author": "Team",
"created": "2026-06-01"
},
"security": {
"risk_level": "safe",
"malware_scan": "clean"
}
}When a file arrives in AnNa:
- AnNa stores file normally (no changes)
- AnNa optionally POSTs to AnNa-ML
/analyzeendpoint - AnNa-ML processes asynchronously, returns metadata
- AnNa stores metadata in SQLite (optional enhancement)
- User can query via AnNa API
/files/{hash}/metadata
No bloat in AnNa: If AnNa-ML is not running, AnNa continues working perfectly.
- Rust + Tokio — async processing
- Axum — REST API server
- ONNX Runtime — ML model execution (cross-platform)
- Candle / ndarray — tensor operations
- ClamAV — malware detection integration
- Tesseract/OCR — text extraction from images
- Vision Transformer (ViT) for image classification
- ELECTRA for document text classification
- SentenceTransformer for semantic search
- Perceptual hashing for duplicate detection
- Containerized (Docker) with model registry
- Optional: Model quantization for edge deployment
- GPU support where available, CPU fallback
AnNa-ML/
├── server/
│ ├── src/
│ │ ├── main.rs
│ │ ├── api.rs REST handlers
│ │ ├── classification.rs File type classification
│ │ ├── metadata.rs Metadata extraction
│ │ ├── security.rs Malware detection
│ │ ├── indexing.rs Search indexing
│ │ └── models.rs Model loading + inference
│ ├── models/ ONNX model files (git-lfs)
│ └── Cargo.toml
│
├── client/
│ ├── src/
│ │ └── lib.rs Client SDK (optional)
│ └── package.json
│
├── tests/
│ └── integration.rs
│
└── docker/
├── Dockerfile Standard + GPU variants
└── models.env Model registry URLs
- No data retention: Analyzes files in memory, discards immediately
- GDPR compliant: No personal data stored or transmitted
- Optional: Users can run without ML layer for privacy-first sync
- Sandbox: Runs in separate container/process from AnNa
# Start AnNa (pure file-sync)
cd AnNa && cargo run --release
# In another terminal, start AnNa-ML (optional)
cd AnNa-ML && cargo run --release
# AnNa automatically detects /analyze endpoint
# Files uploaded to AnNa are enriched with ML metadata
# If AnNa-ML is down, AnNa continues working normally- Establish repo and architecture
- Basic REST API server
- Model loading pipeline
- Document classification
- Image classification
- Malware detection integration
- Semantic search indexing
- Similarity detection
- Custom model support
- Performance optimization
- GPU support
- Model quantization
- Monitoring & observability
A: ML/tensor dependencies are heavy. AnNa users who want lightweight sync shouldn't pay the cost. This way, file-sync works offline and without Python/CUDA overhead.
A: Service discovery: AnNa polls /health on localhost:8001. If healthy, it sends POST /analyze on each file. No hard coupling.
A: AnNa continues unaffected. Files sync normally, just without metadata. Users retry when ML service is healthy.
A: Yes. Quantized ONNX models fit on mobile/Raspberry Pi. AnNa-ML can be deployed to any Rust-capable device.
This is part of the JakeDot organization's security-first philosophy. All AI/ML features must:
- Not degrade AnNa's core file-sync performance
- Be independently deployable
- Have zero hard dependencies on AnNa internals
- Include security review (especially for model inputs)
- Respect user privacy (no data retention)
See CONTRIBUTING.md for guidelines.
Status: Planning phase
Sister Project: AnNa
Maintained by: JakeDot Organization
⚓