Skip to main content

A minimalist thinking kernel for LLM agents

Project description

KernelMind

The minimalist thinking kernel for building LLM-powered AI agents.

KernelMind is a lightweight, flexible framework designed to build agentic LLM systems using a simple yet powerful abstraction: Point + Line.
It is ideal for rapidly prototyping workflows, agents, RAG pipelines, and structured thinking systems — all in under 100 lines of core code.


✨ Key Features

  • 🧠 Agentic-first architecture – Built from the ground up for multi-step reasoning
  • 🔁 Point + Line abstraction – Minimal and composable flow control
  • ⚙️ Retry / Fallback – Built-in error recovery mechanism
  • 🚀 Sync & Async support – Automatically detects coroutine behavior
  • 🧪 Testable by design – Small units, observable memory store
  • 🌿 Extensible – Implement any agent/workflow pattern

💡 Core Concepts

Concept Description
Point A minimal unit of logic (LLM or utility call)
Line A composition of points connected via actions
Memory A dictionary-style global store shared across points
load() / process() / save() The 3 lifecycle steps of each Point
class Point:
    def load(self, memory): ...
    def process(self, item): ...
    def save(self, memory, input, output): ...

📦 Installation

Option 1: Using uv (Recommended)

uv is a fast Python package installer and resolver, written in Rust.

1. Install uv

# Using pipx (recommended)
pipx install uv

# Or using Homebrew (macOS)
brew install uv

# Or using curl
curl -LsSf https://astral.sh/uv/install.sh | sh

2. Create virtual environment and install dependencies

# Clone the repository
git clone https://github.com/your-org/kernelmind-framework.git
cd kernelmind-framework

# Create virtual environment and install in development mode
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install -e .

# Or install specific dependencies
uv add requests
uv add --dev pytest

3. Run the example

python examples/agent_qa.py

Option 2: Using pip (Traditional)

# Install from PyPI (when published)
pip install kernelmind

# Or install in development mode
git clone https://github.com/your-org/kernelmind-framework.git
cd kernelmind-framework
pip install -e .

Option 3: Manual Setup

# Create virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt
pip install -e .

🚀 Quick Example: Q&A Agent

from kernelmind.core import Point, Line
from utils.call_llm import call_llm

class GetQuestion(Point):
    def process(self, _): return input("Ask: ")
    def save(self, memory, _, out): memory["question"] = out; return "default"

class AnswerQuestion(Point):
    def load(self, memory): return memory["question"]
    def process(self, q): return call_llm(q)
    def save(self, memory, _, out): print("Answer:", out)

ask = GetQuestion()
answer = AnswerQuestion()
ask >> answer
qa_line = Line(entry=ask)
qa_line.run({})

🧠 Supported Design Patterns

  • ✅ Multi-step Workflow
  • ✅ Agent with Contextual Actions
  • ✅ RAG (Retrieval-Augmented Generation)
  • ✅ Map Reduce
  • ✅ Structured YAML Output

See docs/guide.md for examples and best practices.


📁 Project Structure

kernelmind/
├── core.py          # Core logic: Point + Line
├── utils/           # External API wrappers (LLM, search, etc.)
├── examples/        # Use cases (Agent, RAG, Workflow)
├── tests/           # Unit tests
├── docs/guide.md    # Developer documentation

📖 Documentation

Check out the full usage guide and design patterns in:

📚 docs/guide.md


🧪 Run Tests

# Using uv
uv run pytest tests/

# Using pip
pytest tests/

❤️ Philosophy

From Points to Minds. From Lines to Agents.

KernelMind is not just a framework.
It is a philosophy of thinking through structure — building powerful systems with minimal building blocks.


📬 Contribution

Pull requests welcome! If you have suggestions, open an issue or start a discussion.

MIT License · Built for the AI-native future.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kernelmind-0.1.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kernelmind-0.1.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file kernelmind-0.1.0.tar.gz.

File metadata

  • Download URL: kernelmind-0.1.0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for kernelmind-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b8ab011784f289e9c61ba84798af7c9b5f19328bb5620627e147adc54176783b
MD5 3095eb3a5d2e3b816ea6a593c63ad65e
BLAKE2b-256 ed5073d5ec24c4c67c7f019785a35e2f43ed10a5e1922c6428e755f5c826d325

See more details on using hashes here.

File details

Details for the file kernelmind-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: kernelmind-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for kernelmind-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a64826359d9f0f08692b715fae827e61777767110b78afcac61858303321efea
MD5 cd1c226f1c80d936821e0bad7931b3d8
BLAKE2b-256 d23ab327283472ef1dd04d4e9380168a0ec5fb913d1de6f9a5c4b48bd71cc30f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page