Skip to content

Commit f948f1e

Browse files
committed
fix: lower graph similarity threshold to 0.08 for real code snippets
1 parent 70ea46c commit f948f1e

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎apps/api/app/algorithms/graph.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def _snippet_text(snippet: dict) -> str:
2020

2121
def build_dependency_graph(
2222
snippets: list[dict],
23-
similarity_threshold: float = 0.25,
23+
similarity_threshold: float = 0.08,
2424
) -> list[dict]:
2525
"""Build a knowledge dependency graph from a list of snippets.
2626

‎apps/api/app/models/schemas.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class GraphSnippetInput(BaseModel):
148148

149149
class GraphBuildRequest(BaseModel):
150150
snippets: list[GraphSnippetInput]
151-
similarity_threshold: float = Field(default=0.25, ge=0.0, le=1.0)
151+
similarity_threshold: float = Field(default=0.08, ge=0.0, le=1.0)
152152

153153

154154
class DependencyEdge(BaseModel):

‎apps/web/app/api/graph/route.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export async function POST() {
3636
tags: s.tags ?? [],
3737
created_at: s.created_at,
3838
})),
39+
similarity_threshold: 0.08,
3940
})
4041

4142
// Delete old edges for this user, then insert the fresh set

0 commit comments

Comments
 (0)