Skip to main content

A set of AI tools for working with Cognite Data Fusion in Python.

Project description

cognite-ai

A set of AI tools for working with CDF in Python.

MemoryVectorStore

Store and query vector embeddings created from CDF. This can enable a bunch of use cases where the number of vectors aren't that big.

Install the package

%pip install cognite-ai

Then you can create vectors from text (both multiple lines or a list of strings) like this


from cognite.ai import MemoryVectorStore
from cognite.client import CogniteClient

client = CogniteClient()
vector_store = MemoryVectorStore(client)

vector_store.store_text("Hi, I am a software engineer working for Cognite.")
vector_store.store_text("The moon is orbiting the earth, which is orbiting the sun.")
vector_store.store_text("Coffee can be a great way to stay awake.")

vector_store.query_text("I am tired, what can I do?")

Smart data frames

Chat with your data using LLMs. Built on top of PandasAI version 1.5.8. If you have loaded data into a Pandas dataframe, you can run

Install the package

%pip install cognite-ai

Chat with your data

from cognite.client import CogniteClient
from cognite.ai import load_pandasai

client = CogniteClient()
SmartDataframe, SmartDatalake = await load_pandasai()

workorders_df = client.raw.rows.retrieve_dataframe("tutorial_apm", "workorders", limit=-1)
workitems_df = client.raw.rows.retrieve_dataframe("tutorial_apm", "workitems", limit=-1)
workorder2items_df = client.raw.rows.retrieve_dataframe("tutorial_apm", "workorder2items", limit=-1)
workorder2assets_df = client.raw.rows.retrieve_dataframe("tutorial_apm", "workorder2assets", limit=-1)
assets_df = client.raw.rows.retrieve_dataframe("tutorial_apm", "assets", limit=-1)

smart_lake_df = SmartDatalake([workorders_df, workitems_df, assets_df, workorder2items_df, workorder2assets_df], cognite_client=client)
smart_lake_df.chat("Which workorders are the longest, and what work items do they have?")


s_workorders_df = SmartDataframe(workorders_df, cognite_client=client)
s_workorders_df.chat('Which 5 work orders are the longest?')

Configure LLM parameters

params = {
    "model": "gpt-35-turbo",
    "temperature": 0.5
}

s_workorders_df = SmartDataframe(workorders_df, cognite_client=client, params=params)

Project details


Download files

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

Source Distribution

andeplane_cognite_ai-0.4.8.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

andeplane_cognite_ai-0.4.8-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file andeplane_cognite_ai-0.4.8.tar.gz.

File metadata

  • Download URL: andeplane_cognite_ai-0.4.8.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.10

File hashes

Hashes for andeplane_cognite_ai-0.4.8.tar.gz
Algorithm Hash digest
SHA256 cf9e5623f93eaf77e9ec80755e9493093f567a103b042183a861aed88f039c68
MD5 351af0f1c917277cf570253d04ce7225
BLAKE2b-256 efe75cd8cfacfe22eb28b4fbb95ae86e1fdb08c52d52d9719052858dbfa74574

See more details on using hashes here.

File details

Details for the file andeplane_cognite_ai-0.4.8-py3-none-any.whl.

File metadata

File hashes

Hashes for andeplane_cognite_ai-0.4.8-py3-none-any.whl
Algorithm Hash digest
SHA256 72b4cc681417266277da74f729216983e97f6a8332988e978a178a2d121987e3
MD5 64068bf37098a8b9d88d621415a4de66
BLAKE2b-256 0c04a599c6f0acb8730b7f01fa85507d89f461c4429f73f5351a8b7792f0ebce

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