Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
468de67
refactor: utils folder in retrieval
lxobr Feb 21, 2025
d789dd0
feat: add base_retriever.py
lxobr Feb 21, 2025
49c2355
feat: add retriever classes
lxobr Feb 21, 2025
7619df2
fix: include generate_completion function
lxobr Feb 21, 2025
5a5eb5e
feat: add search comparison script, compare summaries
lxobr Feb 21, 2025
8f0cbee
feat: enable context dumping
lxobr Feb 24, 2025
beacdea
fix: improve context getting and completion
lxobr Feb 24, 2025
4b71081
feat: add all searches and context comparisons
lxobr Feb 24, 2025
7631b11
Merge branch 'dev' into feat/COG-1365-unify-retrievers
lxobr Feb 24, 2025
62f8ac3
Update cognee/tasks/completion/query_completion.py
lxobr Feb 24, 2025
58c7eaf
feat: context dumping error handling
lxobr Feb 24, 2025
afd5ca4
feat: expose aggregate metrics, enable saving
lxobr Feb 24, 2025
8bf5aae
feat: add modal example
lxobr Feb 24, 2025
fd7f837
delete: metrics_dashboard.py
lxobr Feb 24, 2025
416eed1
fix: dashboard generation
lxobr Feb 24, 2025
d9fcb12
feat: add get_golden_context flag
lxobr Feb 25, 2025
36dbdf7
feat: implement get_golden_context for hotpot_qa
lxobr Feb 25, 2025
c07cf22
chore: added todos
lxobr Feb 25, 2025
2ef174a
chore: added a todo
lxobr Feb 25, 2025
5910fb7
Merge branch 'dev' into feat/COG-1365-unify-retrievers
lxobr Feb 25, 2025
65784e1
Merge branch 'dev' into feat/COG-1364-golden-contexts
lxobr Feb 25, 2025
bdaea29
feat: simplify twowikimultihop, get golden context
lxobr Feb 25, 2025
32d5829
feat: add golden context to musique_adapter.py
lxobr Feb 25, 2025
ec3b753
Merge branch 'dev' into feat/COG-1331-modal-run-eval
lxobr Feb 25, 2025
2f70de4
fix: update tests
lxobr Feb 27, 2025
3d0b839
Merge branch 'dev' into feat/COG-1365-unify-retrievers
lxobr Feb 27, 2025
4903d7e
feat: update code retriever
lxobr Feb 27, 2025
e98c12e
refactor: rename variables
lxobr Feb 27, 2025
af5d7c6
Merge branch 'dev' into feat/COG-1364-golden-contexts
lxobr Feb 27, 2025
0ece58a
refactor: add metadata_field_name property
lxobr Feb 27, 2025
cb0fccd
Merge remote-tracking branch 'origin/feat/COG-1331-modal-run-eval' in…
alekszievr Feb 27, 2025
1eb5e71
Merge remote-tracking branch 'origin/feat/COG-1364-golden-contexts' i…
alekszievr Feb 27, 2025
30927d7
First render.
soobrosa Feb 27, 2025
b02231d
Small fixes.
soobrosa Feb 27, 2025
2d90221
coderabbit don't be smart
soobrosa Feb 27, 2025
68a4584
Merge branch 'dev' into feat/cog-1366-add-context-evaluation
alekszievr Feb 27, 2025
8521fa8
Merge remote-tracking branch 'origin/feature/cog-1403-transition-to-n…
alekszievr Feb 27, 2025
3906bf5
Merge branch 'dev' into feat/cog-1366-add-context-evaluation
alekszievr Feb 27, 2025
aae1237
Calculate context relevancy score
alekszievr Feb 27, 2025
4cffd4b
Adjust dashboard tests
alekszievr Feb 27, 2025
2e2beb3
Adjust answer generation test
alekszievr Feb 27, 2025
7a574e3
adjust deepeval adapter test
alekszievr Feb 27, 2025
a17a5c8
Fix type hinting
alekszievr Feb 27, 2025
3f10725
Merge branch 'dev' into feat/cog-1366-add-context-evaluation
alekszievr Feb 27, 2025
df5ba7b
Merge branch 'dev' into feat/cog-1366-add-context-evaluation
alekszievr Feb 27, 2025
4c09877
Merge branch 'dev' into feat/cog-1366-add-context-evaluation
alekszievr Mar 3, 2025
d9b007a
ruff format
alekszievr Mar 3, 2025
5691a1f
fix
alekszievr Mar 3, 2025
634a7fa
fix: add comment to new param
borisarzentar Mar 3, 2025
3453ede
Merge branch 'dev' into feat/cog-1366-add-context-evaluation
borisarzentar Mar 3, 2025
5b9a64d
Merge branch 'dev' into feat/cog-1366-add-context-evaluation
alekszievr Mar 5, 2025
6b2b6f2
Pass system prompt in question answering
alekszievr Mar 5, 2025
1a3371e
Adjust tests
alekszievr Mar 5, 2025
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
5 changes: 3 additions & 2 deletions cognee/api/v1/cognify/routers/get_code_pipeline_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from fastapi.responses import JSONResponse
from cognee.api.DTO import InDTO
from cognee.api.v1.cognify.code_graph_pipeline import run_code_graph_pipeline
from cognee.modules.retrieval import code_graph_retrieval
from cognee.modules.retrieval.base_retriever import CodeRetriever
from cognee.modules.storage.utils import JSONEncoder


Expand Down Expand Up @@ -43,7 +43,8 @@ async def code_pipeline_retrieve(payload: CodePipelineRetrievePayloadDTO):
else payload.full_input
)

retrieved_files = await code_graph_retrieval(query)
retriever = CodeRetriever()
retrieved_files = await retriever.get_context(query)

return json.dumps(retrieved_files, cls=JSONEncoder)
except Exception as error:
Expand Down
2 changes: 1 addition & 1 deletion cognee/modules/retrieval/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from cognee.modules.retrieval.utils.code_graph_retrieval import code_graph_retrieval
from cognee.modules.retrieval.code_retriever import CodeRetriever
7 changes: 6 additions & 1 deletion cognee/modules/retrieval/base_retriever.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from abc import ABC, abstractmethod
from typing import Any, Optional
from typing import Any, Optional, Callable


class BaseRetriever(ABC):
Expand All @@ -14,3 +14,8 @@ async def get_context(self, query: str) -> Any:
async def get_completion(self, query: str, context: Optional[Any] = None) -> Any:
"""Generates a response using the query and optional context."""
pass

@classmethod
def as_search(cls) -> Callable:
"""Creates a search function from the retriever class."""
return lambda query: cls().get_completion(query)
128 changes: 0 additions & 128 deletions cognee/modules/retrieval/utils/code_graph_retrieval.py

This file was deleted.

221 changes: 0 additions & 221 deletions cognee/modules/retrieval/utils/run_search_comparisons.py

This file was deleted.

Loading