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

class GetQuestion(Point):
    def load(self, memory):
        return "start"  # Return a non-None value to trigger process()
    
    def process(self, _): 
        user_input = input("Ask: ")
        return user_input
    
    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 f"Answer: {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.1.tar.gz (9.0 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.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kernelmind-0.1.1.tar.gz
  • Upload date:
  • Size: 9.0 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.1.tar.gz
Algorithm Hash digest
SHA256 918d1ea55a642db759049b03326c09644825385ee769e57a0648e6322f241e4f
MD5 af892b18623f56944ea985eefda10ed2
BLAKE2b-256 25917118f670689e415f4aee05be0ce1f749a336eea7b0581c0bcd58b5f08035

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kernelmind-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2a58e3eefc6c3e0e6e040c0e725ddb763cf88483a8a5fc7ab531a3e1f5cfcd53
MD5 14b83fd01f3baf42ddd9b29b30eba017
BLAKE2b-256 07c5ab8a015cc1bee2ca0f7eb55b34df0b867aa756e0efd0bd2bd44ce12fad80

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