Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
475133a
fix: refactor get_graph_from_model to return nodes and edges correctly
borisarzentar Dec 5, 2024
20968be
fix: add missing params
borisarzentar Dec 5, 2024
11055c0
fix: remove complex zip usage
borisarzentar Dec 5, 2024
f36fe70
fix: add edges to data_point properties
borisarzentar Dec 5, 2024
33cdca5
Merge remote-tracking branch 'origin/main' into fix/graph-extraction-…
borisarzentar Dec 5, 2024
3f04dbb
fix: handle rate limit error coming from llm model
borisarzentar Dec 5, 2024
461ae00
fix: fixes lost edges and nodes in get_graph_from_model
hajdul88 Dec 5, 2024
8cbac09
fix: fixes database pruning issue in pgvector
hajdul88 Dec 6, 2024
f4403f1
fix: fixes database pruning issue in pgvector (#261)
hajdul88 Dec 6, 2024
0128530
feat: adds code summary embeddings to vector DB
hajdul88 Dec 6, 2024
071aa66
Merge branch 'fix/graph-extraction-from-model' into feature/cog-539-i…
hajdul88 Dec 6, 2024
3856712
Merge pull request #264 from topoteretes/gh-actions-all-branches
hajdul88 Dec 6, 2024
2c89e70
fix: cognee_demo notebook pipeline is not saving summaries
borisarzentar Dec 6, 2024
ed24107
Merge remote-tracking branch 'origin/main' into fix/graph-extraction-…
borisarzentar Dec 6, 2024
c2d1057
Merge remote-tracking branch 'origin/fix/graph-extraction-from-model'…
borisarzentar Dec 6, 2024
6ade117
Merge branch 'fix/graph-extraction-from-model' into feature/cog-539-i…
hajdul88 Dec 6, 2024
fb0f97c
Merge branch 'main' into feature/cog-539-implementing-additional-retr…
hajdul88 Dec 6, 2024
f4a0104
feat: implements first version of codegraph retriever
hajdul88 Dec 6, 2024
51b825e
Merge branch 'main' into feature/cog-539-implementing-additional-retr…
hajdul88 Dec 6, 2024
3ef3376
Merge branch 'feature/cog-539-implementing-additional-retriever-appro…
hajdul88 Dec 6, 2024
7b2dbf7
Merge branch 'main' into feature/cog-539-implementing-additional-retr…
hajdul88 Dec 9, 2024
af55ac5
chore: implements minor changes mostly to make the code production ready
hajdul88 Dec 9, 2024
3cbcfc1
fix: turns off raising duplicated edges unit test as we have these in…
hajdul88 Dec 9, 2024
1e3367d
feat: implements unit tests for description to codepart search
hajdul88 Dec 9, 2024
7edb5dd
fix: fixes edge property inconsistent access in codepart retriever
hajdul88 Dec 9, 2024
00a3668
chore: implements more precise typing for get_attribute method for co…
hajdul88 Dec 9, 2024
0a022ce
Merge branch 'main' into feature/cog-539-implementing-additional-retr…
hajdul88 Dec 10, 2024
a39e692
chore: adds spacing to tests and changes the cogneegraph getter names
hajdul88 Dec 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: add edges to data_point properties
  • Loading branch information
borisarzentar committed Dec 5, 2024
commit f36fe70468f1b0efa466062e6954b219b39b5b7b
29 changes: 14 additions & 15 deletions cognee/modules/graph/utils/get_graph_from_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ async def get_graph_from_model(
visited_properties: dict = None,
include_root = True,
):
if str(data_point.id) in added_nodes:
return [], []

nodes = []
edges = []
visited_properties = visited_properties or {}
Expand Down Expand Up @@ -74,6 +77,17 @@ async def get_graph_from_model(

if str(field_value.id) in added_nodes:
continue

edge_key = str(data_point.id) + str(field_value.id) + field_name

if str(edge_key) not in added_edges:
edges.append((data_point.id, field_value.id, field_name, {
"source_node_id": data_point.id,
"target_node_id": field_value.id,
"relationship_name": field_name,
"updated_at": datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S"),
}))
added_edges[str(edge_key)] = True

property_nodes, property_edges = await get_graph_from_model(
field_value,
Expand All @@ -89,21 +103,6 @@ async def get_graph_from_model(
for edge in property_edges:
edges.append(edge)

for property_node in get_own_property_nodes(property_nodes, property_edges):
if str(data_point.id) == str(property_node.id):
continue

edge_key = str(data_point.id) + str(property_node.id) + field_name

if str(edge_key) not in added_edges:
edges.append((data_point.id, property_node.id, field_name, {
"source_node_id": data_point.id,
"target_node_id": property_node.id,
"relationship_name": field_name,
"updated_at": datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S"),
}))
added_edges[str(edge_key)] = True

property_key = str(data_point.id) + field_name + str(field_value.id)
visited_properties[property_key] = True

Expand Down