MindFlow is an advanced multimodal personal agent designed to harness the power of Large Language Models (LLMs) for local code execution. As your autonomous digital assistant, MindFlow can complete and automate a wide range of tasks, from simple to complex, through self-prompting and natural language commands.
MindFlow provides a command-line interface for natural language interaction, allowing you to:
- Automate and complete various tasks.
- Analyze and visualize data.
- Access and browse the web for up-to-date information.
- Manipulate a variety of file types, including photos, videos, PDFs, and more.
Currently, MindFlow supports API keys for models powered by SambaNova. This choice is due to SambaNova's free, fast, and reliable service, which is ideal for the project's testing phase. Future versions will include support for other providers such as OpenAI and Anthropic.
This project draws significant inspiration from Open Interpreter
❤️
To begin using MindFlow, obtain a free API key by creating an account at https://cloud.sambanova.ai/.
Next, install and start MindFlow with the following commands:
pip install mindflow
mindflow --api_key "YOUR_API_KEY"
Tip
Encountering issues? Report them here or try:
py -m pip install mindflow
py -m mindflow --api_key "YOUR_API_KEY"
Note
The --api_key
parameter is only needed once. For subsequent uses, simply run mindflow
or py -m mindflow
.
Tip
Different API keys can be assigned to different profiles:
py -m mindflow --api_key "YOUR_API_KEY" --profile "path\to\profile"
MindFlow supports command-line arguments and customizable settings. View argument options with:
mindflow --help
To create and save personalized settings for future use:
mindflow --profile "path\to\profile"
MindFlow supports profiles in JSON
, TOML
, YAML
, and Python
formats. Below are examples of each format.
Python
Example profile.py
:
from mindflow.profile import Profile
from mindflow.extensions import BrowserKwargs, EmailKwargs
profile: Profile = Profile(
user = {
"name": "Run-Tu",
"version": "1.0.0"
},
assistant = {
"name": "MindFlow",
"personality": "You respond in a professional attitude and respond in a formal, yet casual manner.",
"messages": [],
"breakers": ["the task is done.", "the conversation is done."]
},
safeguards = {
"timeout": 16,
"auto_run": True,
"auto_install": True
},
extensions = {
"Browser": BrowserKwargs(headless=False, engine="google"),
"Email": EmailKwargs(email="run-tu@example.com", password="password")
},
config = {
"verbose": True,
"conversational": True,
"dev": False
},
languages = {
"python": ["C:\Windows\py.EXE", "-c"],
"rust": ["cargo", "script", "-e"]
},
tts = {
"enabled": True,
"engine": "OpenAIEngine",
"api_key": "sk-example"
}
)
To extend MindFlow and build your own app:
async def main():
from mindflow.core import MindFlowCore
mindflow = MindFlowCore(profile)
mindflow.llm.messages = []
async for chunk in mindflow.chat("Plot an exponential graph for me!", stream=True):
print(chunk, end="")
import asyncio
asyncio.run(main)
JSON
Example profile.json
:
{
"user": {
"name": "Run-Tu",
"version": "1.0.0"
},
"assistant": {
"name": "MindFlow",
"personality": "You respond in a professional attitude and respond in a formal, yet casual manner.",
"messages": [],
"breakers": ["the task is done.", "the conversation is done."]
},
"safeguards": {
"timeout": 16,
"auto_run": true,
"auto_install": true
},
"extensions": {
"Browser": {
"headless": false,
"engine": "google"
},
"Email": {
"email": "run-tu@example.com",
"password": "password"
}
},
"config": {
"verbose": true,
"conversational": true,
"dev": false
},
"languages": {
"python": ["C:\\Windows\\py.EXE", "-c"],
"rust": ["cargo", "script", "-e"]
},
"tts": {
"enabled": true,
"engine": "OpenAIEngine",
"api_key": "sk-example"
}
}
TOML
Example profile.toml
:
[user]
name = "Run-Tu"
version = "1.0.0"
[assistant]
name = "MindFlow"
personality = "You respond in a professional attitude and respond in a formal, yet casual manner."
messages = []
breakers = ["the task is done.", "the conversation is done."]
[safeguards]
timeout = 16
auto_run = true
auto_install = true
[extensions.Browser]
headless = false
engine = "google"
[extensions.Email]
email = "run-tu@example.com"
password = "password"
[config]
verbose = true
conversational = true
dev = false
[languages]
python = ["C:\\Windows\\py.EXE", "-c"]
rust = ["cargo", "script", "-e"]
[tts]
enabled = true
engine = "OpenAIEngine"
api_key = "sk-example"
YAML
Example profile.yaml
:
user:
name: "Run-Tu"
version: "1.0.0"
assistant:
name: "MindFlow"
personality: "You respond in a professional attitude and respond in a formal, yet casual manner."
messages: []
breakers:
- "the task is done."
- "the conversation is done."
safeguards:
timeout: 16
auto_run: true
auto_install: true
extensions:
Browser:
headless: false
engine: "google"
Email:
email: "run-tu@example.com"
password: "password"
config:
verbose: true
conversational: true
dev: false
languages:
python: ["C:\\Windows\\py.EXE", "-c"]
rust: ["cargo", "script", "-e"]
tts:
enabled: true
engine: "OpenAIEngine"
api_key: "sk-example"
To switch between profiles, use:
mindflow --switch "run-tu"
Profiles also support versioning:
mindflow --switch "run-tu:1.0.0"
Note
All profiles are isolated. LTM from different profiles and versions are not shared.
For quick profile updates [BETA]
:
mindflow --update "run-tu"
To view all available profiles:
mindflow --profiles
To view all profile versions:
mindflow --versions <profile_name>
MindFlow supports custom RAG extensions for enhanced capabilities. The default extensions include browser
and email
.
Create extensions using the following template:
from typing import TypedDict
class ExtensionKwargs(TypedDict):
...
class ExtensionName:
def __init__(self):
...
@staticmethod
def load_instructions() -> str:
return "<instructions>"
If your extension does not include a kwarg class, use:
from mindflow.utils import Kwargs
Upload your code to pypi
using twine
and poetry
. To add it to mindflow.extensions
for profiles:
omi install <module_name>
or
pip install <module_name>
omi add <module_name>
To test your extensions locally:
omi install .
- AI Interpreter
- Web Search Capability
- Async Chunk Streaming
- API Keys Support
- Profiles Support
- Extensions API
- Semantic File Search
- Optional Telemetry
- Desktop, Android & iOS App Interface
- Optimizations
- Cost-efficient long-term memory and conversational context managers using vector databases, likely powered by
ChromaDB
. - Hooks API and Live Code Output Streaming
As my first major open-source project, there may be challenges and plenty of room for improvement. Contributions are welcome, whether through raising issues, improving documentation, adding comments, or suggesting features. Your support is greatly appreciated!
You can support this project by writing custom extensions for MindFlow. The aim is to be community-powered, with its capabilities expanding through collective effort. More extensions mean better handling of complex tasks. An official list of verified MindFlow extensions will be created in the future.