mirror of
https://github.com/getzep/graphiti.git
synced 2024-09-08 19:13:11 +03:00
a6d63f0c0d4ec0ac0d11070664cf3a2116338949
Add a new `text` episode type and update the `extract_nodes` function to handle it. * **EpisodeType Enum:** - Add `text` to the `EpisodeType` enum in `graphiti_core/nodes.py`. - Update the `from_str` method to handle the `text` episode type. * **extract_nodes Function:** - Update the `extract_nodes` function in `graphiti_core/utils/maintenance/node_operations.py` to handle the `text` episode type. - Use the `message` type prompt for both `message` and `text` episodes. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/getzep/graphiti?shareId=XXXX-XXXX-XXXX-XXXX).
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.
Languages
Python
98.9%
Dockerfile
0.6%
Makefile
0.5%