Skip to main content

MiMinions

An agentic framework built on pydantic-ai with Model Context Protocol (MCP) server support, a generic tool system, three-tier memory, and local-first workspaces.

📖 Full documentation: miminions.ai

Features

  • Minion agent — an async, LLM-powered agent on pydantic-ai, defaulting to OpenRouter (with OpenAI, Anthropic, Gemini, and an offline test model also selectable), with streaming replies, retries, request timeouts, and observability hooks.
  • Generic tool system — turn a typed Python function into an agent-callable tool with an auto-derived JSON schema; no boilerplate.
  • MCP integration — connect to MCP servers and load their tools alongside your own functions.
  • Three-tier memory — a chronological session log (HISTORY.md), stable workspace facts (MEMORY.md), and a cross-workspace SQLite vector store, with an LLM distiller that promotes insights across tiers.
  • Vector memory — SQLiteMemory with semantic, keyword, full-text, metadata, regex, hybrid, and date-range search, embeddings via fastembed (ONNX — no PyTorch/CUDA).
  • Workspaces — a node/rule graph plus an on-disk layout (prompt/, memory/, skills/, sessions/, data/) that drives each agent's context.
  • CLI — manage agents, tasks, knowledge, workspaces, and an interactive chat from the miminions command; state persists under ~/.miminions/ by default and can be relocated with MIMINIONS_HOME.
  • Local data manager — content-addressable (SHA-256) storage with deduplication, a master index, and an append-only transaction log.
  • Async-first — full asynchronous operation throughout.

Installation

pip install miminions

Or with uv:

uv add miminions

Requires Python 3.12+. SQLite vector memory is an optional extra (it adds fastembed, sqlite-vec, and pysqlite3):

pip install miminions[sqlite]   # or miminions[all]

The agent uses OpenRouter by default — set your key before running:

export OPENROUTER_API_KEY="sk-or-..."

MiMinions stores local CLI/workspace state in ~/.miminions by default. Set MIMINIONS_HOME to use a different location:

export MIMINIONS_HOME="/path/to/miminions-home"

Quick Start

A first agent with a custom tool

import asyncio
from miminions.agent import create_minion

async def main():
    agent = create_minion("MyAgent")

    def add(a: int, b: int) -> int:
        return a + b

    agent.register_tool("add", "Add two numbers", add)

    # The model decides when to call the tool.
    reply = await agent.run("What is 3 + 7?")
    print(reply)

asyncio.run(main())

For streamed replies, iterate over run_stream():

async for delta in agent.run_stream("Draft a short project update"):
  print(delta, end="", flush=True)

Want a different model? Pass a provider (or a pydantic-ai model directly):

agent = create_minion("MyAgent", provider="anthropic")   # or "openai", "gemini"
agent = create_minion("MyAgent", provider="test")          # offline, no API key

An agent with vector memory

from miminions.memory.sqlite import SQLiteMemory
from miminions.agent import create_minion

with SQLiteMemory("agent.db") as memory:
  agent = create_minion("Assistant", memory=memory)

  # store_knowledge / recall_knowledge require an attached memory backend.
  agent.store_knowledge("Python is a high-level language", metadata={"topic": "python"})
  print(agent.recall_knowledge("What language is Python?"))

With memory attached, the agent also gains a built-in ingest_document tool that chunks and stores .pdf/.txt/.md files. Requires the [sqlite] extra.

Loading tools from an MCP server

from mcp import StdioServerParameters
from miminions.agent import create_minion

agent = create_minion("MyAgent")
await agent.connect_mcp_server(
    "math", StdioServerParameters(command="python", args=["math_server.py"])
)
await agent.load_tools_from_mcp_server("math")
# ...
await agent.cleanup()

CLI Usage

After install, the miminions command is available (a default workspace and agent are created under ~/.miminions/ on first run):

miminions --help
python -m miminions --help        # equivalent

Command groups:

Group What it does
chat Interactive chat with a workspace agent; distills memory on exit
prompt One-shot prompt to a workspace agent
agent Create and run agents
tool Discover, execute, and trace tools and tool sessions
task Create and track tasks
knowledge A versioned knowledge base
workspace Manage workspaces, their nodes, rules, and on-disk files
gateway Manage local gateway runtime, cron jobs, and gateway sessions
auth Local sign-in, public-access mode, and config
# Start an interactive chat (resume with --session <id>)
miminions chat start

# Show tool calls, token usage, and latency while chatting
miminions chat start --verbose

# One-shot prompt
miminions prompt ask "Summarize today's standup notes"

# Agents
miminions agent add --name "Researcher" --description "Finds and summarizes sources"
miminions agent list

# Workspaces
miminions workspace add --name "Demo" --sample --init-files
miminions workspace list

See the CLI reference for every subcommand.

Documentation

Topic
Getting Started Install, first agent, and the CLI
Agent The Minion API
Memory Three-tier and vector memory
Context Builder System-prompt assembly
Tools @tool, GenericTool, MCP
Workspaces Nodes, rules, on-disk layout
Tasks & Workflows TaskRuntime and tracing
Data Management LocalDataManager
Gateway Runtime Channels, bus, cron

For a map of the source tree and module status, see STRUCTURE.md. Runnable examples live in examples/.

Development

git clone https://github.com/MiMinions-ai/MiMinions.git
cd MiMinions
pip install -e ".[dev]"

Run the tests:

pytest tests/                 # everything
pytest tests/unit/            # unit
pytest tests/integration/     # integration
pytest tests/e2e/             # end-to-end

Publishing

pyproject.toml is the single source of truth for packaging. Build and publish with uv:

uv build
uv publish
# TestPyPI:
uv publish --publish-url https://test.pypi.org/legacy/

Build a standalone CLI binary:

bash deploy/build_cli.sh

Contributing

Contributions are welcome — see CONTRIBUTING.md and the Code of Conduct. Feature work targets the development branch.

License

MIT — see LICENSE.

Metadata

Release files for miminions 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for miminions 0.4.2
File Size Uploaded
miminions-0.4.2.tar.gz 106.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for miminions 0.4.2
File Interpreter ABI Platform
miminions-0.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 236.7 kB

Release files / miminions-0.4.2.tar.gz

Download URL miminions-0.4.2.tar.gz
Size 106.1 kB
Tags Source
SHA-256 checksum
How to use checksums
89fffaf7628b8143aee291f16be5709d32005d7cd286cb6e799496bc59b78276
BLAKE2b-256 checksum
How to use checksums
633015a721e93202bb0abf8ae3fbf8718531d55ddeb7046809ec8a8248bde940
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release files / miminions-0.4.2-py3-none-any.whl

Download URL miminions-0.4.2-py3-none-any.whl
Size 130.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98e486f61192c19f1e311d608d34ffccb8ceeb4873f95fb7d82eb9318b5c61b2
BLAKE2b-256 checksum
How to use checksums
59ba740ea42a59ae5d54f5dc28ebef6241d6e33679a29a7ef2bb10ac48056893
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.2 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.2

3 release files

0.2.1

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page