Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Miksi AI agent works with a couple of tools to give you the final value. Mostly, it's an interchange between a tool that executes SQL queries and the one that executes the python code to generate graphs.
While the agent is instructed strictly not to execute code that writes/modifies the data, we advise you to provide a database user with only read permission to the agent.
The python code to generate graphs/charts/tables is executed within a separate virtual environment. This environment is created by default during agent initialization, at the base directory—you will see a directory called venvs
. All the agent's dependencies in relation to python will be installed here—for instance, matplotlib for graphics and charts. So this will be totally independent of any other virtual environments you are running.
The generated graphs/charts by default are saved in a directory called media
at the base directory. By base directory, we mean relative to where you are running the scripts that utilize our agent.
pip install miksiai
The supported python versions are ['3.7', '3.8', '3.9', '3.10', '3.11','3.12']
The support SQL engines are MySQL, PostgreSQL, and MsSQL server
Miksi abstracts connecting to your SQL database into "you just provide credentials" and the rest is handled.
from miksiai.sqltool import set_database_config, check_db_config_variables
set_database_config will set the database credentials
# check_db_config_variables() will report back if any of those credentials hasn't been set or is None
set_database_config(db_name, db_user, db_password, db_host, db_port)
Keep this open when running the agent since the connection closes after every operation.
print(f"db credentials: {check_db_config_variables()}")
It's Important to first check if connection to your database is seamless. If you get a success connection status from the functions below then the agent will be able to connect to your engine seamlessly
Select and specify your engine from the list of supported engines belows [MySQL, PostgreSQL, MsSQL]
from miksiai.utils import check_connection
from miksiai.utils import set_db
set_db(db_name,db_user,db_password,db_host,db_port)
status = check_connection(engine= 'MySQL')
print(f"Connection status: {status}")
We now start setting up the agent by initializing the python environment.
from miksiai.master import initialize_env
initialize_env(env_path)
The above method will initialize an existing environment or create a new one in case none exists in the specified path. Some default standard python modules will also be installed, so this process may take some minutes when configuring/setting up for the first time.
env_path
as an argument is the location you wish to create this virtual environment.
Miksi AI gives you the flexibility to run additional installations for python and instruct the agent to use them. For instance, you can install matplotlib and ask the agent to use it for generating graphs/charts, or you can prefer another standard module such as plotly or seaborn. This is entirely upon you. By default, matplotlib is the default plotting library. This is also a great way to debug import not found error.
To install additional modules, run:
from miksiai.master import safe_install_modules
safe_install_modules(['modules_here'])
Miksi AI agent is context-aware, accepts custom instructions in natural language (e.g., give the answer in Slovenian), and helps maintain the states. It accepts user questions and uses the tools inside virtual environments to arrive at the final answer. Provide your own instructions in natural language (e.g., a sample on how to format the final answer or the language to give the final answer in).
## You can set instructions and context - Optional
from miksiai.prompts.context import instruct_agent,check_instructions
instructions = 'Always respond in Slovenian'
context = 'we are a social media company and data is mainly advertisement data' # the agent context here
# Update the context and instructions
instruct_agent(context=context, instructions=instructions)
# Confirm the instructions have been set
current_values = check_instructions()
print("After setting:")
print(current_values)
Now create your agent with context and instructions loaded.
from miksiai.agent import create_agent
agent = create_agent(miksi_api_key=miksi_api_key,
engine=engine,
db_name=db_name,db_user=db_user,db_password=db_password,db_host=db_host,db_port=db_port)
Get your API Key:
media_path
is the directory where you wanted generated graphs/images/charts to be saved for rendering in your application.
from miksiai.agent import run_agent
query = "your query here"
answer = run_agent(agent,miksi_api_key, query, media_path)
FAQs
Miksi-AI empowers your BI
We found that miksiai demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.