Metadata-Version: 2.4
Name: baselith-core
Version: 0.25.0
Summary: A Modular Framework for Baselith-Core Orchestration featuring World Models (MCTS), Swarm, and Native MCP.
Author-email: Gippo <baselith.ai@gmail.com>
License-Expression: AGPL-3.0-only
Project-URL: Homepage, https://github.com/baselithcore/baselithcore
Project-URL: Repository, https://github.com/baselithcore/baselithcore
Project-URL: Documentation, https://baselithcore.github.io/baselithcore
Keywords: ai,agents,framework
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.9.0
Requires-Dist: alembic>=1.13.0
Requires-Dist: anthropic>=0.18.0
Requires-Dist: argon2-cffi>=23.1.0
Requires-Dist: cryptography>=50.0.0
Requires-Dist: defusedxml<1.0,>=0.7.1
Requires-Dist: email-validator>=2.1.0
Requires-Dist: fastapi<0.200,>=0.140.13
Requires-Dist: fastapi-limiter<0.2.0,>=0.1.6
Requires-Dist: httpx<1.0,>=0.27.0
Requires-Dist: jsonschema>=4.23.0
Requires-Dist: langchain-text-splitters>=1.1.0
Requires-Dist: markdown-it-py<4.0,>=3.0.0
Requires-Dist: networkx>=3.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: ollama<1.0,>=0.6.0
Requires-Dist: openai>=2.2.0
Requires-Dist: opentelemetry-api>=1.21.0
Requires-Dist: opentelemetry-exporter-otlp>=1.21.0
Requires-Dist: opentelemetry-instrumentation-fastapi>=0.42b0
Requires-Dist: opentelemetry-instrumentation-httpx>=0.42b0
Requires-Dist: opentelemetry-instrumentation-redis>=0.42b0
Requires-Dist: opentelemetry-sdk>=1.21.0
Requires-Dist: orjson<4.0,>=3.11.7
Requires-Dist: prometheus-client<1.0,>=0.20.0
Requires-Dist: psycopg[binary,pool]<4.0,>=3.2.1
Requires-Dist: pydantic-settings>=2.0.0
Requires-Dist: PyJWT<3.0,>=2.10.1
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: python-multipart>=0.0.30
Requires-Dist: PyYAML>=6.0
Requires-Dist: redis[hiredis]<6.0,>=5.0.7
Requires-Dist: rq>=1.15.0
Requires-Dist: sentry-sdk[fastapi]>=2.0.0
Requires-Dist: sse-starlette>=2.1.0
Requires-Dist: structlog>=24.1.0
Requires-Dist: uvicorn[standard]<1.0,>=0.30.0
Requires-Dist: rich>=13.7.0
Requires-Dist: rich-argparse>=1.4.0
Requires-Dist: argcomplete>=3.2.0
Provides-Extra: browser
Requires-Dist: playwright==1.45.0; extra == "browser"
Provides-Extra: documents
Requires-Dist: pypdf>=6.14.2; extra == "documents"
Requires-Dist: python-docx<2,>=1.2.0; extra == "documents"
Requires-Dist: python-pptx==0.6.23; extra == "documents"
Requires-Dist: openpyxl==3.1.5; extra == "documents"
Requires-Dist: xlrd==2.0.1; extra == "documents"
Provides-Extra: ocr
Requires-Dist: pdf2image==1.16.3; extra == "ocr"
Requires-Dist: Pillow==12.3.0; extra == "ocr"
Requires-Dist: pytesseract==0.3.10; extra == "ocr"
Provides-Extra: mineru
Requires-Dist: mineru[pipeline]<4,>=3.4.4; extra == "mineru"
Provides-Extra: web
Requires-Dist: beautifulsoup4>=4.14.2; extra == "web"
Requires-Dist: soupsieve>=2.8.4; extra == "web"
Requires-Dist: playwright==1.45.0; extra == "web"
Provides-Extra: qdrant
Requires-Dist: qdrant-client<2.0,>=1.15.1; extra == "qdrant"
Provides-Extra: rag
Requires-Dist: sentence-transformers==5.6.0; extra == "rag"
Provides-Extra: nlp
Requires-Dist: spacy==3.8.0; extra == "nlp"
Provides-Extra: gemini
Requires-Dist: google-genai<2.0,>=1.16.0; extra == "gemini"
Provides-Extra: tokenizer
Requires-Dist: tiktoken>=0.7.0; extra == "tokenizer"
Provides-Extra: evaluation
Requires-Dist: deepeval>=2.0.0; extra == "evaluation"
Provides-Extra: sandbox
Requires-Dist: docker>=7.0.0; extra == "sandbox"
Provides-Extra: huggingface
Requires-Dist: huggingface-hub>=0.20.0; extra == "huggingface"
Requires-Dist: transformers>=5.3.0; extra == "huggingface"
Requires-Dist: accelerate>=0.25.0; extra == "huggingface"
Provides-Extra: test
Requires-Dist: qdrant-client<2.0,>=1.15.1; extra == "test"
Requires-Dist: beautifulsoup4>=4.14.2; extra == "test"
Requires-Dist: soupsieve>=2.8.4; extra == "test"
Requires-Dist: pypdf>=6.14.2; extra == "test"
Requires-Dist: pytest>=7.4.0; extra == "test"
Requires-Dist: pytest-cov>=4.1.0; extra == "test"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "test"
Provides-Extra: load
Requires-Dist: locust>=2.20.0; extra == "load"
Provides-Extra: dev
Requires-Dist: qdrant-client<2.0,>=1.15.1; extra == "dev"
Requires-Dist: beautifulsoup4>=4.14.2; extra == "dev"
Requires-Dist: soupsieve>=2.8.4; extra == "dev"
Requires-Dist: pypdf>=6.14.2; extra == "dev"
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: ruff==0.15.5; extra == "dev"
Requires-Dist: mypy==2.3.0; extra == "dev"
Requires-Dist: ipython>=8.0.0; extra == "dev"
Requires-Dist: pre-commit>=3.5.0; extra == "dev"
Requires-Dist: types-PyYAML; extra == "dev"
Provides-Extra: memory
Requires-Dist: supermemory>=0.1.0; extra == "memory"
Provides-Extra: computer-use
Requires-Dist: mss>=9.0.0; extra == "computer-use"
Requires-Dist: Pillow==12.3.0; extra == "computer-use"
Requires-Dist: pyautogui>=0.9.54; extra == "computer-use"
Dynamic: license-file

<p align="center">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="media/full-white-og.png">
    <source media="(prefers-color-scheme: light)" srcset="media/full-black-og.png">
    <img alt="BaselithCore Logo" src="media/full-black-og.png" width="500">
  </picture>
</p>

# BaselithCore

> **The Research-Backed Engine for Production-Grade Agentic AI.**

[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg?style=for-the-badge&logo=python&logoColor=white)](https://www.python.org/downloads/)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg?style=for-the-badge)](LICENSE)
[![Code Style: Ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg?style=for-the-badge)](https://github.com/astral-sh/ruff)
[![Checked with mypy](https://img.shields.io/badge/mypy-checked-blue.svg?style=for-the-badge)](http://mypy-lang.org/)
[![Tests: 4636 | 79%](https://img.shields.io/badge/Tests-4636_--_79%25-brightgreen.svg?style=for-the-badge)](tests/)
[![PyPI version](https://img.shields.io/pypi/v/baselith-core.svg?style=for-the-badge&logo=pypi&logoColor=white)](https://pypi.org/p/baselith-core/)

[![EU AI Act toolkit](https://img.shields.io/badge/EU_AI_Act-Compliance_Toolkit-0b5394.svg?style=for-the-badge)](https://docs.baselithcore.xyz/advanced/regulatory-compliance/)
[![World Model: MCTS](https://img.shields.io/badge/World_Model-MCTS-teal.svg?style=for-the-badge)](https://docs.baselithcore.xyz/core-modules/world-model/)
[![Swarm Intelligence](https://img.shields.io/badge/Swarm-Intelligence-indigo.svg?style=for-the-badge)](https://docs.baselithcore.xyz/core-modules/swarm/)
[![Native MCP](https://img.shields.io/badge/Native-MCP-blue.svg?style=for-the-badge)](https://docs.baselithcore.xyz/core-modules/mcp/)
[![Docker Ready](https://img.shields.io/badge/docker-ready-blue.svg?style=for-the-badge&logo=docker&logoColor=white)](https://github.com/baselithcore/baselithcore/blob/main/Dockerfile-full)

---

**BaselithCore** is a high-performance orchestration engine designed to transition agentic AI from experimental prototypes to resilient, production-ready infrastructure. Built on a modular architecture, it provides an agnostic foundation for engineering scalable multi-agent systems.

<div align="center">

[**Quick Start**](#quick-start) | [**Documentation**](https://docs.baselithcore.xyz) | [**Architecture**](https://docs.baselithcore.xyz/architecture/) | [**Plugin System**](https://docs.baselithcore.xyz/plugins/)

</div>

---

## Why BaselithCore

- **Agents that survive production.** Durable execution with checkpoint/resume, replayable tool steps, state history and fork/rewind — a crash mid-run recovers without duplicating a single side effect.
- **Everything included, nothing rented.** Evaluation suites, LLM-as-judge, red-teaming, OpenTelemetry tracing, Prometheus metrics with real USD cost, Helm/Terraform deployment — built in and self-hosted, with no companion SaaS to subscribe to.
- **Brakes, not just horsepower.** Autonomy gating, durable human-in-the-loop approvals, per-request cost budgets, prompt-injection guardrails, sandboxed code execution — every seam fail-closed by default, plus opt-in EU AI Act / GDPR compliance primitives.

Ten lines to a working multi-agent pipeline — typed, budgeted, observable:

```python
from core.agent import Agent, Crew, Task

researcher = Agent(system_prompt="You are a meticulous researcher.")
writer = Agent(system_prompt="You write crisp executive summaries.")

crew = Crew(agents=[researcher, writer], tasks=[
    Task("Research {topic} and list the key facts.", agent=researcher),
    Task("Write a summary from the research.", agent=writer),
])
report = (await crew.run(inputs={"topic": "vector databases"})).final
```

## Architecture at a Glance

```mermaid
graph TD
    subgraph SC["Sacred Core (Agnostic Engine)"]
        A["Core Orchestrator<br/>(intent · routing · adaptive loop · durable checkpoint/resume)"]
        F["Flow Handlers"]

        subgraph COG["Cognitive Layer"]
            RE["Reasoning<br/>(MCTS · Tree-of-Thoughts)"]
            WM["World Model<br/>(risk · rollback · simulation)"]
            SW["Swarm<br/>(auction protocols)"]
            PL["Planning"]
            MT["Meta · Reflection · Adversarial"]
        end

        M["Memory Hierarchy<br/>(STM → MTM → LTM)"]
        S["Storage Layer<br/>(Postgres · Qdrant/pgvector · Redis)"]
        R["Plugin Registry"]
        RES["Resilience · Observability · Guardrails"]
    end

    A --> COG
    A --> F
    A --> M
    M --> S
    COG --> M

    R --> C["Custom Agent Plugins"]
    R --> D["Capability Extensions"]
    R -.->|Inject Handlers| A
    R -.->|Inject Routers| G["API Gateway"]

    A --> H["LLM Layer<br/>(Anthropic · OpenAI · Gemini · Ollama · HF)<br/>native tool-calling · typed output · cross-provider fallback"]
    F --> H

    A --> I["Interop<br/>(MCP · A2A streaming)"]
    A -.->|wrapped by| RES
```

The full deep-dive lives in the [architecture docs](https://docs.baselithcore.xyz/architecture/overview/).

## Core Philosophy

1. **Sacred Core**: The `core/` directory contains exclusively agnostic logic — orchestration, infrastructure, utilities. No domain code, ever.
2. **Plugin-First**: All business logic, integrations, and specialized capabilities live in **Plugins**, so secondary features never bloat the engine.
3. **Agentic by Design**: The Agentic Design Patterns (Memory, Reflection, Tool Use, Planning, …) are baked into the orchestrator, not bolted on.

## What's Inside

Every capability ships production-hardened: typed, tested, observable, and fail-closed by default.

| | |
| :-- | :-- |
| **Typed agents & declarative crews** | Single-import `Agent`, multi-agent `Crew` in ten lines → [Agent API](https://docs.baselithcore.xyz/core-modules/agent/) |
| **Durable execution & time-travel** | Checkpoint/resume, replayable tool steps, state history, fork/rewind → [Orchestration](https://docs.baselithcore.xyz/core-modules/orchestration/) |
| **Structured event streaming** | Per-run agent events in-process or over SSE → [Orchestration](https://docs.baselithcore.xyz/core-modules/orchestration/) |
| **Cognitive layer** | MCTS, Tree-of-Thoughts, world model, swarm auctions & handoffs → [Reasoning](https://docs.baselithcore.xyz/core-modules/reasoning/) · [Swarm](https://docs.baselithcore.xyz/core-modules/swarm/) |
| **Governance & safety** | Autonomy gating, durable human-in-the-loop, loop budgets, guardrails, sandboxed code → [Autonomy & Safety](https://docs.baselithcore.xyz/core-modules/orchestration/) |
| **Memory & RAG** | STM→MTM→LTM hierarchy, hybrid search, full RAG pipeline, Qdrant or pgvector backends → [Memory](https://docs.baselithcore.xyz/core-modules/memory/) · [Services](https://docs.baselithcore.xyz/core-modules/services/) |
| **Interoperability** | Native dual-era MCP (server + client), A2A peer interop → [MCP](https://docs.baselithcore.xyz/core-modules/mcp/) · [A2A](https://docs.baselithcore.xyz/core-modules/a2a/) |
| **Evaluation & observability** | Trajectory eval in CI, LLM-as-judge, red-team, OTel + Prometheus with USD cost metrics → [Evaluation](https://docs.baselithcore.xyz/core-modules/evaluation/) |
| **Regulatory toolkit** | Opt-in EU AI Act / GDPR / NIS2 / DORA primitives with evidence trails → [Regulatory Compliance](https://docs.baselithcore.xyz/advanced/regulatory-compliance/) |
| **Production deployment** | Docker, Helm, Terraform, SLO rules, typed SDKs → [Deployment](https://docs.baselithcore.xyz/advanced/deployment/) |

## <span id="quick-start"></span> Quick Start

```bash
pip install baselith-core       # core engine
docker compose up -d            # Redis, PostgreSQL, Qdrant (optional)
baselith doctor                 # validate environment and configuration
```

Optional capabilities (RAG, browser automation, OCR, extra model providers, vector backends, …) install as extras — see the [installation guide](https://docs.baselithcore.xyz/getting-started/installation/) for the full list, and the [quickstart](https://docs.baselithcore.xyz/getting-started/quickstart/) to build your first agent.

## Resources

| Resource                                                                             | Description                                           |
| :----------------------------------------------------------------------------------- | :---------------------------------------------------- |
| [**Official Website**](https://baselithcore.xyz)                                     | The core landing page for the BaselithCore framework. |
| [**Official Documentation**](https://docs.baselithcore.xyz)                          | The official docs for the BaselithCore framework.     |
| [**Architecture**](https://docs.baselithcore.xyz/architecture/overview/)             | Deep dive into the "Sacred Core" and design choices.  |
| [**Plugin Guide**](https://docs.baselithcore.xyz/plugins/architecture/)              | How to extend BaselithCore using the plugin system.   |
| [**Agentic Patterns**](https://docs.baselithcore.xyz/architecture/agentic-patterns/) | Implementation of Agentic Design Patterns.            |
| [**Regulatory Compliance**](https://docs.baselithcore.xyz/advanced/regulatory-compliance/) | AI Act, GDPR, NIS2 and DORA mapped article by article — gaps included. |
| [**Deployment**](https://docs.baselithcore.xyz/advanced/deployment/)                 | Production-ready deployment strategies.               |

## Contributing & License

We welcome contributions that adhere to our code standards. Please review [CONTRIBUTING.md](CONTRIBUTING.md).

BaselithCore is licensed under the **GNU Affero General Public License v3.0 (AGPL v3)**.
See [LICENSE](LICENSE) for full details.

---
Copyright © 2026 BaselithCore Team.
