Project: CortX
Organisation: cortxai
Current Version: v0.5.0
Status: Alpha
This document provides a structured implementation roadmap for CortX that can be ingested by an LLM coding assistant. It explains:
- The current architectural state
- The next implementation phase (v0.5.X)
- A versioned roadmap for upcoming phases
- Architectural constraints that must remain true
- Non-goals (features intentionally deferred)
The goal is to guide development toward the long‑term vision of CortX as a local‑first runtime platform for intelligent systems.
CortX is evolving from a proof‑of‑concept local agentic system into a platform runtime for intelligent software systems.
The long‑term architecture consists of three conceptual layers:
-
CortX Runtime
- Core execution environment
- Module loading
- Pipeline orchestration
- Event system
-
CortX Modules
- Extensions that implement platform capabilities
- Classifiers
- Workers
- Routers
- Model providers
- Tools
- Infrastructure integrations
-
CortX Distributions
- Opinionated system builds
- Provide a complete runnable platform
- Example:
cortx
- Core must remain small — Runtime contains primitives only
- Everything must be replaceable — Models, tools, classifiers, workers, routers
- Modules extend the runtime — Runtime must never depend on modules
- Intelligence must be explicit pipelines — Avoid opaque agent frameworks
- Distributions are separate from the runtime
- COREtex runtime with
coretex/(runtime, interfaces, registries, executor, pipeline, loader, context, events, config) modules/implementing classifier_basic, router_simple, worker_llm, tools_filesystem, model_provider_ollamadistributions/cortx/with FastAPI endpoints and module bootstrap- Pipeline System:
PipelineStepandPipelineDefinitiondataclasses with runtime validation;PipelineRegistrywith pipeline-specific error messages;PipelineRunneracceptsPipelineDefinition;make_default_pipeline()factory;event=pipeline_selectedobservability logging; default pipeline registered in bootstrap; 129 tests
Version numbers follow the format:
0.N.X
Where:
- N = major architectural changes
- X = minor improvements
Examples:
- v0.3.0 → major architectural change
- v0.3.1 → minor improvements or fixes
Version v1.0.0 marks the end of the alpha/beta period.
Configurable execution pipelines were introduced. The hardcoded pipeline was replaced by a structured, modular pipeline system.
PipelineStepdataclass —component_type(validated) +namePipelineDefinitiondataclass —name+ orderedstepslist +get_step()make_default_pipeline()factory — returns 4-step default pipelinePipelineRegistry— pipeline-specific error messages ("Pipeline already registered: <name>","Unknown pipeline: <name>")PipelineRunnerrefactor — acceptsPipelineDefinition, emitsevent=pipeline_selected pipeline=<name>- Bootstrap updated —
pipeline_registrysingleton, default pipeline registered distributions/cortx/main.pyupdated — pipeline retrieved from registry- Test suite expanded: 106 → 129 tests
- Documentation updated: README, IMPLEMENTATION, TESTING, DEVELOPMENT
Introduce a formal ModelProvider abstraction so that the classifier and worker can be configured to use different models or backends. Currently both components call Ollama directly using hardcoded client logic. The v0.5.0 phase will route all model inference through registered ModelProvider instances, enabling hybrid model strategies (e.g., different models for classifier vs worker, or future OpenAI/Anthropic support) without any change to pipeline logic.
File: coretex/interfaces/model_provider.py
class ModelProvider(ABC):
@abstractmethod
async def generate(self, model: str, prompt: str, **kwargs) -> str: ...
@abstractmethod
async def chat(self, model: str, messages: list, **kwargs) -> str: ...File: coretex/registry/model_registry.py
Tasks:
- Ensure
ModelProviderRegistryis a fully validated registry. - Support
register(name: str, provider: ModelProvider)andget(name: str) -> ModelProvider. - Enforce:
- Duplicate registration raises
ValueError("Model provider already registered: <name>") - Unknown lookup raises
ValueError("Unknown model provider: <name>")and logsevent=registry_lookup_failed
- Duplicate registration raises
- Add
list()to enumerate registered providers. - Update error messages to be model-provider-specific (parallel to v0.4.0 PipelineRegistry change).
File: modules/model_provider_ollama/provider.py
- Implement
OllamaProviderfully implementing theModelProviderinterface:generate(model, prompt, **kwargs)— callsPOST /api/generatewithstream=False, returns response textchat(model, messages, **kwargs)— callsPOST /api/chatwithstream=False, returns last message content
- Configure timeouts from
settings.classifier_timeout/settings.worker_timeout - Log
event=model_provider_generate_start/event=model_provider_generate_completewithduration_ms
File: modules/classifier_basic/classifier.py
- Remove direct
httpxclient calls fromClassifierBasic - Inject
model_provider: ModelProviderat construction or lookup by name fromModelProviderRegistry - Route all LLM calls through:
await model_provider.chat(model=settings.classifier_model, messages=[...])- Preserve all existing retry logic, fallback, and structured logging
File: modules/worker_llm/worker.py
- Remove direct
httpxclient calls fromWorkerLLM - Inject
model_provider: ModelProviderat construction or lookup fromModelProviderRegistry - Route all LLM calls through:
await model_provider.generate(model=settings.worker_model, prompt=...)- Preserve existing intent-aware prompts and JSON action envelope behaviour
Files:
modules/classifier_basic/module.py
modules/worker_llm/module.py
modules/model_provider_ollama/module.py
model_provider_ollama/module.py— registerOllamaProvider()as"ollama"inmodel_registryclassifier_basic/module.py— pass model provider name or instance when creatingClassifierBasicworker_llm/module.py— pass model provider name or instance when creatingWorkerLLM
- Ensure
POST /ingestand OpenWebUI continue working with default Ollama configuration - Default model provider is
"ollama"— no configuration change required for existing deployments - Environment variables
CLASSIFIER_MODELandWORKER_MODELcontinue to control model selection
- Log model provider name in classifier and worker events:
event=classifier_start classifier=<name> model_provider=<name>event=worker_start worker=<name> model_provider=<name>
- Provider-level events:
event=model_provider_generate_startevent=model_provider_generate_complete duration_ms=<int>
- Add unit tests for
ModelProviderRegistry(duplicate, unknown lookup, list) - Add unit tests for
OllamaProvider(mocked httpx calls) - Add integration tests confirming classifier and worker use injected provider
- Verify model provider events are emitted in full pipeline run
- Ensure backward compatibility with default pipeline and Ollama
- Update test count target: 150+ tests
- Introduce first CortX distributions (e.g.,
cortx) - Assemble runtime + modules + FastAPI + OpenWebUI
- Support bootstrapped module loading
- Runtime-wide event bus
- Every important action emits structured events
- Enable debugging, observability, metrics, future monitoring integrations
- Refactor tool system into modules
- Example:
tools_filesystem,tools_shell,tools_http,tools_git - Users can add, disable, or create third-party tools
- Completes core modular architecture
- Memory / conversation history
- Multi-agent coordination
- Task Graph / Planner orchestration
- Authentication / authorization
- Async tool execution
- Additional model providers beyond Ollama (foundation only, not implementations)
- Distributed runtime or inference
ModelProviderinterface is complete and documentedModelProviderRegistryhas model-provider-specific error messagesOllamaProviderfully implementsModelProviderinterface with observability events- Classifier and worker route all LLM calls through
ModelProvider - Full structured logging preserved, including model_provider name in step events
- Default pipeline behaves identically to pre-v0.5.0 pipeline
- Test suite expanded to 150+ tests
- No regressions in /ingest or OpenWebUI endpoints
After v0.5.X, COREtex will:
- Support swappable model backends through the
ModelProviderabstraction - Enable hybrid model strategies (different providers for classifier and worker)
- Maintain full determinism and observability
- Provide a foundation for multi-provider inference in future phases