GithubHelp home page GithubHelp logo

geoffwhittington / cognee Goto Github PK

View Code? Open in Web Editor NEW

This project forked from topoteretes/cognee

0.0 0.0 0.0 34.19 MB

Deterministic LLMs Outputs for AI Applications and AI Agents

Home Page: https://www.cognee.ai

License: Apache License 2.0

Shell 0.05% Python 4.90% Jupyter Notebook 95.02% Dockerfile 0.03%

cognee's Introduction

cognee

Deterministic LLMs Outputs for AI Engineers using graphs, LLMs and vector retrieval

Cognee logo

Open-source framework for creating self-improving deterministic outputs for LLMs.

cognee forks cognee stars cognee pull-requests cognee releases

Cognee Demo

Try it in a Google collab notebook or have a look at our documentation

Join our Discord community

๐Ÿ“ฆ Installation

With pip:

pip install "cognee[weaviate]"

With poetry:

poetry add "cognee[weaviate]"

๐Ÿ’ป Usage

Setup

import os

os.environ["WEAVIATE_URL"] = "YOUR_WEAVIATE_URL"
os.environ["WEAVIATE_API_KEY"] = "YOUR_WEAVIATE_API_KEY"

os.environ["OPENAI_API_KEY"] = "YOUR_OPENAI_API_KEY"

You can also use Ollama or Anyscale as your LLM provider. For more info on local models check our docs

Run

import cognee

text = """Natural language processing (NLP) is an interdisciplinary
       subfield of computer science and information retrieval"""

cognee.add(text) # Add a new piece of information

cognee.cognify() # Use LLMs and cognee to create knowledge

search_results = cognee.search("SIMILARITY", "computer science") # Query cognee for the knowledge

for result_text in search_results[0]:
    print(result_text)

Add alternative data types:

cognee.add("file://{absolute_path_to_file}", dataset_name)

Or

cognee.add("data://{absolute_path_to_directory}", dataset_name)

# This is useful if you have a directory with files organized in subdirectories.
# You can target which directory to add by providing dataset_name.
# Example:
#            root
#           /    \
#      reports  bills
#     /       \
#   2024     2023
#
# cognee.add("data://{absolute_path_to_root}", "reports.2024")
# This will add just directory 2024 under reports.

Read more here.

Demo

Check out our demo notebook here

How it works

Image

๐Ÿš€ It's alive

Try it yourself on Whatsapp with one of our partners by typing `/save {content you want to save}` followed by `/query {knowledge you saved previously}` For more info here are the docs

cognee's People

Contributors

vasilije1990 avatar borisarzentar avatar eltociear avatar josephrp avatar burnash avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.