{"id":7346,"library":"kumoai","title":"Kumo AI Python SDK","description":"The Kumo Python SDK (`kumoai`) provides a composable, modular interface for interacting with the Kumo machine learning platform. This platform leverages Graph Neural Networks (GNNs) to generate predictive analytics and insights directly from relational data. The SDK is currently at version 0.79.0 and receives frequent updates, often including new features and stability enhancements.","status":"active","version":"0.79.0","language":"en","source_language":"en","source_url":"https://kumo.ai/","tags":["AI","Machine Learning","Graph Neural Networks","SDK","Data Science","Predictive Analytics"],"install":[{"cmd":"pip install kumoai","lang":"bash","label":"Install core SDK"},{"cmd":"pip install kumoai pandas","lang":"bash","label":"Install with pandas (recommended for quickstart)"}],"dependencies":[{"reason":"Commonly used for data loading and manipulation in quickstart examples and typical ML workflows.","package":"pandas","optional":true}],"imports":[{"note":"Primary import for KumoRFM client and graph operations.","symbol":"rfm","correct":"import kumoai.experimental.rfm as rfm"},{"note":"General import for broader SDK functionalities.","symbol":"kumoai","correct":"import kumoai as kumo"},{"note":"LocalGraph is part of the `experimental.rfm` submodule for the KumoRFM API, not directly under `kumoai.graph` for this use case.","wrong":"from kumoai.graph import LocalGraph","symbol":"LocalGraph","correct":"from kumoai.experimental.rfm import LocalGraph"}],"quickstart":{"code":"import os\nimport pandas as pd\nimport kumoai.experimental.rfm as rfm\n\n# Retrieve API key from environment variable for security\nKUMO_API_KEY = os.environ.get('KUMO_API_KEY', '')\n\n# Initialize the KumoRFM client\n# You can generate an API key at https://kumorfm.ai/api-keys\nrfm.init(api_key=KUMO_API_KEY)\n\n# Example: Load E-Commerce dataset using pandas\ndataset_url = \"s3://kumo-sdk-public/rfm-datasets/online-shopping\"\nusers_df = pd.read_parquet(f\"{dataset_url}/users.parquet\")\nitems_df = pd.read_parquet(f\"{dataset_url}/items.parquet\")\norders_df = pd.read_parquet(f\"{dataset_url}/orders.parquet\")\n\n# Create a local graph from dataframes\ngraph = rfm.LocalGraph.from_data({\n    \"users\": users_df,\n    \"items\": items_df,\n    \"orders\": orders_df,\n})\n\n# Initialize the KumoRFM model with the graph\nmodel = rfm.KumoRFM(graph)\n\n# Make a prediction (e.g., forecast 30-day product demand)\nquery = \"PREDICT SUM(orders.price, 0, 30, days) FOR items.item_id=1\"\nresult = model.predict(query)\n\nprint(\"Prediction Result:\")\nprint(result.head())","lang":"python","description":"This quickstart demonstrates how to install the Kumo SDK, initialize a client with an API key, load an example dataset using pandas, create a local graph, and make a predictive query using KumoRFM."},"warnings":[{"fix":"Generate your API key from the Kumo UI (kumorfm.ai/api-keys). Store it securely, preferably as an environment variable (e.g., `KUMO_API_KEY`). Monitor your usage to stay within rate limits, or upgrade your plan for higher limits.","message":"Kumo AI requires an API key for authentication, which should be treated as sensitive. Free accounts typically have daily query limits (e.g., 1000/day). Exceeding these limits will result in HTTP 429 Too Many Requests errors.","severity":"gotcha","affected_versions":"All"},{"fix":"Always check the official documentation and release notes before upgrading, especially when moving between minor versions. Pin your `kumoai` dependency to a specific version (e.g., `kumoai==0.79.0`) to prevent unexpected breakage.","message":"The Kumo AI SDK is under active development. Minor version updates can introduce breaking changes, particularly in submodules marked 'experimental'. Pay close attention to release notes for changes in API structure or required parameters.","severity":"breaking","affected_versions":"All versions, especially between minor releases (e.g., 0.x to 0.y)"},{"fix":"Ensure that your input data adheres to Kumo's data quality guidelines. Specifically, for missing values, leave fields entirely blank. Review Kumo's documentation on data types and semantic types for best practices.","message":"Data quality significantly impacts prediction accuracy. Kumo expects genuinely missing values to be represented by completely blank entries. Using 'null', 'N/A', '-1', or similar strings for missing data will cause these to be treated as actual values, leading to erroneous model training and predictions.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Implement rate limiting or exponential backoff in your application. Check your Kumo account's daily query limit (e.g., 1000/day for free tier) and consider upgrading your plan if higher throughput is needed.","cause":"The client has sent too many requests within a given timeframe, exceeding the Kumo API's rate limits.","error":"HTTP 429 Too Many Requests"},{"fix":"Verify that your `KUMO_API_KEY` is correct and current. Generate a new API key from the Kumo AI Admin tab if necessary, as old keys are invalidated upon rotation. Ensure no VPN or network policy is blocking access.","cause":"The provided API key is invalid, expired, or the request is unauthorized for another reason.","error":"HTTP 403 Forbidden"},{"fix":"The `LocalGraph` class (for KumoRFM) is located under `kumoai.experimental.rfm`. Use `from kumoai.experimental.rfm import LocalGraph` or `kumoai.experimental.rfm.LocalGraph`.","cause":"Attempting to import `LocalGraph` directly from the top-level `kumoai` package or an incorrect submodule.","error":"AttributeError: module 'kumoai' has no attribute 'LocalGraph'"}]}