Metadata-Version: 2.1
Name: cognee
Version: 0.1.1
Summary: Cognee - is a library for enriching LLM context with a semantic layer for better understanding and reasoning.
Home-page: https://www.cognee.ai
License: Apache-2.0
Author: Vasilije Markovic
Requires-Python: >=3.10,<3.11
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Software Development :: Libraries
Provides-Extra: athena
Provides-Extra: az
Provides-Extra: bigquery
Provides-Extra: cli
Provides-Extra: databricks
Provides-Extra: dbt
Provides-Extra: duckdb
Provides-Extra: filesystem
Provides-Extra: gcp
Provides-Extra: gs
Provides-Extra: lancedb
Provides-Extra: motherduck
Provides-Extra: mssql
Provides-Extra: neo4j
Provides-Extra: notebook
Provides-Extra: parquet
Provides-Extra: pinecone
Provides-Extra: postgres
Provides-Extra: redshift
Provides-Extra: s3
Provides-Extra: snowflake
Provides-Extra: synapse
Provides-Extra: weaviate
Requires-Dist: aiofiles (>=23.2.1,<24.0.0)
Requires-Dist: aiosqlite (>=0.20.0,<0.21.0)
Requires-Dist: asyncpg (>=0.28.0,<0.29.0)
Requires-Dist: boto3 (>=1.26.125,<2.0.0)
Requires-Dist: debugpy (>=1.8.0,<2.0.0)
Requires-Dist: dlt (>=0.4.6,<0.5.0)
Requires-Dist: duckdb-engine (>=0.11.2,<0.12.0)
Requires-Dist: duckdb[dlt] (>=0.10.0,<0.11.0) ; extra == "duckdb" or extra == "motherduck"
Requires-Dist: fastapi (>=0.109.2,<0.110.0)
Requires-Dist: filetype (>=1.2.0,<2.0.0)
Requires-Dist: graphistry (>=0.33.5,<0.34.0)
Requires-Dist: graphviz (>=0.20.1,<0.21.0)
Requires-Dist: greenlet (>=3.0.3,<4.0.0)
Requires-Dist: gunicorn (>=20.1.0,<21.0.0)
Requires-Dist: instructor (>=0.3.4,<0.4.0)
Requires-Dist: langdetect (>=1.0.9,<2.0.0)
Requires-Dist: networkx (>=3.2.1,<4.0.0)
Requires-Dist: nltk (>=3.8.1,<4.0.0)
Requires-Dist: openai (==1.12.0)
Requires-Dist: overrides (>=7.7.0,<8.0.0) ; extra == "notebook"
Requires-Dist: pandas (>=2.2.1,<3.0.0)
Requires-Dist: pyarrow (>=15.0.0,<16.0.0) ; extra == "bigquery" or extra == "parquet" or extra == "motherduck" or extra == "athena" or extra == "synapse"
Requires-Dist: pylint (>=3.0.3,<4.0.0)
Requires-Dist: pymupdf (>=1.23.25,<2.0.0)
Requires-Dist: python-dotenv (==1.0.1)
Requires-Dist: qdrant-client (>=1.8.0,<2.0.0)
Requires-Dist: ruff (>=0.2.2,<0.3.0)
Requires-Dist: scikit-learn (>=1.4.1.post1,<2.0.0)
Requires-Dist: sqlalchemy (>=2.0.21,<3.0.0)
Requires-Dist: tenacity (>=8.2.3,<9.0.0)
Requires-Dist: unstructured[all-docs] (>=0.12.5,<0.13.0)
Requires-Dist: uvicorn (==0.22.0)
Requires-Dist: weaviate-client (>=4.5.4,<5.0.0) ; extra == "weaviate"
Project-URL: Repository, https://github.com/topoteretes/cognee
Description-Content-Type: text/markdown

# cognee

Make data processing for LLMs easy


<p>
  <a href="https://cognee.ai" target="_blank">
    <img src="assets/cognee-logo.png" width="160px" alt="Cognee logo" />
  </a>
</p>

<p>
  <i>Open-source framework for creating knowledge graphs and data models for LLMs.</i>
</p>

<p>
  <a href="https://github.com/topoteretes/cognee/fork">
    <img src="https://img.shields.io/github/forks/topoteretes/cognee?style=for-the-badge" alt="cognee forks"/>
  </a>
  <a href="https://github.com/topoteretes/cognee/stargazers">
    <img src="https://img.shields.io/github/stars/topoteretes/cognee?style=for-the-badge" alt="cognee stars"/>
  </a>
  <a href="https://github.com/topoteretes/cognee/pulls">
    <img src="https://img.shields.io/github/issues-pr/topoteretes/cognee?style=for-the-badge" alt="cognee pull-requests"/>
  </a>
  <a href="https://github.com/topoteretes/cognee/releases">
    <img src="https://img.shields.io/github/release/topoteretes/cognee?&label=Latest&style=for-the-badge" alt="cognee releases" />
  </a>
</p>

[//]: # (<p>)

[//]: # (  <b>Share cognee Repository</b>)

[//]: # (</p>)

[//]: # (<p>)

[//]: # (  <a href="https://twitter.com/intent/tweet?text=Check%20this%20GitHub%20repository%20out.%20Cognee%20-%20Let%27s%20you%20easily%20build,%20manage%20and%20run%20useful%20autonomous%20AI%20agents.&url=https://github.com/topoteretes/cognee&hashtags=AGI,Autonomics,Cognee,future" target="_blank">)

[//]: # (    <img src="https://img.shields.io/twitter/follow/_promethAI?label=Share Repo on Twitter&style=social" alt="Follow Cognee"/>)

[//]: # (  </a>)

[//]: # (  <a href="https://t.me/share/url?text=Check%20this%20GitHub%20repository%20out.%20Cognee%20-%20Let%27s%20you%20easily%20build,%20manage%20and%20run%20useful%20autonomous%20AI%20agents.&url=https://github.com/topoteretes/cognee" target="_blank">)

[//]: # (    <img src="https://img.shields.io/twitter/url?label=Telegram&logo=Telegram&style=social&url=https://github.com/topoteretes/cognee" alt="Share on Telegram"/>)

[//]: # (  </a>)

[//]: # (  <a href="https://api.whatsapp.com/send?text=Check%20this%20GitHub%20repository%20out.%20Cognee%20-%20Let's%20you%20easily%20build,%20manage%20and%20run%20useful%20autonomous%20AI%20agents.%20https://github.com/topoteretes/cognee" target="_blank">)

[//]: # (    <img src="https://img.shields.io/twitter/url?label=whatsapp&logo=whatsapp&style=social&url=https://github.com/topoteretes/cognee" />)

[//]: # (  </a>)

[//]: # (  <a href="https://www.reddit.com/submit?url=https://github.com/topoteretes/cognee&title=Check%20this%20GitHub%20repository%20out.%20Cognee%20-%20Let's%20you%20easily%20build,%20manage%20and%20run%20useful%20autonomous%20AI%20agents.)

[//]: # (  " target="_blank">)

[//]: # (    <img src="https://img.shields.io/twitter/url?label=Reddit&logo=Reddit&style=social&url=https://github.com/topoteretes/cognee" alt="Share on Reddit"/>)

[//]: # (  </a>)

[//]: # (  <a href="mailto:?subject=Check%20this%20GitHub%20repository%20out.&body=Cognee%20-%20Let%27s%20you%20easily%20build,%20manage%20and%20run%20useful%20autonomous%20AI%20agents.%3A%0Ahttps://github.com/topoteretes/cognee" target="_blank">)

[//]: # (    <img src="https://img.shields.io/twitter/url?label=Gmail&logo=Gmail&style=social&url=https://github.com/topoteretes/cognee"/>)

[//]: # (  </a>)

[//]: # (  <a href="https://www.buymeacoffee.com/promethAI" target="_blank">)

[//]: # (    <img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="23" width="100" style="border-radius:1px">)

[//]: # (  </a>)

[//]: # (</p>)

[//]: # ()
[//]: # (<hr>)

[//]: # ()
[//]: # ([Star us on Github!]&#40;https://www.github.com/topoteretes/cognee&#41;)

[//]: # ()
[//]: # (<a href="https://www.cognee.ai" target="_blank">Cognee</a> runs in iterations, from POC towards production-ready code.)


## 🚀 It's alive
<p>

Try it yourself on Whatsapp with one of our <a href="https://keepi.ai">partners</a> by typing `/save {content you want to save}` followed by `/query {knowledge you saved previously}`
For more info here are the <a href="https://topoteretes.github.io/cognee/">docs</a>
</p>


## 📦 Installation

With pip:

```bash
pip install cognee
```

With poetry:

```bash
poetry add cognee
```

## 💻 Usage

Check out our demo notebook [here](cognee%20-%20Get%20Started.ipynb)


- Set OpenAI API Key as an environment variable
```
import os

# Setting an environment variable
os.environ['OPENAI_API_KEY'] = ''


```


- Add a new piece of information to storage
```
import cognee
cognee.add(absolute_data_path, dataset_name)
```

- Use LLMs and cognee to create graphs
 
``` 
cognee.cognify(dataset_name)
 ``` 

- Render the graph after adding your Graphistry credentials to .env

```
graph_url = await render_graph(graph, graph_type = "networkx")
print(graph_url)
```

- Query the graph for a piece of information

```
query_params = {
    SearchType.SIMILARITY: {'query': 'your search query here'}
}
cognee.search(graph, query_params) 
``` 


## Demo

[<img src="https://i9.ytimg.com/vi/-ARUfIzhzC4/maxresdefault.jpg?v=65f88738&sqp=CPyN4q8G&rs=AOn4CLC1bemWV-lca4U_kzlXxl2kSmCBrA" width="100%">](https://youtu.be/-ARUfIzhzC4 "Learn about cognee: 55")


## Architecture

### How Cognee Enhances Your Contextual Memory

Our framework for the OpenAI, Graph (Neo4j) and Vector (Weaviate) databases introduces three key enhancements:

- Query Classifiers: Navigate information graph using Pydantic OpenAI classifiers.
- Document Topology: Structure and store documents in public and private domains.
- Personalized Context: Provide a context object to the LLM for a better response.


![Image](assets/architecture.png)


