31 Commits

Author SHA1 Message Date
Daniel Chalef
aa6e38856a
[REFACTOR][FIX] Move away from DEFAULT_DATABASE environment variable in favour of driver-config support (dc) (#699)
* fix: remove global DEFAULT_DATABASE usage in favor of driver-specific
config

Fixes bugs introduced in PR #607. This removes reliance on the global
DEFAULT_DATABASE environment variable. It specifies the database within
each driver. PR #607 introduced a Neo4j compatability, as the database
names are different when attempting to support FalkorDB.

This refactor improves compatability across database types and ensures
future reliance by isolating the configuraiton to the driver level.

* fix: make falkordb support optional

This ensures that the the optional dependency and subsequent import is compliant with the graphiti-core project dependencies.

* chore: fmt code

* chore: undo changes to uv.lock

* fix: undo potentially breaking changes to drive interface

* fix: ensure a default database of "None" is provided - falling back to internal default

* chore: ensure default value exists for session and delete_all_indexes

* chore: fix typos and grammar

* chore: update package versions and dependencies in uv.lock and bulk_utils.py

* docs: update database configuration instructions for Neo4j and FalkorDB

Clarified default database names and how to override them in driver constructors. Updated testing requirements to include specific commands for running integration and unit tests.

* fix: ensure params defaults to an empty dictionary in Neo4jDriver

Updated the execute_query method to initialize params as an empty dictionary if not provided, ensuring compatibility with the database configuration.

---------

Co-authored-by: Urmzd <urmzd@dal.ca>
2025-07-10 17:25:39 -04:00
Daniel Chalef
8213d10d44
migrate to pyright (#646)
* migrate to pyright

* Refactor type checking to use Pyright, update dependencies, and clean up code.

- Replaced MyPy with Pyright in configuration files and CI workflows.
- Updated `pyproject.toml` and `uv.lock` to reflect new dependencies and versions.
- Adjusted type hints and fixed minor code issues across various modules for better compatibility with Pyright.
- Added new packages `backoff` and `posthog` to the project dependencies.

* Update CI workflows to install all extra dependencies for type checking and unit tests

* Update dependencies in uv.lock to replace MyPy with Pyright and add nodeenv package. Adjust type hinting in config.py for compatibility with Pyright.
2025-06-30 12:04:21 -07:00
Gal Shubeli
6e6115c134
FalkorDB Integration: Bug Fixes and Unit Tests (#607)
* fixes-and-tests

* update-workflow

* lint-fixes

* mypy-fixes

* fix-falkor-tests

* Update poetry.lock after pyproject.toml changes

* update-yml

* fix-tests

* comp-tests

* typo

* fix-tests

---------

Co-authored-by: Guy Korland <gkorland@gmail.com>
2025-06-30 11:01:44 -04:00
Daniel Chalef
c29893d972
Excluded entity type filtering (#624)
* excluded entities filtering

* Fix variable name casing in test_entity_exclusion_int.py for consistency
2025-06-26 20:54:43 -07:00
Daniel Chalef
a6bb9b3eca
Add group ID validation and error handling (#618)
- Introduced `GroupIdValidationError` to handle invalid group ID formats.
- Added `validate_group_id` function to check that group IDs contain only alphanumeric characters, dashes, or underscores.
- Integrated `validate_group_id` checks in the `Graphiti` class to ensure group IDs are validated during processing.
2025-06-24 09:33:54 -07:00
Daniel Chalef
fe870b953f
Add max_coroutines parameter to Graphiti and update semaphore_gather function (#619)
- Introduced max_coroutines parameter in the Graphiti class to control the maximum number of concurrent operations.
- Updated the semaphore_gather function to accept max_coroutines as an optional argument, defaulting to SEMAPHORE_LIMIT if not provided.
- Adjusted multiple calls to semaphore_gather throughout the Graphiti class to utilize the new max_coroutines parameter for better concurrency management.
2025-06-24 09:32:16 -07:00
Preston Rasmussen
19fde653a6
update driver (#583)
* update driver

* mypy updates

* mypy updates

* mypy updates

* Update graphiti_core/graph_queries.py

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* mypy updates

* mypy

* mypy updates

* mypy updates

* mypy updates

* mypy updates

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-06-13 14:12:09 -04:00
Preston Rasmussen
14146dc46f
Add support for falkordb (#575)
* [wip] add support for falkordb

* updates

* fix-async

* progress

* fix-issues

* rm-date-handler

* red-code

* rm-uns-try

* fix-exm

* rm-un-lines

* fix-comments

* fix-se-utils

* fix-falkor-readme

* fix-falkor-cosine-score

* update-falkor-ver

* fix-vec-sim

* min-updates

* make format

* update graph driver abstraction

* poetry lock

* updates

* linter

* Update graphiti_core/search/search_utils.py

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

---------

Co-authored-by: Dudi Zimberknopf <zimber.dudi@gmail.com>
Co-authored-by: Gal Shubeli <galshubeli93@gmail.com>
Co-authored-by: Gal Shubeli <124919062+galshubeli@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-06-13 12:06:57 -04:00
Preston Rasmussen
9422b6f5fb
Node dedupe efficiency (#490)
* update resolve extracted edge

* updated edge resolution

* dedupe nodes update

* single pass node resolution

* updates

* mypy updates

* Update graphiti_core/prompts/dedupe_nodes.py

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* remove unused imports

* mypy

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-05-15 13:56:33 -04:00
prestonrasmussen
f096c8770c remove unused import 2025-05-15 10:12:31 -04:00
Preston Rasmussen
ca75decc5f
revert semaphore gather batching (#489) 2025-05-14 15:33:11 -04:00
Preston Rasmussen
9baa9b7b8a
Mmr optimizations (#481)
* update mmr calculations

* update search

* fixes and updates

* mypy
2025-05-12 22:30:23 -04:00
Preston Rasmussen
e7ecc71983
update semaphore gather to use batches (#471)
* update semaphore gather to use batches

* batch semaphore update

* remove return type
2025-05-12 14:00:38 -04:00
Preston Rasmussen
1193b25fa3
add_episode() refactor (#421)
* temporal updates

* update resolve nodes

* dedupe edge updates

* edge dedupe

* extract attributes

* update dynamic pydantic model

* first pass of extract node attributes

* no errors

* bug fixes

* bug fixes

* prompt updates

* prompt updates

* updates

* updates

* remove unused imports

* update tests based on changes

* remove unused import
2025-04-30 12:08:52 -04:00
Preston Rasmussen
a26b25dc06
Add episode refactor (#399)
* partial refactor

* get relevant nodes refactor

* load edges updates

* refactor triplets

* not there yet

* node search update

* working refactor

* updates

* mypy

* mypy
2025-04-26 00:24:23 -04:00
Preston Rasmussen
daf14a6509
get edges by node uuid (#291)
* get edges by node uuid

* lint
2025-03-13 15:44:02 -04:00
Preston Rasmussen
0f50b74735
Set max tokens by prompt (#255)
* set max tokens

* update generic openai client

* mypy updates

* fix: dockerfile

---------

Co-authored-by: paulpaliychuk <pavlo.paliychuk.ca@gmail.com>
2025-01-24 10:14:49 -05:00
Preston Rasmussen
fcff4ca67c
use default value for return exceptions (#246) 2024-12-17 15:11:22 -05:00
Preston Rasmussen
00fe87679e
Bounded semaphore - limiting concurrency (#244)
* WIP

* add semaphore

* remove unused imports

* remove unused imports

* lower concurrency limit
2024-12-17 13:08:18 -05:00
Preston Rasmussen
732b2f328d
update lucene escaping (#233)
* update lucene escaping

* update unit test
2024-12-09 10:36:46 -05:00
Preston Rasmussen
0fbe5c0704
Pagination for get by group_id (#218)
* add pagination to subgraphs

* update pagination

* update LiteralString import

* cleanup

* cleanup

* update embedding dims
2024-12-02 11:17:37 -05:00
Preston Rasmussen
eba9f40ca2
add reflexion (#212)
* add reflexion

* clean up boolean logic

* update conditional

* cap reflexion iterations

* don't do an extra reflection step
2024-11-13 11:58:56 -05:00
Preston Rasmussen
b8f52670ce
Bulk add nodes and edges (#205)
* test

* only use parallel runtime if set to true

* add and test bulk add

* remove group_ids

* format

* bump version

* update readme
2024-10-31 12:31:37 -04:00
Preston Rasmussen
1290d0fecb
load env in helper file (#196)
* load env in helper file

* bump version
2024-10-22 08:49:14 -04:00
Preston Rasmussen
b217d1e51f
Make default DB explicit (#195)
* add default database

* update

* init tests

* update test

* bump version

* removed unused imports
2024-10-21 12:33:32 -04:00
Preston Rasmussen
49aeaf75f2
Add mmr reranking (#180)
* mmr start

* add mmr function

* normalize

* add mmr options to search

* update communities

* build communities

* format

* clean up normalization

* normalize in mmr

* update
2024-10-08 13:55:10 -04:00
Preston Rasmussen
ec2e51c5ec
test escape characters (#171)
* test escape characters

* format

* tests

* run tests

* copyright
2024-10-03 10:08:30 -04:00
Preston Rasmussen
ae9b5eca9c
update lucene sanitizer (#170)
* update lucene sanitizer

* update
2024-10-02 11:58:12 -04:00
Preston Rasmussen
fd341a6f16
Add MSC benchmark and improve search performance (#157)
* test cases

* test

* benchmark

* eval updates

* improve search performance

* remove data

* formatting

* add None type to config

* update sanitization

* push version

* maketrans update

* mypy
2024-09-26 16:12:38 -04:00
Preston Rasmussen
d7c20c1f59
Search refactor + Community search (#111)
* WIP

* WIP

* WIP

* community search

* WIP

* WIP

* integration tested

* tests

* tests

* mypy

* mypy

* format
2024-09-16 14:03:05 -04:00
Preston Rasmussen
06d8d9359f
Add Missing Node and edge CRUD (#51)
* add CRUD operations and fix search limit bugs

* format

* update tests

* å

* update tests to double limit call

* add default field

* format

* import correct field
2024-08-27 16:18:01 -04:00