Commit graph

4955 commits

Author SHA1 Message Date
Boris
d932bbb157
Merge fae9869a3f into 2ef347f8fa 2026-01-20 19:41:02 +01:00
Igor Ilic
2ef347f8fa
refactor: Fix mcp migrations (#1897)
<!-- .github/pull_request_template.md -->

## Description
- Include alembic migrations with Cognee library
- Use alembic migrations from Cognee library in Cognee MCP

## Type of Change
<!-- Please check the relevant option -->
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Other (please specify):

## Screenshots/Videos (if applicable)
<!-- Add screenshots or videos to help explain your changes -->

## Pre-submission Checklist
<!-- Please check all boxes that apply before submitting your PR -->
- [ ] **I have tested my changes thoroughly before submitting this PR**
- [ ] **This PR contains minimal changes necessary to address the
issue/feature**
- [ ] My code follows the project's coding standards and style
guidelines
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have added necessary documentation (if applicable)
- [ ] All new and existing tests pass
- [ ] I have searched existing PRs to ensure this change hasn't been
submitted already
- [ ] I have linked any relevant issues in the description
- [ ] My commits have clear and descriptive messages

## 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 is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* More robust startup: migration failures now trigger automatic database
initialization fallback, improving recovery and reducing failed starts.
* Improved startup sequencing with environment-aware process startup and
optional debug wait to aid local development.

* **Chores**
* Reorganized where migration configuration is located inside the
image/build.
  * Removed outdated dependency/configuration comments.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-20 17:20:15 +01:00
Milenko Gavrić
ac4cb0d0d0
add codes from guides to a separate folder (#2003)
<!-- .github/pull_request_template.md -->

## Description
<!--
Please provide a clear, human-generated description of the changes in
this PR.
DO NOT use AI-generated descriptions. We want to understand your thought
process and reasoning.
-->

## Acceptance Criteria

## Type of Change
<!-- Please check the relevant option -->
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [x] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Other (please specify):

## Screenshots/Videos (if applicable)

## Pre-submission Checklist
<!-- Please check all boxes that apply before submitting your PR -->
- [ ] **I have tested my changes thoroughly before submitting this PR**
- [x] **This PR contains minimal changes necessary to address the
issue/feature**
- [ ] My code follows the project's coding standards and style
guidelines
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have added necessary documentation (if applicable)
- [ ] All new and existing tests pass
- [ ] I have searched existing PRs to ensure this change hasn't been
submitted already
- [ ] I have linked any relevant issues in the description
- [ ] My commits have clear and descriptive messages

## 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 is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Added a dozen new example guides demonstrating: custom data models and
relationships; custom prompts and graph queries; LLM-driven extraction
and pipelines; graph visualization; low-level LLM usage; memify
quickstart; ontology quickstart; S3 storage integration; temporal
cognify workflows; basic and advanced search scenarios.
  * Added a sample RDF/OWL ontology file for ontology examples.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-20 16:25:03 +01:00
Igor Ilic
c29fb51619
Merge branch 'dev' into fix-mcp-migrations 2026-01-20 16:18:44 +01:00
Milenko Gavric
8d238f1da3 apply coderabbitai's fixes 2026-01-20 14:48:28 +01:00
Igor Ilic
6e69daa527
Remove payload vector search [COG-3708] (#1998)
<!-- .github/pull_request_template.md -->

## Description
Make payload information optional when searching vector databases to
optimize performance

## Type of Change
<!-- Please check the relevant option -->
- [ ] Bug fix (non-breaking change that fixes an issue)
- [x] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Other (please specify):

## Screenshots/Videos (if applicable)
<!-- Add screenshots or videos to help explain your changes -->

## Pre-submission Checklist
<!-- Please check all boxes that apply before submitting your PR -->
- [ ] **I have tested my changes thoroughly before submitting this PR**
- [ ] **This PR contains minimal changes necessary to address the
issue/feature**
- [ ] My code follows the project's coding standards and style
guidelines
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have added necessary documentation (if applicable)
- [ ] All new and existing tests pass
- [ ] I have searched existing PRs to ensure this change hasn't been
submitted already
- [ ] I have linked any relevant issues in the description
- [ ] My commits have clear and descriptive messages

## 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 is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

# Release Notes

* **New Features**
* Added optional `include_payload` parameter to search operations across
all vector database implementations. When enabled, search results
include complete payload data; disabled by default for improved
performance.

* **Improvements**
* Enhanced result efficiency by making payload optional in search
results.
* Standardized edge identifier generation for consistent graph
operations.
* Optimized data lookups to use direct IDs instead of payload
extraction.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-20 10:25:08 +01:00
Vasilije
6a01ad3a00
feat: Adds api and tool logging to redis (#2000)
<!-- .github/pull_request_template.md -->

## Description

This PR implements a logging system that:

- Logs API endpoint and MCP tool calls to Redis
- Captures function/tool name, type (api_endpoint/mcp_tool), parameters,
return values, user information, timing, and metadata
- Stores logs in Redis with configurable TTL (default 7 days)
- Is transparent to existing code (decorator pattern)
- Handles all parameter types gracefully (including non-serializable
values)
- Works independently of the caching system

## Acceptance Criteria

Deploy Redis locally and set USAGE_LOGGING to True as well as
CACHE_BACKEND to redis.

Usage of mcp tools (cognify, save_interaction, search, list_data,
delete, prune, cognify_status) and default cognee endpoints (add,
cognify, search, memify) should log the following entries into redis:

- timestamp
- type
- function_name
- user_id
- parameters
- result
- success
- error
- duration_ms
- metadata


## Type of Change
<!-- Please check the relevant option -->
- [ ] Bug fix (non-breaking change that fixes an issue)
- [x] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Other (please specify):

## Screenshots/Videos (if applicable)
<!-- Add screenshots or videos to help explain your changes -->

## Pre-submission Checklist
<!-- Please check all boxes that apply before submitting your PR -->
- [x] **I have tested my changes thoroughly before submitting this PR**
- [x] **This PR contains minimal changes necessary to address the
issue/feature**
- [x] My code follows the project's coding standards and style
guidelines
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added necessary documentation (if applicable)
- [x] All new and existing tests pass
- [x] I have searched existing PRs to ensure this change hasn't been
submitted already
- [x] I have linked any relevant issues in the description
- [x] My commits have clear and descriptive messages

## 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 is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Usage logging added across API endpoints and MCP tools to record
per-user/tool activity.
* Configuration options to enable logging and set retention (default 7
days).
* Retrieve recent usage logs with configurable limits and
most-recent-first ordering.

* **Tests**
* New unit, integration, and end-to-end tests validating logging,
storage, retrieval, TTL, and edge cases.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-19 17:05:01 +00:00
Igor Ilic
6b8ff648ad refactor: Update tests with edge change 2026-01-19 16:03:40 +01:00
Igor Ilic
099d78ccfc refactor: add edge_type_id generation in add_edge instead of graph projection 2026-01-19 15:55:27 +01:00
Igor Ilic
01a6382552 refactor: Change payload text use to use edge id 2026-01-19 13:57:30 +01:00
Igor Ilic
334574444c Merge branch 'dev' into remove-payload-vector-search 2026-01-19 13:32:32 +01:00
hajdul88
fb77f71c30 ruff 2026-01-19 12:43:46 +01:00
hajdul88
77543dbd90 chore: adds docstrings to usage logger 2026-01-19 12:43:27 +01:00
hajdul88
a61ef4ad3f Update test_usage_logger_e2e.py 2026-01-19 10:28:44 +01:00
hajdul88
15a9563562 ruff 2026-01-19 10:25:38 +01:00
hajdul88
489cf4b79a Merge branch 'feature/cog-3502-tool-logging-with-redis' of github.com:topoteretes/cognee into feature/cog-3502-tool-logging-with-redis 2026-01-19 10:22:15 +01:00
hajdul88
68d102a5e2 chore: removing cache clear method call 2026-01-19 10:20:45 +01:00
hajdul88
25b727f387
Merge branch 'dev' into feature/cog-3502-tool-logging-with-redis 2026-01-19 10:09:10 +01:00
Vasilije
ba94d1270c
fix: Resolve issue with parameter caching for engine creation (#2004)
<!-- .github/pull_request_template.md -->

## Description
Resolve issues with parameter caching for engine creation by making sure
parameters are always called in the same order with the default values
fixed

## Acceptance Criteria
<!--
* Key requirements to the new feature or modification;
* Proof that the changes work and meet the requirements;
* Include instructions on how to verify the changes. Describe how to
test it locally;
* Proof that it's sufficiently tested.
-->

## Type of Change
<!-- Please check the relevant option -->
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Other (please specify):

## Screenshots/Videos (if applicable)
<!-- Add screenshots or videos to help explain your changes -->

## Pre-submission Checklist
<!-- Please check all boxes that apply before submitting your PR -->
- [ ] **I have tested my changes thoroughly before submitting this PR**
- [ ] **This PR contains minimal changes necessary to address the
issue/feature**
- [ ] My code follows the project's coding standards and style
guidelines
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have added necessary documentation (if applicable)
- [ ] All new and existing tests pass
- [ ] I have searched existing PRs to ensure this change hasn't been
submitted already
- [ ] I have linked any relevant issues in the description
- [ ] My commits have clear and descriptive messages

## 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.
2026-01-17 22:17:40 +01:00
Igor Ilic
255f7c7a4a refactor: add fix for database creation to mcp 2026-01-16 22:32:38 +01:00
Igor Ilic
b6d7fe21de Merge branch 'dev' into fix-mcp-migrations 2026-01-16 22:20:59 +01:00
Igor Ilic
a2cafe742d chore: update lock file 2026-01-16 22:07:13 +01:00
hajdul88
2aec13ea6e Update e2e_tests.yml 2026-01-16 19:21:01 +01:00
hajdul88
ffe5393ea7 Update e2e_tests.yml 2026-01-16 19:17:29 +01:00
hajdul88
97b392e69e Update e2e_tests.yml 2026-01-16 19:11:38 +01:00
hajdul88
cea732ea29 Update e2e_tests.yml 2026-01-16 19:03:52 +01:00
hajdul88
cc9eae0285 Update e2e_tests.yml 2026-01-16 19:01:41 +01:00
hajdul88
eb3e3984b3 Update e2e_tests.yml 2026-01-16 18:56:38 +01:00
hajdul88
58a4e34b5d Update e2e_tests.yml 2026-01-16 18:54:08 +01:00
hajdul88
61157725d1 Update e2e_tests.yml 2026-01-16 18:48:48 +01:00
hajdul88
9d373e7657 chore updates mcp deps for CI 2026-01-16 18:41:40 +01:00
hajdul88
cd841363a6 feat: adds mcp tool usage e2e test 2026-01-16 18:28:38 +01:00
hajdul88
01c851cf80 Adds usage logger e2e test 2026-01-16 18:15:17 +01:00
hajdul88
4e1e3dcfb9 chore: makes integration test a bit cleaner 2026-01-16 16:18:18 +01:00
hajdul88
3aadb91a6f ruff ruff 2026-01-16 16:13:22 +01:00
hajdul88
707269e8b8 feat: adds integration test for usage logger 2026-01-16 16:11:53 +01:00
Milenko Gavrić
17dbf2137b
Merge branch 'dev' into feature/cog-3725-add-guide-example-codes-to-main-repo 2026-01-16 15:32:10 +01:00
Vasilije
da35f028df
Merge branch 'dev' into feature/cog-3502-tool-logging-with-redis 2026-01-16 15:26:50 +01:00
Vasilije
1d674d459f
feat: Configurable batch size (#1941)
<!-- .github/pull_request_template.md -->

## Description
<!--
Please provide a clear, human-generated description of the changes in
this PR.
DO NOT use AI-generated descriptions. We want to understand your thought
process and reasoning.
-->

## Acceptance Criteria
<!--
* Key requirements to the new feature or modification;
* Proof that the changes work and meet the requirements;
* Include instructions on how to verify the changes. Describe how to
test it locally;
* Proof that it's sufficiently tested.
-->

## Type of Change
<!-- Please check the relevant option -->
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Other (please specify):

## Screenshots/Videos (if applicable)
<!-- Add screenshots or videos to help explain your changes -->

## Pre-submission Checklist
<!-- Please check all boxes that apply before submitting your PR -->
- [ ] **I have tested my changes thoroughly before submitting this PR**
- [ ] **This PR contains minimal changes necessary to address the
issue/feature**
- [ ] My code follows the project's coding standards and style
guidelines
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have added necessary documentation (if applicable)
- [ ] All new and existing tests pass
- [ ] I have searched existing PRs to ensure this change hasn't been
submitted already
- [ ] I have linked any relevant issues in the description
- [ ] My commits have clear and descriptive messages

## 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 is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added configurable chunks-per-batch to control per-batch processing
size via CLI flag, API payload, and configuration; defaults are now
driven by config with an automatic fallback.

* **Style / Documentation**
* Updated contribution/style guidelines (formatting, line length,
string-quote rule, pre-commit note).

* **Tests**
* Updated CLI tests to verify propagation of the new chunks-per-batch
parameter.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-16 15:20:10 +01:00
Milenko Gavrić
70f84162e0
Merge branch 'dev' into feature/cog-3725-add-guide-example-codes-to-main-repo 2026-01-16 15:16:03 +01:00
Milenko Gavric
7ae44a4565 fix formatting in search_basics_core guide example 2026-01-16 15:03:03 +01:00
Igor Ilic
e13877cb65 refactor: Update cache clear calls 2026-01-16 14:51:30 +01:00
Igor Ilic
12560c391e refactor: update alembic upgrade calls to be done from cognee folder 2026-01-16 14:48:00 +01:00
Igor Ilic
9a9eacf8c8 refactor: update test with cache change 2026-01-16 14:11:06 +01:00
Igor Ilic
e24707c8da fix: Resolve issue with parameter caching for engine creation 2026-01-16 13:43:01 +01:00
Igor Ilic
5d412ed19b refactor: Add batch search support for leaving out payload 2026-01-16 13:21:42 +01:00
Milenko Gavric
6ab127c85d fixed indentation in search_basics_core 2026-01-16 13:11:46 +01:00
hajdul88
1c96e3b469 ruff ruff 2026-01-16 13:01:46 +01:00
hajdul88
2e9f646edd
Merge branch 'dev' into feature/cog-3502-tool-logging-with-redis 2026-01-16 13:00:11 +01:00
hajdul88
2ad8bcf6e9 feat: adds unit test for usage logging 2026-01-16 12:59:45 +01:00