No description
Find a file
Daniel Chalef 2d0705fc1b
Add get_nodes_by_query method to Graphiti class (#49)
* Add get_nodes_by_query method to Graphiti class

Add a method to the Graphiti class that wraps `get_relevant_nodes` and returns a list of nodes given a query.

* Add `get_nodes_by_query` method to the `Graphiti` class in `graphiti_core/graphiti.py`.
* Import `generate_embedding` from `graphiti_core/llm_client/utils.py`.
* Use `generate_embedding` to generate an embedding for the query.
* Call `get_relevant_nodes` with the generated embedding and return the relevant nodes.

Add an embedding function to `llm_client/utils.py`.

* Add `generate_embedding` function to `graphiti_core/llm_client/utils.py`.
* Accept an embedder and model_id as parameters.
* Generate an embedding for the given text and return it.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/getzep/graphiti?shareId=XXXX-XXXX-XXXX-XXXX).

* address comments left by @danielchalef on #49 (Add get_nodes_by_query method to Graphiti class);

* fix ellipsis name in cla config

* feat: Add get_nodes_by_query method to Graphiti class

* chore: Cleanup unused files, add hybrid node search, add tests

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: paulpaliychuk <pavlo.paliychuk.ca@gmail.com>
2024-08-26 20:00:28 -07:00
.github Add get_nodes_by_query method to Graphiti class (#49) 2024-08-26 20:00:28 -07:00
examples Add get_nodes_by_query method to Graphiti class (#49) 2024-08-26 20:00:28 -07:00
graphiti_core Add get_nodes_by_query method to Graphiti class (#49) 2024-08-26 20:00:28 -07:00
signatures/version1 Update CONTRIBUTING.md to reflect Python 3.10+ requirement (#33) 2024-08-23 13:54:44 -07:00
tests Add get_nodes_by_query method to Graphiti class (#49) 2024-08-26 20:00:28 -07:00
.env.example add nodes and edges 2024-08-13 14:35:43 -04:00
.gitignore implement diskcache (#39) 2024-08-26 13:13:05 -04:00
CODE_OF_CONDUCT.md feat: Add CLA Assistant workflow and CONTRIBUTING guidelines (#32) 2024-08-23 13:32:57 -07:00
conftest.py format and linting (#18) 2024-08-22 12:26:13 -07:00
CONTRIBUTING.md Update CONTRIBUTING.md to reflect Python 3.10+ requirement (#33) 2024-08-23 13:54:44 -07:00
ellipsis.yaml Add Apache License 2.0 boilerplate to all Python files (#30) 2024-08-23 16:01:33 -04:00
LICENSE Add a LICENSE file containing the Apache v2 license (#29) 2024-08-23 11:16:12 -07:00
Makefile chore: Fix packaging (#38) 2024-08-25 10:07:50 -07:00
poetry.lock Implement retry for LLMClient (#44) 2024-08-26 12:53:16 -07:00
pyproject.toml Implement retry for LLMClient (#44) 2024-08-26 12:53:16 -07:00
pytest.ini feat: Initial version of temporal invalidation + tests (#8) 2024-08-20 16:29:19 -04:00
README.md Add a LICENSE file containing the Apache v2 license (#29) 2024-08-23 11:16:12 -07:00
SECURITY.md format and linting (#18) 2024-08-22 12:26:13 -07:00
Zep-CLA.md feat: Add CLA Assistant workflow and CONTRIBUTING guidelines (#32) 2024-08-23 13:32:57 -07:00

Graphiti (LLM generated readme)

Graphiti is a Python library for building and managing knowledge graphs using Neo4j and OpenAI's language models. It provides a flexible framework for processing episodes of information, extracting semantic nodes and edges, and maintaining a dynamic graph structure.

Features

  • Asynchronous interaction with Neo4j database
  • Integration with OpenAI's GPT models for natural language processing
  • Automatic extraction of semantic nodes and edges from episodic data
  • Temporal tracking of relationships and facts
  • Flexible schema management

Installation

(Add installation instructions here)

Quick Start

from graphiti import Graphiti

# Initialize Graphiti
graphiti = Graphiti("bolt://localhost:7687", "neo4j", "password")

# Process an episode
await graphiti.process_episode(
    name="Example Episode",
    episode_body="Alice met Bob at the coffee shop.",
    source_description="User input",
    reference_time=datetime.now()
)

# Retrieve recent episodes
recent_episodes = await graphiti.retrieve_episodes(last_n=5)

# Close the connection
graphiti.close()

Documentation

(Add link to full documentation when available)

Contributing

(Add contribution guidelines)

License

This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.