BaselithCore
The Research-Backed Engine for Production-Grade Agentic AI.
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.
Core Philosophy
BaselithCore is governed by a strict architectural separation:
- Sacred Core: The
core/directory contains exclusively agnostic logic—orchestration, infrastructure, and utilities. It remains untainted by domain-specific logic. - Plugin-First: All business logic, external integrations, and specialized capabilities are implemented as Plugins, ensuring secondary features never bloat the primary engine.
- Agentic by Design: Native adherence to the Agentic Design Patterns (Memory, Reflection, Tool Use, etc.) is baked into the orchestrator.
Architecture Overview
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 · 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
Key Capabilities
Cognitive Orchestration
We manage the complexity of agentic reasoning so you can focus on domain value.
- Strategic Optimization: Native Monte Carlo Tree Search (MCTS) and Tree of Thoughts for advanced decision-making and "What-If" simulations.
- Native Tool-Calling & Typed Output: Provider-agnostic tool-calling and structured outputs across Anthropic, OpenAI, Gemini and Ollama, with a prompt-coercion fallback for providers without a native API.
generate_typed()returns a validated Pydantic instance — schema derived from the model, self-repairing on a schema violation. - Durable Execution: Checkpoint/resume of the agent loop with idempotent, deterministic-replay tool steps (in-memory or Postgres-backed), so a crash mid-run recovers without duplicating side effects — plus an opt-in startup sweep that resumes runs interrupted by a restart.
- Swarm Intelligence: Decentralized Auction Protocols for optimal task allocation, structured agent handoffs (objective / facts / already-attempted brief, bounded payload), and budget-aware structured concurrency across agent collectives.
- Multilayered Memory: Research-grade memory hierarchy (STM → MTM → LTM) with token-budgeted context assembly, intelligent consolidation, and optional context folding — older turns summarized, recent ones verbatim, instead of hard truncation.
- Composable Workflows: Graph execution with per-node retry/backoff and cyclic evaluation loops (generate → evaluate → refine), bounded by a step budget so a non-converging loop fails instead of hanging.
- Interoperability: Native Model Context Protocol, complete and dual-era — the stateless 2026-07-28 revision (per-request metadata,
server/discover, caching hints, mirrored-header validation, SSE response streams) alongside theinitializehandshake down to2024-11-05, on both the server and client sides. Tools, resources, resource templates and prompts with structured output, annotations, pagination, completion and icons; multi round-trip requests with HMAC-sealedrequestState; the tasks extension for long-running work;subscriptions/listenchange notifications; cancellation, progress and client-side TTL caching — plus A2A peer interop with SSE streaming and durable task storage.
Governance & Safety
Production agents need brakes, not just capability. Every seam is fail-closed by default.
- Autonomy Gating: A three-tier autonomy policy (supervised → semi → fully autonomous) decides which tool categories need human approval. The gate applies to every execution path — the ReAct loop, the parallel executor, and MCP — never just the easy one.
- Human-in-the-Loop: An approval request durably pauses the run (
awaiting_approval) instead of failing it; operators list, approve/deny and resume through the/approvalsAPI, and the loop replays completed steps. - Loop Budgets: Per-request caps on iterations, tool calls, tokens, wall-clock deadline and USD cost, charged from inside the LLM layer — plus early escalation when a tool fails repeatedly, so a broken dependency can't burn the whole budget.
- Content Guardrails: Input guardrails run before any budget or LLM spend, on the streaming path too; non-streamed responses are filtered for PII and harmful content; external content (MCP results, scraped pages, skill bodies) is scanned and sanitized for indirect prompt injection by default.
- Sandboxed Code Execution: Agent-written code runs in Docker or MicroVM isolation (no network, dropped capabilities, resource caps), preceded by AST static analysis that rejects malformed code and flags dangerous imports before a container even starts.
- Prompt-as-Code: The conversation system prompt ships as a versioned, checksummed file served through a prompt registry — with labels, deterministic A/B bucketing, OTel provenance on every render, and deployment-level overrides via a prompt catalog directory.
- Enforced Quality Gates: A deterministic trajectory-eval suite gates every merge in CI (no API keys, no network), alongside architecture-boundary, strict-typing, file-size, plugin-integrity and OpenAPI-drift gates.
New safety and portability features that change runtime behaviour ship opt-in (extended thinking, context folding, durable checkpointing, crash recovery): defaults preserve existing behaviour, and enabling them is a deployment decision.
Quick Start
1. Prerequisites
- Python: 3.12+
- Docker: For Redis, Qdrant, and PostgreSQL infrastructure.
- Vector/Relational Storage: Managed via Docker Compose.
2. Installation
Install the core engine via pip:
pip install baselith-core
Install optional capabilities only when needed:
# RAG / embedding / reranking
pip install "baselith-core[rag]"
# Browser automation and JS rendering
pip install "baselith-core[browser,web]"
# Document ingestion and OCR
pip install "baselith-core[documents,ocr,nlp]"
# Additional model providers
pip install "baselith-core[gemini]"
pip install "baselith-core[huggingface]"
Or clone for extension development:
git clone https://github.com/baselithcore/baselithcore.git
cd baselith-core
docker compose up -d
3. Verification
baselith doctor # Validate environment and configuration
Resources
| Resource | Description |
|---|---|
| Official Website | The core landing page for the BaselithCore framework. |
| Official Documentation | The official docs for the BaselithCore framework. |
| Architecture | Deep dive into the "Sacred Core" and design choices. |
| Plugin Guide | How to extend BaselithCore using the plugin system. |
| Agentic Patterns | Implementation of Agentic Design Patterns. |
| Deployment | Production-ready deployment strategies. |
Contributing & License
We welcome contributions that adhere to our code standards. Please review CONTRIBUTING.md.
BaselithCore is licensed under the GNU Affero General Public License v3.0 (AGPL v3). See LICENSE for full details.
Copyright © 2026 BaselithCore Team.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file baselith_core-0.22.0.tar.gz.
File metadata
- Download URL: baselith_core-0.22.0.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2001518da1465df139781af22003cb0f4818eb7e3bd0231f7cd6782ca6c7052
|
|
| MD5 |
fcbccbac5827b24b5ac57cda9e4459ea
|
|
| BLAKE2b-256 |
a0068cdaac2c21155c14dd4ceaf1f6553eab6ec62aa42b39d1dcf3e76722e579
|
Provenance
The following attestation bundles were made for baselith_core-0.22.0.tar.gz:
Publisher:
ci.yml on baselithcore/baselithcore
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
baselith_core-0.22.0.tar.gz -
Subject digest:
c2001518da1465df139781af22003cb0f4818eb7e3bd0231f7cd6782ca6c7052 - Sigstore transparency entry: 2333941227
- Sigstore integration time:
-
Permalink:
baselithcore/baselithcore@012f10fdb820d35b42f2a6a1cbdcb4babd6433a8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/baselithcore
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@012f10fdb820d35b42f2a6a1cbdcb4babd6433a8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file baselith_core-0.22.0-py3-none-any.whl.
File metadata
- Download URL: baselith_core-0.22.0-py3-none-any.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bfe987fb0a64ecfe0e5835de167e4b1e156481b38aa18342ef34f0c3e4408d6
|
|
| MD5 |
3f33ca82cb2748e00973156d36e86684
|
|
| BLAKE2b-256 |
0175c8feff1bb35e9bfd6c8847788b18935f62d9d9477ad6d93d4edb1276c655
|
Provenance
The following attestation bundles were made for baselith_core-0.22.0-py3-none-any.whl:
Publisher:
ci.yml on baselithcore/baselithcore
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
baselith_core-0.22.0-py3-none-any.whl -
Subject digest:
5bfe987fb0a64ecfe0e5835de167e4b1e156481b38aa18342ef34f0c3e4408d6 - Sigstore transparency entry: 2333941248
- Sigstore integration time:
-
Permalink:
baselithcore/baselithcore@012f10fdb820d35b42f2a6a1cbdcb4babd6433a8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/baselithcore
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@012f10fdb820d35b42f2a6a1cbdcb4babd6433a8 -
Trigger Event:
push
-
Statement type: