Metadata-Version: 2.4
Name: cosmos-compiler
Version: 0.4.5
Summary: Cosmos Compiler - AI Agent Workflow DSL with DAG support, E401 fail-fast, LSP, and EXPORT schema
Author-email: Luis Alberto Burciaga Miker <luis@solvens.amoris>
License: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Keywords: agents,ai,compiler,cosmos,dag,dsl,llm,workflow
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.11
Requires-Dist: click>=8.1.0
Requires-Dist: httpx>=0.26.0
Requires-Dist: pydantic-settings>=2.1.0
Requires-Dist: pydantic>=2.5.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: rich>=13.7.0
Requires-Dist: structlog>=24.1.0
Requires-Dist: tenacity>=8.2.0
Requires-Dist: typer>=0.12.0
Requires-Dist: typing-extensions>=4.9.0
Provides-Extra: all
Requires-Dist: solvens-core[api,cli,storage,vector]; extra == 'all'
Provides-Extra: api
Requires-Dist: fastapi>=0.109.0; extra == 'api'
Requires-Dist: uvicorn[standard]>=0.27.0; extra == 'api'
Provides-Extra: cli
Requires-Dist: rich>=13.7.0; extra == 'cli'
Requires-Dist: typer>=0.12.0; extra == 'cli'
Provides-Extra: cosmos
Requires-Dist: solvens-core[api,cli,storage,vector]; extra == 'cosmos'
Provides-Extra: dev
Requires-Dist: mypy>=1.8.0; extra == 'dev'
Requires-Dist: pre-commit>=3.6.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Provides-Extra: storage
Requires-Dist: aiosqlite>=0.19.0; extra == 'storage'
Requires-Dist: sqlalchemy>=2.0.0; extra == 'storage'
Provides-Extra: vector
Requires-Dist: chromadb>=0.5.0; extra == 'vector'
Requires-Dist: networkx>=3.0; extra == 'vector'
Requires-Dist: numpy>=1.26.0; extra == 'vector'
Requires-Dist: sentence-transformers>=3.0; extra == 'vector'
Description-Content-Type: text/markdown

# SOLVENS CORE

**AI Operating System - Modular kernel for intelligent agents**

![Version](https://img.shields.io/badge/version-0.1.0--alpha-orange)
![Python](https://img.shields.io/badge/python-3.11+-blue)
![License](https://img.shields.io/badge/license-MIT-green)

---

## Overview

SOLVENS CORE is not an application—it's the **AI Operating System kernel** that powers all applications in the Solvens ecosystem.

Built from the ground up with modularity, extensibility, and reliability in mind, SOLVENS CORE provides:

- **Agent Orchestration**: Coordinate multiple AI agents with task queuing, priorities, and parallel execution
- **Capability Routing**: Intelligently route tasks to optimal providers based on content analysis
- **Multi-Provider Support**: Seamlessly work with OpenAI, Claude, Gemini, Ollama, and more
- **Plugin Architecture**: Extend functionality without modifying core code
- **Event-Driven**: Loose coupling through asynchronous event handling

## Architecture

```
                     ┌─────────────────┐
                     │   SOLVENS CORE  │
                     └────────┬────────┘
                              │
                     ┌────────▼────────┐
                     │   Agent         │
                     │   Orchestrator  │
                     └────────┬────────┘
                              │
        ┌─────────────────────┼─────────────────────┐
        │                     │                     │
        ▼                     ▼                     ▼
    ┌────────┐           ┌────────┐           ┌────────┐
    │Planner │           │Scheduler│           │Memory  │
    └────────┘           └────────┘           └────────┘
                              │
                     ┌────────▼────────┐
                     │  Capability    │
                     │  Router        │
                     └────────┬────────┘
                              │
        ┌─────────────────────┼─────────────────────┐
        │                     │                     │
        ▼                     ▼                     ▼
    ┌────────┐           ┌────────┐           ┌────────┐
    │ Local  │           │ Cloud  │           │Plugins  │
    │Models  │           │Providers│          │Registry │
    └────────┘           └────────┘           └────────┘
```

## Features

### 🎯 Agent Orchestrator
- Task queuing with priorities
- Parallel and sequential execution
- Automatic retries with exponential backoff
- Task cancellation
- Event hooks for monitoring

### 🧭 Capability Router
- Content-based intelligent routing
- Rule-based provider selection
- Cost optimization
- Provider fallback

### 🔌 Plugin System
- Zero core modification for extensions
- Hot reload capability
- Sandboxed execution
- Dynamic provider loading

### 💾 Memory Layer
- Pluggable storage backends (SQLite, Redis, Vector DB)
- Semantic and episodic memory
- Context management

### 🔒 Security
- API keys via environment variables only
- No storage of secrets
- Docker Secrets support

## Supported Providers

| Provider | Type | Status |
|----------|------|--------|
| OpenAI (GPT) | Cloud | ✅ Planned |
| Anthropic (Claude) | Cloud | ✅ Planned |
| Google (Gemini) | Cloud | ✅ Planned |
| Ollama | Local | ✅ Planned |
| DeepSeek | Cloud | ✅ Planned |
| Grok | Cloud | ✅ Planned |
| Sakana | Cloud | ✅ Planned |
| Pollo AI | Cloud | ✅ Planned |

## Installation

```bash
# Clone the repository
git clone https://github.com/SolvensAmoris/solvens-core.git
cd solvens-core

# Install with uv (recommended)
uv sync

# Or with pip
pip install -e .
```

## Quick Start

```python
from solvens import AgentOrchestrator, Message

# Initialize orchestrator
orchestrator = AgentOrchestrator()

async def main():
    await orchestrator.initialize()
    
    # Submit a task
    task_id = await orchestrator.submit_task(
        description="Generate Python code",
        callback=lambda: "def hello(): return 'world'",
        priority="high",
    )
    
    # Wait for completion
    task = orchestrator.get_task(task_id)
    print(task.result)

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())
```

## Development

### Setup

```bash
# Install development dependencies
uv sync --extra dev

# Run tests
uv run pytest

# Format code
uv run ruff format .

# Lint
uv run ruff check .
```

### Project Structure

```
solvens-core/
├── solvens/                 # Main package
│   ├── core/               # Core abstractions
│   ├── agents/             # Agent system
│   ├── router/             # Capability routing
│   ├── providers/          # Provider adapters
│   ├── memory/             # Memory layer
│   ├── planner/           # Task planning
│   ├── scheduler/        # Task scheduling
│   ├── events/            # Event system
│   ├── api/               # REST API
│   └── cli/               # CLI interface
├── docs/                  # Documentation
├── tests/                 # Test suite
└── docker/                # Docker configuration
```

## Documentation

- [Architecture Report](./docs/ARCHITECTURE_REPORT.md)
- [Migration Plan](./docs/MIGRATION_PLAN.md)
- [API Documentation](./docs/API.md) *(planned)*
- [Provider Guide](./docs/PROVIDERS.md) *(planned)*

## Roadmap

- [x] Core abstractions (base classes, types, config)
- [x] Agent Orchestrator
- [x] Capability Router
- [ ] Provider Interface & Adapters
- [ ] Plugin System
- [ ] Memory Layer
- [ ] Task Planner
- [ ] REST API
- [ ] CLI Interface
- [ ] Web Dashboard
- [ ] Docker Support

## Contributing

Contributions are welcome! Please read our contributing guidelines before submitting PRs.

## License

MIT License - see [LICENSE](LICENSE) for details.

---

## ⚠️ IMPORTANT: About Cosmos

**Cosmos is NOT:**
- Cosmos DB (Azure database)
- Apache Cosmos
- Any external technology

**Cosmos IS:**
A proprietary computational representation language developed by **Solvens Amoris** based on AST, DAG, structural identity, canonicalization, and graph transformation.

⚠️ **Before implementing Cosmos integration**: Study the official Cosmos specification. Do NOT create a new Cosmos-like language. Use the existing implementation and contracts.

---

**Author:** Luis Alberto Burciaga Miker  
**Organization:** Solvens Amoris  
**Repository:** https://github.com/SolvensAmoris/solvens-core
