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
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 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.ai import load_pandasai
SmartDataframe, SmartDatalake = await load_pandasai()
workorders_df = client.raw.rows.retrieve_dataframe("tutorial_apm", "workorders", limit=-1).to_pandas()
workitems_df = client.raw.rows.retrieve_dataframe("tutorial_apm", "workitems", limit=-1).to_pandas()
workorder2items_df = client.raw.rows.retrieve_dataframe("tutorial_apm", "workorder2items", limit=-1).to_pandas()
workorder2assets_df = client.raw.rows.retrieve_dataframe("tutorial_apm", "workorder2assets", limit=-1).to_pandas()
assets_df = client.raw.rows.retrieve_dataframe("tutorial_apm", "assets", limit=-1).to_pandas()
from cognite.client import CogniteClient
client = CogniteClient()
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?')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cognite_ai-0.2.3.tar.gz
(5.2 kB
view details)
Built Distribution
File details
Details for the file cognite_ai-0.2.3.tar.gz
.
File metadata
- Download URL: cognite_ai-0.2.3.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9310a1bc1180e9829a8a99cf093cd54ad5b9bc935a08251ba349ad1711f1a487 |
|
MD5 | 703cc718da095e7c3ce661bbecb7aad2 |
|
BLAKE2b-256 | ecbd843d0fbc1ee184d7e164a59cf5528b1b485e41bc7a4835dd99bad1c4676d |
File details
Details for the file cognite_ai-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: cognite_ai-0.2.3-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f265fcd0206574e4315c13eedf8d0ec82c39e0e297a31452fb263f2eab1a7a95 |
|
MD5 | f67d30a7969e09108250593067123ab2 |
|
BLAKE2b-256 | 8cbe33f06a93a10bf7206ec5e6a8e2d34cd5ce0b556c53d53176a9a5aebb7579 |