-
Notifications
You must be signed in to change notification settings - Fork 0
Fix/cog 2139 deepeval retry #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
<!-- .github/pull_request_template.md --> ## Description Resolve issue with .venv being broken when using docker compose with Cognee ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin. --------- Co-authored-by: Boris Arzentar <[email protected]>
… 1947 (topoteretes#760) <!-- .github/pull_request_template.md --> ## Description <!-- Provide a clear description of the changes in this PR --> ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin. --------- Co-authored-by: Boris <[email protected]> Co-authored-by: Igor Ilic <[email protected]> Co-authored-by: Igor Ilic <[email protected]>
<!-- .github/pull_request_template.md --> ## Description Add support for UV and for Poetry package management ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
<!-- .github/pull_request_template.md --> ## Description Switch typing from str to UUID for NetworkX node_id ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
<!-- .github/pull_request_template.md --> ## Description Add both sse and stdio support for Cognee MCP ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
…83] (topoteretes#782) <!-- .github/pull_request_template.md --> ## Description Add log handling options for cognee exceptions ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
<!-- .github/pull_request_template.md --> ## Description Fix issue with failing versions gh actions ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
<!-- .github/pull_request_template.md --> ## Description <!-- Provide a clear description of the changes in this PR --> ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin. --------- Co-authored-by: Vasilije <[email protected]>
…oteretes#766) <!-- .github/pull_request_template.md --> ## Description <!-- Provide a clear description of the changes in this PR --> ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
<!-- .github/pull_request_template.md --> ## Description <!-- Provide a clear description of the changes in this PR --> ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin. Co-authored-by: Vasilije <[email protected]>
<!-- .github/pull_request_template.md --> ## Description <!-- Provide a clear description of the changes in this PR --> ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin. --------- Co-authored-by: Hande <[email protected]> Co-authored-by: Vasilije <[email protected]>
<!-- .github/pull_request_template.md --> ## Description <!-- Provide a clear description of the changes in this PR --> ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin. --------- Co-authored-by: Hande <[email protected]> Co-authored-by: Vasilije <[email protected]>
<!-- .github/pull_request_template.md --> ## Description This PR adds support for the Memgraph graph database following the [graph database integration guide](https://docs.cognee.ai/contributing/adding-providers/graph-db/graph-database-integration): - Implemented `MemgraphAdapter` for interfacing with Memgraph. - Updated `get_graph_engine.py` to return MemgraphAdapter when appropriate. - Added a test script:` test_memgraph.py.` - Created a dedicated test workflow: `.github/workflows/test_memgraph.yml.` ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin. --------- Co-authored-by: Vasilije <[email protected]> Co-authored-by: Boris <[email protected]>
<!-- .github/pull_request_template.md --> ## Description refactor: Handle boto3 s3fs dependencies better ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
…oteretes#814) <!-- .github/pull_request_template.md --> ## Description <!-- Provide a clear description of the changes in this PR --> ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
…#770) <!-- .github/pull_request_template.md --> ## Description Update LanceDB and rewrite data points to run async ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin. --------- Co-authored-by: Boris <[email protected]> Co-authored-by: Boris Arzentar <[email protected]>
<!-- .github/pull_request_template.md --> ## Description <!-- Provide a clear description of the changes in this PR --> ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
<!-- .github/pull_request_template.md --> ## Description <!-- Provide a clear description of the changes in this PR --> ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
…retes#771) <!-- .github/pull_request_template.md --> ## Description As discussed with @hande-k and Lazar, I've created a short demo to illustrate how to get the pagerank rankings from the knowledge graph given the nx engine. This is a POC, and a first of step towards solving topoteretes#643 . Please let me know what you think, and how to proceed from here. :) ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin. --------- Co-authored-by: Boris <[email protected]> Co-authored-by: Hande <[email protected]> Co-authored-by: Vasilije <[email protected]>
<!-- .github/pull_request_template.md --> ## Description Added tools to check current cognify and codify status ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
<!-- .github/pull_request_template.md --> ## Description <!-- Provide a clear description of the changes in this PR --> ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin. Co-authored-by: Igor Ilic <[email protected]>
<!-- .github/pull_request_template.md --> ## Description Add info about installing Cognee locally ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
…oteretes#874) <!-- .github/pull_request_template.md --> ## Description Adds subgraph retriever to graph based completion searches ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
<!-- .github/pull_request_template.md --> ## Description <!-- Provide a clear description of the changes in this PR --> ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
<!-- .github/pull_request_template.md --> ## Description <!-- Provide a clear description of the changes in this PR --> ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin. Co-authored-by: Vasilije <[email protected]>
<!-- .github/pull_request_template.md --> ## Description <!-- Provide a clear description of the changes in this PR --> ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
<!-- .github/pull_request_template.md --> ## Description Removes graph metrics calculation from dynamic steps and ontology demos ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
…poteretes#884) <!-- .github/pull_request_template.md --> ## Description Removes unused properies from node and edge pydantic models. ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin. Co-authored-by: Boris <[email protected]>
<!-- .github/pull_request_template.md --> ## Description <!-- Provide a clear description of the changes in this PR --> ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
<!-- .github/pull_request_template.md --> ## Description <!-- Provide a clear description of the changes in this PR --> ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
<!-- .github/pull_request_template.md --> ## Description <!-- Provide a clear description of the changes in this PR --> ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin. --------- Co-authored-by: vasilije <[email protected]> Co-authored-by: Igor Ilic <[email protected]> Co-authored-by: Vasilije <[email protected]> Co-authored-by: Igor Ilic <[email protected]> Co-authored-by: Hande <[email protected]> Co-authored-by: Matea Pesic <[email protected]> Co-authored-by: hajdul88 <[email protected]> Co-authored-by: Daniel Molnar <[email protected]> Co-authored-by: Diego Baptista Theuerkauf <[email protected]> Co-authored-by: github-actions[bot] <[email protected]>
# Conflicts: # CONTRIBUTING.md # Dockerfile # README.md # cognee-mcp/pyproject.toml # cognee-mcp/src/server.py # cognee-mcp/uv.lock # cognee/infrastructure/databases/graph/memgraph/memgraph_adapter.py # cognee/infrastructure/databases/graph/networkx/adapter.py # cognee/infrastructure/databases/vector/chromadb/ChromaDBAdapter.py # cognee/infrastructure/databases/vector/milvus/MilvusAdapter.py # cognee/infrastructure/databases/vector/qdrant/QDrantAdapter.py # cognee/infrastructure/databases/vector/weaviate_db/WeaviateAdapter.py # cognee/modules/retrieval/graph_completion_retriever.py # cognee/modules/retrieval/utils/brute_force_triplet_search.py # cognee/tests/test_neo4j.py # entrypoint.sh # pyproject.toml # uv.lock
…opoteretes#882) <!-- .github/pull_request_template.md --> ## Description Update relational db migration example so it's more understandable ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin. --------- Co-authored-by: Boris <[email protected]>
<!-- .github/pull_request_template.md --> ## Description <!-- Provide a clear description of the changes in this PR --> ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
<!-- .github/pull_request_template.md --> ## Description <!-- Provide a clear description of the changes in this PR --> ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin. --------- Co-authored-by: Igor Ilic <[email protected]> Co-authored-by: Igor Ilic <[email protected]> Co-authored-by: Vasilije <[email protected]>
Adds base node label to Neo4j Adapter ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin. --------- Signed-off-by: Diego B Theuerkauf <[email protected]> Co-authored-by: Boris <[email protected]> Co-authored-by: vasilije <[email protected]> Co-authored-by: Igor Ilic <[email protected]> Co-authored-by: Vasilije <[email protected]> Co-authored-by: Igor Ilic <[email protected]> Co-authored-by: Hande <[email protected]> Co-authored-by: Matea Pesic <[email protected]> Co-authored-by: hajdul88 <[email protected]> Co-authored-by: Daniel Molnar <[email protected]> Co-authored-by: Diego Baptista Theuerkauf <[email protected]> Co-authored-by: Dmitrii Galkin <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: lxobr <[email protected]> Co-authored-by: github-actions[bot] <[email protected]>
<!-- .github/pull_request_template.md --> ## Description <!-- Provide a clear description of the changes in this PR --> ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
CALL gds.wcc.stream('{graph_name}') | ||
YIELD componentId | ||
RETURN count(DISTINCT componentId) AS num_connected_components; | ||
CALL gds.wcc.stats('{graph_name}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# In get_num_connected_components, modify the query definition and execution:
# Original f-string query construction:
# query = f"""
# CALL gds.wcc.stats('{graph_name}')
# YIELD componentCount
# RETURN componentCount AS num_connected_components;
# """
# Suggested approach with parameterized query:
query_template = """
CALL gds.wcc.stats($graph_name_param)
YIELD componentCount
RETURN componentCount AS num_connected_components;
"""
# And call the adapter with parameters (exact syntax depends on your Neo4jAdapter):
# result = await adapter.query(query_template, params={"graph_name_param": graph_name})
The graph_name
parameter is directly embedded into Cypher queries using f-strings in multiple locations (lines 60 and 184 in neo4j_metrics_utils.py), which can lead to Cypher injection vulnerabilities if graph_name
is derived from untrusted input.
This issue appears in multiple locations:
- cognee/infrastructure/databases/graph/neo4j_driver/neo4j_metrics_utils.py: Lines 60-60
- cognee/infrastructure/databases/graph/neo4j_driver/neo4j_metrics_utils.py: Lines 184-184
Please use parameterized queries for all instances wheregraph_name
is embedded in Cypher queries to prevent injection vulnerabilities.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
# Not understanding | ||
query = f""" | ||
UNWIND $node_ids AS id | ||
MATCH (node:`{id}`)-[r:{edge_label}]->(predecessor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MATCH (predecessor)-[r:`{edge_label}`]->(node:`{BASE_LABEL}` {id: id})
Multiple Cypher queries incorrectly use node IDs as labels and have incorrect relationship direction patterns (lines 734 and 763 in neo4j_driver/adapter.py), which will lead to incorrect graph operations.
This issue appears in multiple locations:
- cognee/infrastructure/databases/graph/neo4j_driver/adapter.py: Lines 734-734
- cognee/infrastructure/databases/graph/neo4j_driver/adapter.py: Lines 763-763
Please correct all Cypher queries to use proper node labeling withBASE_LABEL
and ensure relationship directions match the intended operation (predecessors vs. successors).
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
shell: bash | ||
services: | ||
memgraph: | ||
image: memgraph/memgraph-mage:latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image: memgraph/memgraph-mage:X.Y.Z # Replace X.Y.Z with a specific stable version
Using the :latest
tag for the memgraph/memgraph-mage
service image can lead to unexpected build failures if a new latest
version introduces breaking changes or incompatibilities. Pinning to a specific image version (e.g., memgraph/memgraph-mage:2.5.0
or another known stable version) ensures more reproducible and stable CI runs.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
if score is not None: | ||
metrics_data[metric].append(score) | ||
if "reason" in values: | ||
metric_details[metric].append( | ||
{ | ||
"question": entry["question"], | ||
"answer": entry["answer"], | ||
"golden_answer": entry["golden_answer"], | ||
"reason": values["reason"], | ||
"score": score, | ||
} | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Ensure score is numeric (int or float)
if isinstance(score, (int, float)):
processed_score = float(score) # Convert to float for List[float] consistency
metrics_data[metric].append(processed_score)
if "reason" in values:
metric_details[metric].append(
{
"question": entry["question"],
"answer": entry["answer"],
"golden_answer": entry["golden_answer"],
"reason": values["reason"],
"score": processed_score, # Use the consistent processed score
}
)
# Optional: else if score is not None (i.e., it's non-numeric and not None):
# # Log or handle unexpected non-numeric scores
# # e.g., import logging; logging.warning(f"Skipping non-numeric score '{score}' for metric '{metric}'.")
The current check if score is not None:
effectively filters out None
values. However, the function extract_metrics_and_details
is type-hinted to produce metrics_data
as Dict[str, List[float]]
. To ensure type consistency and prevent potential downstream errors if score
were a non-None
, non-numeric type (e.g., a string), consider also verifying that score
is numeric (e.g., int
or float
) before appending. This would make the data handling more robust and strictly align with the type hints, preventing errors in np.mean
and ensuring metrics_data
contains only floats.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
f"Attempt {attempt + 1}/{self.n_retries} failed for metric '{metric}': {e}" | ||
) | ||
if attempt < self.n_retries - 1: | ||
time.sleep(2**attempt) # Exponential backoff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await asyncio.sleep(2**attempt) # Exponential backoff
The synchronous time.sleep()
on line 43 will block the asyncio event loop because _calculate_metric
(defined on line 27) is a synchronous method called from the async
method evaluate_answers
(call on line 75). To prevent event loop blockage and improve concurrency, _calculate_metric
should be converted to an async
method. This involves changing its definition to async def
, using await asyncio.sleep()
instead of time.sleep()
, and await
ing the call to self._calculate_metric
. An import asyncio
statement will be necessary. Furthermore, if metric_to_calculate.measure(test_case)
(line 33) performs blocking I/O operations (common for evaluation metrics involving external calls), it should also be handled asynchronously, for instance, by running it in a thread pool executor using await asyncio.get_event_loop().run_in_executor(None, metric_to_calculate.measure, test_case)
.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
self.query( | ||
(f"CREATE CONSTRAINT IF NOT EXISTS FOR (n:`{BASE_LABEL}`) REQUIRE n.id IS UNIQUE;") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# This async call needs to be properly handled in the synchronous __init__.
# For example, by moving it to an async setup method:
# async def setup_database(self):
# await self.query(f"CREATE CONSTRAINT IF NOT EXISTS FOR (n:`{BASE_LABEL}`) REQUIRE n.id IS UNIQUE;")
# Or by using a synchronous Neo4j call if available for this operation.
# The current call `self.query(...)` will not execute the constraint creation.
The self.query
method is asynchronous, but it's being called from the synchronous __init__
method without being awaited. This means the Cypher query to create the unique constraint on n.id
will not actually be executed; self.query(...)
will only return a coroutine object. The constraint will not be created in the database. This critical setup step needs to be performed in an async context, for example, by moving it to an async def initialize(self)
method that is called and awaited after object instantiation, or by using a synchronous Neo4j driver call if one is available for constraint creation.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
MATCH (from_node)-[relationship]->(to_node) | ||
WHERE from_node.id = $from_node_id AND to_node.id = $to_node_id AND type(relationship) = $edge_label | ||
query = f""" | ||
MATCH (from_node: `{BASE_LABEL}`)-[:`{edge_label}`]->(to_node: `{BASE_LABEL}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MATCH (from_node: `{BASE_LABEL}`)-[r:`{edge_label}`]->(to_node: `{BASE_LABEL}`)
The Cypher query's MATCH
clause on line 295 defines an anonymous relationship [:
{edge_label}]
. However, the subsequent RETURN
statement (on line 297, which is context code not changed in this diff) refers to COUNT(relationship)
. This will cause a Cypher error as relationship
is not bound. You need to assign a variable to the relationship in the MATCH
pattern on line 295, for example, [r:
{edge_label}]
, and then use COUNT(r)
.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
auth_data = SimpleNamespace( | ||
id=UUID(payload["user_id"]), tenant_id=None, roles=payload["roles"] | ||
) | ||
auth_data = SimpleNamespace(id=UUID(payload["user_id"]), tenant_id=None, roles=[]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user_id_str = payload.get("user_id")
if not user_id_str: # Check for None or empty string
raise HTTPException(status_code=401, detail="'user_id' missing or empty in token payload.")
try:
user_uuid = UUID(user_id_str)
except ValueError:
raise HTTPException(status_code=401, detail="'user_id' in token payload is not a valid UUID.")
auth_data = SimpleNamespace(id=user_uuid, tenant_id=None, roles=[])
The code on line 32 directly accesses payload["user_id"]
and passes it to UUID()
. If the user_id
key is missing from the JWT payload, this will raise a KeyError
. If user_id
is present but is an empty string or not a valid UUID format, UUID()
will raise a ValueError
. Both scenarios would likely lead to unhandled exceptions and a 500 error. It's recommended to use payload.get("user_id")
for safer access, then validate its presence and format, raising a specific HTTPException
(e.g., 401) if it's missing or invalid. This aligns with the safer handling already implemented for tenant_id
.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
with open( | ||
"examples/relational_db_with_dlt/fix_foreign_keys.sql", "r", encoding="utf-8" | ||
) as f: | ||
sql_script = f.read() | ||
raw_conn.executescript(sql_script) # runs multiple statements | ||
print("[apply_foreign_key_fixes] Applied foreign key fixes") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sql_script_path = "examples/relational_db_with_dlt/fix_foreign_keys.sql"
try:
with open(sql_script_path, "r", encoding="utf-8") as f:
sql_script_content = f.read()
raw_conn.executescript(sql_script_content)
print("[apply_foreign_key_fixes] Applied foreign key fixes")
except FileNotFoundError:
print(f"[apply_foreign_key_fixes] Warning: '{sql_script_path}' not found. Foreign key fixes skipped.")
except Exception as e: # Catch other potential errors from executescript
print(f"[apply_foreign_key_fixes] Error applying fixes from '{sql_script_path}': {e}. Fixes might be incomplete.")
The script attempts to open and execute fix_foreign_keys.sql
without explicit error handling for FileNotFoundError
. If the SQL file is missing or not accessible, the script will raise an unhandled FileNotFoundError
and terminate. It's recommended to wrap the file operations and SQL execution in a try-except block to gracefully handle cases where the file cannot be found, allowing the script to potentially continue or exit with a more informative message.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
Description
DCO Affirmation
I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
This pull request introduces several updates and improvements across multiple files in the
kodustech/cognee
repository. Key changes include:GitHub Actions Workflow: The Memgraph integration testing workflow is updated to re-enable triggers for pull requests and manual dispatch. Memgraph is integrated as a Docker service, the
actions/checkout
action is updated to v3, and the Poetry install command now uses theneo4j
extra. The test environment is configured to connect to the local Memgraph service using default credentials.Documentation Enhancements:
README.md
is refined to emphasize the project's capability to replace RAG systems, improving clarity and consistency.cognee-mcp/README.md
is enhanced with a direct link to external documentation and a new 'Running the Server' section with command-line instructions for server startup.Code Improvements:
metrics_calculator.py
, a check is added to filter outNone
scores during metrics extraction, preventing errors in numerical calculations.DeepEvalAdapter
indeep_eval_adapter.py
now includes a retry mechanism with exponential backoff for metric calculations, encapsulated in a new private method_calculate_metric
.memgraph_adapter.py
file sees a method renaming for consistency and the introduction of new methodsget_node
andget_nodes
, which may duplicate existing functionality.neo4j_driver/adapter.py
are refactored to use aBASE_LABEL
for node matching and creation, with a unique constraint onnode.id
. However, issues such as an un-awaited asynchronous call and Cypher query errors are identified.neo4j_metrics_utils.py
are updated for performance but pose a security risk due to potential Cypher injection, suggesting the need for parameterized queries.User Module Update: The
get_authenticated_user.py
file improves JWT payload processing by using safer access methods and default values to preventKeyError
exceptions.Example Scripts:
relational_database_migration_example.py
script is refined with better abstraction, improved search functionality, and enhanced user guidance through comments.relational_db_and_dlt.py
, demonstrates an end-to-end data processing pipeline usingdlt
, SQLite, and Cognee's knowledge graph, withasyncio
for orchestration and a patch forSqlalchemyCredentials
.These changes aim to enhance functionality, robustness, and clarity across the project.