A lightweight personal AI assistant framework
Project description
Mira
An open-source, ultra-lightweight AI assistant tailored specifically for Medical AI Research.
Powered by an underlying micro-agent framework, Mira is designed to execute complex medical imaging pipelines, from raw DICOM data processing to deep learning tasks, traditional radiomics, and survival analysis.
🔬 Built-in Medical Skills
Mira comes pre-loaded with specialized medical skills:
medical-image-dl-pipeline: End-to-end deep learning pipeline (classification, segmentation, detection) built on MONAI and PyTorch. Features robust 5-Fold Cross-Validation and early stopping.radiomics: High-dimensional radiomic feature extraction using PyRadiomics, combined with LASSO/mRMR feature selection.survival-analysis: Time-to-event statistical modeling, Kaplan-Meier curves, and Cox Proportional Hazards models via lifelines.
Mira can also be leveraged for comprehensive literature reviews and academic manuscript writing.
🛡️ Core Agent Features
Mira goes beyond standard AI wrappers by implementing a robust, production-ready agent architecture:
- Intelligent Model Routing: Dynamically routes sub-tasks, agent reasoning, and tool calls to the most appropriate AI models based on task complexity and context, ensuring optimal performance and cost-efficiency.
- Strict Workspace Sandboxing (Read/Write Separation): The agent operates within a highly secure, confined workspace directory. Built-in filesystem and shell execution guards actively block path traversals (e.g.,
cd ..,../) and unauthorized updates to external paths, guaranteeing the safety of the host system. Crucially, it employs a sophisticated Read/Write separation model—allowing the agent securely to read system-level built-in skills without permitting any unauthorized edits to framework source code.
🚀 Quick Start
1. Install
git clone https://github.com/MIRA-Intelligence/mira.git
cd Mira
pip install -e .
2. Configure
Run mira onboard to initialize the config.json and your workspace (defaults to ~/.mira).
mira onboard
Then, configure your model settings and API keys in ~/.mira/config.json:
{
"agents": {
"defaults": {
"workspace": "~/.mira/",
"model": "",
"provider": "custom",
"maxTokens": 8192,
"temperature": 0.6,
"maxToolIterations": 40,
"memoryWindow": 100,
"reasoningEffort": null
}
},
"providers": {
"custom": {
"apiKey": "",
"apiBase": null,
"extraHeaders": null
},
"azureOpenai": {
"apiKey": "",
"apiBase": null,
"extraHeaders": null
},
"anthropic": {
"apiKey": "",
"apiBase": null,
"extraHeaders": null
}
}
}
💻 CLI Commands Reference
Mira provides a comprehensive CLI for managing your sessions and configurations:
-
mira onboardInitialize your configuration file and local workspace directory (~/.miraby default). This is the first command you should run after installation. -
mira agentStart an interactive AI chat session directly in your terminal. You can optionally pass a prompt instantly via the-mflag:mira agent -m "I have 77 MRI Dixon cases. Please set up a 3D classification pipeline to predict expiration vs. inspiration."
-
mira statusCheck the current status of your Mira configuration, agent defaults, and workspace environment. -
OAuth providers (e.g.,
openai-codex,github-copilot) are now configured directly insidemira onboard. -
mira gatewayLaunch the background gateway service. This enables external API endpoints and multi-channel traffic.
Local Engine Service CLI
For desktop/local deployment workflows, use mira-engine:
mira-engine install-service
mira-engine start
mira-engine status
mira-engine logs
mira-engine doctor
mira-engine doctor --export
mira-engine upgrade --package mira
mira-engine stop
mira-engine uninstall-service
On macOS, install-service registers a user LaunchAgent at:
~/Library/LaunchAgents/com.projectmira.engine.plist
On Linux, install-service registers a user systemd unit:
~/.config/systemd/user/mira-engine.service
On Windows, install-service registers service name:
MiraEngine
Local engine logs and diagnostics:
- Logs:
~/.mira/logs/agent-service.log(+ rotated files) - Diagnostics bundles:
~/.mira/runtime/diagnostics/
🔗 Release Compatibility Mapping
Mira tracks UI/Agent release compatibility in compatibility.json.
release_train: release window inYYYY.MMformatui: supported UI minor range (e.g.0.1.x)agent: supported agent minor range (e.g.0.1.x)api_contract: API contract version (e.g.v1)min_agent_for_ui: minimum compatible agent patch version
Validate updates locally before opening a PR:
python scripts/validate_compatibility.py --file compatibility.json
📦 Agent Release Pipeline
Tagging v* triggers .github/workflows/agent-release.yml to:
- build/test the project on Linux/macOS/Windows
- publish
mirapackage artifacts (wheel/sdist) - build standalone
mira-engineexecutables with checksums
Use .github/workflows/release-train.yml (workflow_dispatch) to validate an
agent_tag + ui_tag pair and run smoke checks before announcing a combined release.
🏗️ Optional Self-hosted Path
Docker-related files are in deploy/:
deploy/docker-compose.ymldeploy/Dockerfiledeploy/entrypoint.shdeploy/.env.example
Compose services include:
- local build/run services:
mira-gateway,mira-api,mira-cli - self-hosted release services (profile
self-hosted):mira-engine,mira-ui
Operator guide:
docs/self-hosted-docker.md
💬 Multi-Channel Deployment (Coming Soon)
Features to deploy Mira seamlessly to platforms like Telegram, Discord, Feishu, or Slack to assist your research team in real-time are in active development.
🤝 Contributing / CLA
All external contributions require acceptance of the Contributor License Agreement.
See CLA.md for details. By submitting a PR, you confirm acceptance of this CLA.
🙏 Acknowledgments
The foundational CLI framework of Mira is built heavily upon the mira. We sincerely thank the HKUDS team for their excellent open-source contribution to the community.
Developed for researchers, by ECNU SKMR Lab.
Project details
Release history Release notifications | RSS feed
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 mira_engine-0.2.0rc9.tar.gz.
File metadata
- Download URL: mira_engine-0.2.0rc9.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35fba77729e4bae409112d4389d2bfef0824414c9910e6182584daffd69964c5
|
|
| MD5 |
6496376d52fe44a11a64c0383354a05a
|
|
| BLAKE2b-256 |
5baa41d58e0e4b2714c44748d33018289f199dfbd405d971af9e09ddcf605e5f
|
Provenance
The following attestation bundles were made for mira_engine-0.2.0rc9.tar.gz:
Publisher:
agent-release.yml on MIRA-Intelligence/mira
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mira_engine-0.2.0rc9.tar.gz -
Subject digest:
35fba77729e4bae409112d4389d2bfef0824414c9910e6182584daffd69964c5 - Sigstore transparency entry: 1386656006
- Sigstore integration time:
-
Permalink:
MIRA-Intelligence/mira@001bb74d1cf3b8de3d5631f093f170293d39660a -
Branch / Tag:
refs/tags/v0.2.0rc9 - Owner: https://github.com/MIRA-Intelligence
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
agent-release.yml@001bb74d1cf3b8de3d5631f093f170293d39660a -
Trigger Event:
push
-
Statement type:
File details
Details for the file mira_engine-0.2.0rc9-py3-none-any.whl.
File metadata
- Download URL: mira_engine-0.2.0rc9-py3-none-any.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20c7bfb2fa82c367fdae91c40507a1f1cb18de4e5efb8832b48c683331fcc7ce
|
|
| MD5 |
a22d715f5e41edd4ab4129d0313759b5
|
|
| BLAKE2b-256 |
0b88b393c768add2589ebf311f65e2b9fc5987ee2df58cbdf2892a4f5578083b
|
Provenance
The following attestation bundles were made for mira_engine-0.2.0rc9-py3-none-any.whl:
Publisher:
agent-release.yml on MIRA-Intelligence/mira
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mira_engine-0.2.0rc9-py3-none-any.whl -
Subject digest:
20c7bfb2fa82c367fdae91c40507a1f1cb18de4e5efb8832b48c683331fcc7ce - Sigstore transparency entry: 1386656115
- Sigstore integration time:
-
Permalink:
MIRA-Intelligence/mira@001bb74d1cf3b8de3d5631f093f170293d39660a -
Branch / Tag:
refs/tags/v0.2.0rc9 - Owner: https://github.com/MIRA-Intelligence
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
agent-release.yml@001bb74d1cf3b8de3d5631f093f170293d39660a -
Trigger Event:
push
-
Statement type: