Skip to main content

Miksi-AI empowers your BI

Project description

Intro

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.

Install Miksi-AI SDK:

  • Install the latest version: pip install miksi_ai_sdk

The supported python versions are ['3.7', '3.8', '3.9', '3.10', '3.11','3.12']

Supported SQL based engines

The support SQL engines are MySQL, PostgreSQL, and MsSQL server

Connecting to the Database

Miksi abstracts connecting to your SQL database into "you just provide credentials" and the rest is handled.

from miksi_ai_sdk.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()}")

checking connection status

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 below [MySQL, PostgreSQL, MsSQL]

from miksi_ai_sdk.utils import check_connection
from miksi_ai_sdk.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.

Initialize Python Environment

from miksi_ai_sdk.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.

Additional Installs

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 miksi_ai_sdk.master import safe_install_modules

safe_install_modules(['modules_here'])

Creating the Agent

Miksi AI agent is context-aware, accepts custom instructions in natural language (e.g., give the answer in Slovakian), 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).

from miksi_ai_sdk.agent import create_agent

agent = create_agent(miksi_api_key=miksi_api_key, media_path=media_path, instructions=instructions)

Get your API Key:

  • Visit MiksiAPI, sign up or log in, then generate your API key. This API key will be used to use the Miksi SDK.

media_path is the directory where you wanted generated graphs/images/charts to be saved for rendering in your application.

Running the Agent

query = "your query here"
answer = run_agent(agent, query)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

miksi_ai_sdk-0.0.14-cp312-cp312-win_amd64.whl (228.4 kB view details)

Uploaded CPython 3.12 Windows x86-64

miksi_ai_sdk-0.0.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

miksi_ai_sdk-0.0.14-cp312-cp312-macosx_10_9_universal2.whl (472.6 kB view details)

Uploaded CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64)

miksi_ai_sdk-0.0.14-cp311-cp311-win_amd64.whl (235.9 kB view details)

Uploaded CPython 3.11 Windows x86-64

miksi_ai_sdk-0.0.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

miksi_ai_sdk-0.0.14-cp311-cp311-macosx_10_9_universal2.whl (487.4 kB view details)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)

miksi_ai_sdk-0.0.14-cp310-cp310-win_amd64.whl (233.6 kB view details)

Uploaded CPython 3.10 Windows x86-64

miksi_ai_sdk-0.0.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

miksi_ai_sdk-0.0.14-cp310-cp310-macosx_11_0_x86_64.whl (256.9 kB view details)

Uploaded CPython 3.10 macOS 11.0+ x86-64

miksi_ai_sdk-0.0.14-cp39-cp39-win_amd64.whl (262.0 kB view details)

Uploaded CPython 3.9 Windows x86-64

miksi_ai_sdk-0.0.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

miksi_ai_sdk-0.0.14-cp39-cp39-macosx_11_0_x86_64.whl (257.5 kB view details)

Uploaded CPython 3.9 macOS 11.0+ x86-64

miksi_ai_sdk-0.0.14-cp38-cp38-win_amd64.whl (263.1 kB view details)

Uploaded CPython 3.8 Windows x86-64

miksi_ai_sdk-0.0.14-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

miksi_ai_sdk-0.0.14-cp38-cp38-macosx_11_0_x86_64.whl (254.6 kB view details)

Uploaded CPython 3.8 macOS 11.0+ x86-64

miksi_ai_sdk-0.0.14-cp37-cp37m-win_amd64.whl (259.3 kB view details)

Uploaded CPython 3.7m Windows x86-64

miksi_ai_sdk-0.0.14-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

miksi_ai_sdk-0.0.14-cp37-cp37m-macosx_11_0_x86_64.whl (251.8 kB view details)

Uploaded CPython 3.7m macOS 11.0+ x86-64

File details

Details for the file miksi_ai_sdk-0.0.14-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for miksi_ai_sdk-0.0.14-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a6c9e1a580dd475b854683ac2eaa2b696338ce51303fc13e2f602c6b6c3d51de
MD5 2dae32020ace30086318c42ff9ca3021
BLAKE2b-256 2456700add7c2c23732bc9a233793f8a7e469e39e1cbb1ce937b6a9f10435a4c

See more details on using hashes here.

File details

Details for the file miksi_ai_sdk-0.0.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for miksi_ai_sdk-0.0.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e17769e77298b981e8b2bd533bca63ed4e6e203cd9b1a9de3a7f97226caa0c9b
MD5 69c30f9f3ae77667c96188c53c1160cf
BLAKE2b-256 5ac97ab8168b9c2bc083fec0dedcbe11f50f240c8ffd4a4605874dc1e8d36fcd

See more details on using hashes here.

File details

Details for the file miksi_ai_sdk-0.0.14-cp312-cp312-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for miksi_ai_sdk-0.0.14-cp312-cp312-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 130f5a24f831724d87e7f186a343a46235fd465af5f901202f647745a0019639
MD5 7b35c52339a653986b21ee9e37b1617d
BLAKE2b-256 97e2bd6f6ebb89a50476fe724ba37c69580c012c5a848f79f71d9d7202110f86

See more details on using hashes here.

File details

Details for the file miksi_ai_sdk-0.0.14-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for miksi_ai_sdk-0.0.14-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 39ac3c0c88a263832fdd9a667bcf25a7969972218c77fe380c22fe5447447073
MD5 9217e6a2bdce6848a27725be956766b7
BLAKE2b-256 a49f68ff26c0b899eb5045eef8f0c037211e771d4568ead5def686bd0aeee498

See more details on using hashes here.

File details

Details for the file miksi_ai_sdk-0.0.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for miksi_ai_sdk-0.0.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 69652969251c5a244650ef3d4581d4463e9b1146d8da8f4526bc34c83c89fcca
MD5 843e53fe494177ffc8b53e252fbae9a6
BLAKE2b-256 4865188fc9158fef466ba041ed5566087fde0e0152e3b8b8e5f0684af4b2a407

See more details on using hashes here.

File details

Details for the file miksi_ai_sdk-0.0.14-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for miksi_ai_sdk-0.0.14-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 04f02dcd7982904053240c5faf10c8bee6e276882217f3fc02a12fb6c3d62ddb
MD5 603e64fa67d4e9f39c42a0fc14315c7d
BLAKE2b-256 0c67a49467a6d263f583d87b9a43af1d3b73855f518c0ce3677a1dca018ad828

See more details on using hashes here.

File details

Details for the file miksi_ai_sdk-0.0.14-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for miksi_ai_sdk-0.0.14-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1181392d7c70e60066aba06100930ea71b9fabba0877fec19db61c982ff69390
MD5 e6e5a9c3e1b95621f6dcaa8b3e9969af
BLAKE2b-256 6f991313f47350161a838b187f88477299a3fbe11156676deb53b0db98eef275

See more details on using hashes here.

File details

Details for the file miksi_ai_sdk-0.0.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for miksi_ai_sdk-0.0.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c2f77e5c46385b7f5b629017e3e85df8aaf49b0e7a48329ed70983ba372e6ee0
MD5 50dae1538d130c081726dd94f7c4c3b4
BLAKE2b-256 f2c50d488ad1f6e977eba8ee0b47cf7f973de17b59d2b4e18aee2fd5fc7557bf

See more details on using hashes here.

File details

Details for the file miksi_ai_sdk-0.0.14-cp310-cp310-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for miksi_ai_sdk-0.0.14-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 be3577b2595eb52abc00049b642dc417d1f2185000b79b43cae934eae8b2b841
MD5 74c149c55d23d14fa5c89603b9de35ce
BLAKE2b-256 8479ca700e8c6454ba18a5ae506667aa496cdb9297dbd4ba0488d875f62e2a9a

See more details on using hashes here.

File details

Details for the file miksi_ai_sdk-0.0.14-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for miksi_ai_sdk-0.0.14-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 128a7e51c797277b6ea0639b00c902bef57d0c2d1b8c0bd876022c7554cef0a2
MD5 7d8fb427d2327d5bdf26041d8608e4dd
BLAKE2b-256 acbde070dd6e84fe752c5ea8089fc7f9b5cb245644a02e3b5fc0fc7c6bf7d165

See more details on using hashes here.

File details

Details for the file miksi_ai_sdk-0.0.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for miksi_ai_sdk-0.0.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f76e0676b2d1e2b209d54255e282bf31824af41d8a8d65f405e3132069c52fe3
MD5 15e77ef9366b2257921b0f725d9c6762
BLAKE2b-256 fbe43d012fc495d514c1b074b754cad336b8cd1985ca4c1feecba95e89c1a6a6

See more details on using hashes here.

File details

Details for the file miksi_ai_sdk-0.0.14-cp39-cp39-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for miksi_ai_sdk-0.0.14-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 e308e9128644d5d87cfdc16632a214b4d5520a3230ff39561cea84e06c5f54fc
MD5 9a677f5f66cdb0b93276a966e34d5f8c
BLAKE2b-256 fab0b7ebc2f09ed53f10bf23d009dc1b67ad4f44cfe28a6534fe1312d19a2e77

See more details on using hashes here.

File details

Details for the file miksi_ai_sdk-0.0.14-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for miksi_ai_sdk-0.0.14-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 92c1727a4ac96b8a09af215adf4a99df9cf3318094d9b585a0b9c8604c5406b7
MD5 13833e57d540a1e1ec1ee30597f555ef
BLAKE2b-256 6e9b6b0993eddf6d2cecc6614164c98f590096c2c62492b979160caaf2d25532

See more details on using hashes here.

File details

Details for the file miksi_ai_sdk-0.0.14-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for miksi_ai_sdk-0.0.14-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3f701ad17a4d7ca8d746f918b0e270f7184783bffebf27aa4b6b1c4089b2ff9a
MD5 54511ff1987ebe514f8d50fe1b6358c8
BLAKE2b-256 c450aba92263d509e0db302703bffdc610353c438a76b53608789a6cc98a2689

See more details on using hashes here.

File details

Details for the file miksi_ai_sdk-0.0.14-cp38-cp38-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for miksi_ai_sdk-0.0.14-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 54469b2292e7478ebe51fa15216795e9d4b953a5f7943efa2aab5fb78b6b8e38
MD5 c785136de6f2b898c2f8ea7f51402e75
BLAKE2b-256 b981d14cb229aaa6621461ff905399104c55e1bf0721956b2b7da2ec0c8fc55d

See more details on using hashes here.

File details

Details for the file miksi_ai_sdk-0.0.14-cp37-cp37m-win_amd64.whl.

File metadata

File hashes

Hashes for miksi_ai_sdk-0.0.14-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 e9e5ffc0cc02820f513c4e2e11ec44ca0473032140fefe829000b1f8a0fdb6b8
MD5 72e15299d1f67579e63eb89c7a0e1b5d
BLAKE2b-256 c40503757220041d21679e1056fe95f150e33cfa601c6718fb241492c3e84528

See more details on using hashes here.

File details

Details for the file miksi_ai_sdk-0.0.14-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for miksi_ai_sdk-0.0.14-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1e6691ad3291691fb138d22e50719d1e7e538da107b827e7243cab69dda6736b
MD5 ac68d8df464ca4e77a20bb8d7066b1ed
BLAKE2b-256 f1b3edf2525c877a4ac0215c9a9a834d6b81de697d35bbfd11e839a495b82562

See more details on using hashes here.

File details

Details for the file miksi_ai_sdk-0.0.14-cp37-cp37m-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for miksi_ai_sdk-0.0.14-cp37-cp37m-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 e21e584e389a45983dcfdc7b5b5b2ae09a8132981bfb41433f8e50858d29942b
MD5 f61ec8975322689a1a040ba0ebf8f723
BLAKE2b-256 0deaefab43a7f23470b46dbc223aeaafe5014d42101d3d51decd134b0fffaaa8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page