An agentic framework with pydantic_ai, MCP server support and vector memory
Project description
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). - 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 —
SQLiteMemorywith 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
miminionscommand; state persists under~/.miminions/. - 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-..."
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())
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
agent = create_minion("Assistant", memory=SQLiteMemory("agent.db"))
# 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/manage agents and run/inspect their tools |
task |
Create and track tasks |
knowledge |
A versioned knowledge base |
workspace |
Manage workspaces, their nodes, rules, and on-disk files |
execution |
Register tools and record tool runs in execution sessions |
auth |
Local sign-in, public-access mode, and config |
# Start an interactive chat (resume with --session <id>)
miminions chat start
# 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
The
workflowcommand group exists in the codebase but is not yet enabled. The--asyncflag onmiminions agent runis currently a placeholder.
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.
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
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 miminions-0.3.0.tar.gz.
File metadata
- Download URL: miminions-0.3.0.tar.gz
- Upload date:
- Size: 91.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80dd99e3cc91e15042ae0239d197911aa35e6f2b66f958f893c3487958e0f366
|
|
| MD5 |
046fb933c9c51ab457c1b5685d20df6d
|
|
| BLAKE2b-256 |
c429f2cdb78218222884b6ae637041e25e6d24bc582f99e5bd1bb1f09889bd24
|
Provenance
The following attestation bundles were made for miminions-0.3.0.tar.gz:
Publisher:
python-publish.yml on MiMinions-ai/MiMinions
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
miminions-0.3.0.tar.gz -
Subject digest:
80dd99e3cc91e15042ae0239d197911aa35e6f2b66f958f893c3487958e0f366 - Sigstore transparency entry: 2048951952
- Sigstore integration time:
-
Permalink:
MiMinions-ai/MiMinions@40c370d381facc0ef852cdbbb31054a152c1df58 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/MiMinions-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@40c370d381facc0ef852cdbbb31054a152c1df58 -
Trigger Event:
release
-
Statement type:
File details
Details for the file miminions-0.3.0-py3-none-any.whl.
File metadata
- Download URL: miminions-0.3.0-py3-none-any.whl
- Upload date:
- Size: 113.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99a225a1715cccb52538905c6ebd2ab7eefc1036069ad36e2c0c91bcadd95781
|
|
| MD5 |
02dacaf535bc8cb61698cc8a51fb7915
|
|
| BLAKE2b-256 |
e09c592699d42b1cd873e09880af6bb1c3dbc066ed093533b3c894de8abc824d
|
Provenance
The following attestation bundles were made for miminions-0.3.0-py3-none-any.whl:
Publisher:
python-publish.yml on MiMinions-ai/MiMinions
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
miminions-0.3.0-py3-none-any.whl -
Subject digest:
99a225a1715cccb52538905c6ebd2ab7eefc1036069ad36e2c0c91bcadd95781 - Sigstore transparency entry: 2048952450
- Sigstore integration time:
-
Permalink:
MiMinions-ai/MiMinions@40c370d381facc0ef852cdbbb31054a152c1df58 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/MiMinions-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@40c370d381facc0ef852cdbbb31054a152c1df58 -
Trigger Event:
release
-
Statement type: