Skip to main content

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 2.2.15. 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, Agent = 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)

Pandas AI agent

We can also

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

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

# Create example data
sales_by_country_df = pd.DataFrame({
    "country": ["United States", "United Kingdom", "France", "Germany", "Italy", "Spain", "Canada", "Australia", "Japan", "China"],
    "revenue": [5000, 3200, 2900, 4100, 2300, 2100, 2500, 2600, 4500, 7000]
})

agent = Agent(sales_by_country_df, cognite_client=client)

print(agent.chat("Which are the top 5 countries by sales?"))

Metadata

Release files for andeplane-cognite-ai 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for andeplane-cognite-ai 0.5.1
File Size Uploaded Provenance Actions
andeplane_cognite_ai-0.5.1.tar.gz 6.1 kB Without provenance Details for andeplane_cognite_ai-0.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for andeplane-cognite-ai 0.5.1
File Interpreter ABI Platform Actions
andeplane_cognite_ai-0.5.1-py3-none-any.whl Python 3 none any Details for andeplane_cognite_ai-0.5.1-py3-none-any.whl

Total release size: 13.6 kB

Release files / andeplane_cognite_ai-0.5.1.tar.gz

Download URL andeplane_cognite_ai-0.5.1.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
df56a9389a334b568ee6b49699858ba250adda8fc617c727b4113dcb01448e52
BLAKE2b-256 checksum
How to use checksums
fb8bb01a6ffb35d83b2653e4fcaf366e75f1a3c44da225170877dcd40bddd638
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.10

Release files / andeplane_cognite_ai-0.5.1-py3-none-any.whl

Download URL andeplane_cognite_ai-0.5.1-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a50925647f1c2df03eb4a2894e1938e65793a6f4de3632c5270bfbe8623f99e9
BLAKE2b-256 checksum
How to use checksums
fb4732560a7012e301a6a77374d9bed96bdc174aa4c5a807ce25c940a74f5409
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.10

Security for andeplane-cognite-ai 0.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page