This guide helps you migrate from the old backend/ structure to the new stillme_core/ framework structure.
The StillMe codebase has been refactored into a modular framework:
- Old: Components in
backend/validators/,backend/vector_db/, etc. - New: Core framework in
stillme_core/, app-specific code inbackend/
✅ Backward Compatibility Maintained: All old imports continue to work via adapters.
You can migrate gradually or continue using old imports. Both work!
Old:
from backend.validators import ValidatorChain
from backend.validators.citation import CitationRequiredNew (Recommended):
from stillme_core.validation import ValidationEngine
from stillme_core.validation import CitationRequiredOld Still Works (via adapter):
from backend.validators import ValidatorChain # Still works!Old:
from backend.vector_db.rag_retrieval import RAGRetrieval
from backend.vector_db.chroma_client import ChromaClientNew (Recommended):
from stillme_core.rag import RAGRetrieval
from stillme_core.rag import ChromaClientOld Still Works (via adapter):
from backend.vector_db.rag_retrieval import RAGRetrieval # Still works!Old:
from backend.external_data import ExternalDataOrchestrator
from backend.external_data.providers.weather import WeatherProviderNew (Recommended):
from stillme_core.external_data import ExternalDataOrchestrator
from stillme_core.external_data.providers.weather import WeatherProviderOld Still Works (via adapter):
from backend.external_data import ExternalDataOrchestrator # Still works!Old:
from backend.services.learning_scheduler import LearningScheduler
from backend.services.content_curator import ContentCuratorNew (Recommended):
from stillme_core.learning import LearningScheduler
from stillme_core.learning import ContentCuratorOld Still Works (via adapter):
from backend.services.learning_scheduler import LearningScheduler # Still works!Old:
from backend.postprocessing import QualityEvaluator
from backend.postprocessing.rewrite_llm import RewriteLLMNew (Recommended):
from stillme_core.postprocessing import QualityEvaluator
from stillme_core.postprocessing import RewriteLLMOld Still Works (via adapter):
from backend.postprocessing import QualityEvaluator # Still works!Old:
from backend.validators import ValidatorChain
chain = ValidatorChain([...])New:
from stillme_core.validation import ValidationEngine
engine = ValidationEngine([...])Backward Compatibility:
from stillme_core.validation import ValidatorChain # Alias for ValidationEngine
# Or
from backend.validators import ValidatorChain # Still works via adapterYou can update imports gradually. Start with new code:
# New code uses new imports
from stillme_core.validation import ValidationEngine
# Old code continues to work
from backend.validators import ValidatorChain # Still works!If you want to use new class names:
# Old
from backend.validators import ValidatorChain
chain = ValidatorChain([...])
# New
from stillme_core.validation import ValidationEngine
engine = ValidationEngine([...])New APIs may have additional features:
# Unified metrics (new)
from stillme_core.monitoring import get_metrics_collector
metrics = get_metrics_collector()
metrics.record_validation(...)- Review your codebase for old imports
- Decide: gradual migration or keep old imports
- Update new code to use
stillme_core/imports - Test thoroughly after changes
- Update documentation if needed
Problem: ImportError: cannot import name 'X' from 'backend.Y'
Solution: Use new import path:
# Old (may break)
from backend.validators import X
# New (works)
from stillme_core.validation import XProblem: ValidatorChain not found
Solution: Use ValidationEngine or import alias:
# Option 1: Use new name
from stillme_core.validation import ValidationEngine
# Option 2: Use alias
from stillme_core.validation import ValidatorChain # Alias for ValidationEngineProblem: Method doesn't exist on new class
Solution: Check API documentation. Some methods may have been renamed or moved.
After migrating, test thoroughly:
- Unit Tests: Run all unit tests
- Integration Tests: Test component interactions
- End-to-End Tests: Test full pipeline
- Manual Testing: Test critical user flows
If you encounter issues:
- Keep Old Imports: Old imports still work via adapters
- Gradual Migration: Migrate one module at a time
- Revert Changes: Git allows easy rollback
- Core framework (
stillme_core/) is reusable - App-specific code (
backend/) is separate
- Components grouped by functionality
- Clear dependency direction
- Framework can be packaged as SDK
- Easier to share with community
- Unified metrics system
- Self-improvement mechanisms
- Configuration system
- Check API Reference
- Check Architecture Guide
- Review existing code in
stillme_core/