Commit graph

2700 commits

Author SHA1 Message Date
EricXiao
fc7a91d991
feature: implement FEELING_LUCKY search type (#1178)
<!-- .github/pull_request_template.md -->

## Description
<!-- Provide a clear description of the changes in this PR -->
This PR implements the 'FEELING_LUCKY' search type, which intelligently
routes user queries to the most appropriate search retriever, addressing
[#1162](https://github.com/topoteretes/cognee/issues/1162).

- implement new search type FEELING_LUCKY
- Add the select_search_type function to analyze queries and choose the
proper search type
- Integrate with an LLM for intelligent search type determination
- Add logging for the search type selection process
- Support fallback to RAG_COMPLETION when the LLM selection fails
- Add tests for the new search type

## How it works
When a user selects the 'FEELING_LUCKY' search type, the system first
sends their natural language query to an LLM-based classifier. This
classifier analyzes the query's intent (e.g., is it asking for a
relationship, a summary, or a factual answer?) and selects the optimal
SearchType, such as 'INSIGHTS' or 'GRAPH_COMPLETION'. The main search
function then proceeds using this dynamically selected type. If the
classification process fails, it gracefully falls back to the default
'RAG_COMPLETION' type.

## Testing
Tests can be run with:
```bash
python -m pytest cognee/tests/unit/modules/search/search_methods_test.py -k "feeling_lucky" -v
```

## 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: EricXiao <taoiaox@gmail.com>
2025-08-02 16:30:08 +02:00
Igor Ilic
9faa47fc5a
feat: add default tokenizer in case hugging face is not available (#1177)
<!-- .github/pull_request_template.md -->

## Description
Add default tokenizer for custom models not available on HuggingFace

## 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.
2025-08-01 16:37:53 +02:00
Igor Ilic
5b6e946c43
fix: Add async lock for dynamic vector table creation (#1175)
<!-- .github/pull_request_template.md -->

## Description
Add async lock for dynamic table creation

## 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.
2025-08-01 15:12:04 +02:00
Boris Arzentar
cd930ed646
Merge remote-tracking branch 'origin/main' into dev 2025-07-30 11:30:38 +02:00
Boris
2182f619df
fix: canvas resize issues in graph visualization (#1167)
## Description
This PR adds **responsive resizing** to the graph container. The
`ForceGraph` component now dynamically adjusts its width and height when
the browser window is resized, improving the user experience by removing
the need to manually click the "Fit Into View" button. solver issue
#1164

## 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.

---

##  Changes Made (Minimal, Additive Only)

### 1. **Added necessary imports**
```typescript
import { MutableRefObject, useEffect, useImperativeHandle, useRef, useState, useCallback } from "react";
// Added useCallback to existing imports
```

### 2. **Added responsive sizing state and refs**
```typescript
// State for tracking container dimensions
const [dimensions, setDimensions] = useState({ width: 0, height: 0 });
const containerRef = useRef<HTMLDivElement>(null);
```

### 3. **Added resize handling logic**
```typescript
// Handle window resize
const handleResize = useCallback(() => {
  if (containerRef.current) {
    const { clientWidth, clientHeight } = containerRef.current;
    setDimensions({ width: clientWidth, height: clientHeight });

    // Trigger graph refresh after resize
    if (graphRef.current) {
      // Small delay to ensure DOM has updated
      setTimeout(() => {
        graphRef.current?.refresh();
      }, 100);
    }
  }
}, []);

// Set up resize observer 
useEffect(() => {
  // Initial size calculation
  handleResize();

  // ResizeObserver for more precise container size tracking
  const resizeObserver = new ResizeObserver(() => {
    handleResize();
  });

  if (containerRef.current) {
    resizeObserver.observe(containerRef.current);
  }

  return () => {
    resizeObserver.disconnect();
  };
}, [handleResize]);
```

### 4. **Added container ref to wrapping div**
```tsx
<div ref={containerRef} className="w-full h-full" id="graph-container">
  {/* Graph component rendered here */}
</div>
```

### 5. **Passed dynamic width/height to ForceGraph**
```tsx
<ForceGraph
  ref={graphRef}
  width={dimensions.width}
  height={dimensions.height}
  dagMode={graphShape as unknown as undefined}
  // ... rest of props unchanged
/>
```

---

you can check this video out:


https://github.com/user-attachments/assets/e8e42c99-23e9-4acd-a51b-c59e8bee7094
2025-07-30 11:16:38 +02:00
VinaySatrasala
a620f991c3 Fix canvas resize issues in graph visualization
Signed-off-by: VinaySatrasala <satrasalavinaykumar.01@gmail.com>
2025-07-30 02:16:09 +05:30
Igor Ilic
14ba3e8829
feat: Enable async execution of data items for incremental loading (#1092)
<!-- .github/pull_request_template.md -->

## Description
Attempt at making incremental loading 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.
2025-07-29 10:39:31 -04:00
hajdul88
f78af0cec3
feature: solve edge embedding duplicates in edge collection + retriever optimization (#1151)
<!-- .github/pull_request_template.md -->

## Description
feature: solve edge embedding duplicates in edge collection + retriever
optimization

## 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 <8619304+Vasilije1990@users.noreply.github.com>
2025-07-29 12:35:38 +02:00
Boris
4ea4b100ab
fix: datasets status (#1166)
<!-- .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.
2025-07-28 23:32:40 +02:00
Boris Arzentar
961fa5ec45
chore: update uv.lock file 2025-07-28 23:23:35 +02:00
Boris Arzentar
9793cd56ad
version: 0.2.2.dev0 2025-07-28 23:20:21 +02:00
Boris Arzentar
6773121904
fix: datasets status without datasets parameter 2025-07-28 23:19:36 +02:00
Boris
9907e6fe5b
version: 0.2.1 (#1155)
<!-- .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.
2025-07-25 17:52:38 +02:00
Boris Arzentar
5aa6dfc62b
Merge remote-tracking branch 'origin/main' into dev 2025-07-25 17:51:32 +02:00
Boris
4ec3c4f14d
version: v0.2.1 (#1154)
<!-- .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.
2025-07-25 17:49:06 +02:00
Igor Ilic
bc67eb9651
Regen lock files (#1153)
<!-- .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.
2025-07-25 11:45:28 -04:00
Igor Ilic
a923778040
chore: Update lock files (#1150)
<!-- .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.
2025-07-25 10:17:35 -04:00
Igor Ilic
93e9a9aa1c
Kuzu migration notes (#1149)
<!-- .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.
2025-07-25 14:38:10 +02:00
hajdul88
9157d3c2dd
feature: cover current context structure with unit test and add time logging to vector collection retrievals (#1144)
<!-- .github/pull_request_template.md -->

## Description
Cover current context structure with unit test so it is not changed
accidentally in the future

## 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.
2025-07-25 13:04:43 +02:00
Igor Ilic
7f972d3ab5
feat: Add fix for kuzu lock after migration (#1147)
<!-- .github/pull_request_template.md -->

## Description
Add potential fix for Kuzu database lock after migration

## 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.
2025-07-25 05:25:13 -04:00
Vasilije
ce50863e22
fix: Mcp improvements (#1114)
<!-- .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 <igorilic03@gmail.com>
Co-authored-by: Igor Ilic <30923996+dexters1@users.noreply.github.com>
2025-07-24 21:52:16 +02:00
Igor Ilic
81a3cf84b1
feat: Add kuzu graph db migration (#1146)
<!-- .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.
2025-07-24 11:58:45 -04:00
Igor Ilic
fc8ae2fe21
feat: Add database migration at start of MCP server (#1145)
<!-- .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.
2025-07-24 16:32:34 +02:00
Igor Ilic
dbdf04c089
Data model migration (#1143)
<!-- .github/pull_request_template.md -->

## Description
Data model migration for new release

## 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.
2025-07-24 15:03:16 +02:00
Vasilije
1885ab9e88
chore: Cog 2354 add logging (#1115)
<!-- .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: hajdul88 <52442977+hajdul88@users.noreply.github.com>
2025-07-24 13:27:27 +02:00
Boris
d6727a1b4a
fix: UnstructuredDocument read method (#1141)
<!-- .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.
2025-07-24 13:23:27 +02:00
Igor Ilic
8e943beb15
Kuzu migration (#1135)
<!-- .github/pull_request_template.md -->

## Description
Added script that can migrate Kuzu versions automatically

## 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.
2025-07-24 13:13:38 +02:00
Igor Ilic
ed09750598 feat : add migration for kuzu 0.8.2 as well 2025-07-24 13:07:07 +02:00
Igor Ilic
2fff637cda feat: Add better info when migrating kuzu database 2025-07-24 12:38:31 +02:00
Igor Ilic
021437095c refactor: Change old db backup name 2025-07-24 12:18:23 +02:00
Igor Ilic
08ed43b1e9 feat: Add usage of temp directory for kuzu migration, epand on old graph db naming 2025-07-24 12:09:45 +02:00
Igor Ilic
8cd3bed1ad Merge branch 'kuzu-migration' of github.com:topoteretes/cognee into kuzu-migration 2025-07-23 20:59:47 +02:00
Igor Ilic
6abf0713b9 refactor: move kuzu-migrate to infrastructure 2025-07-23 20:59:25 +02:00
Igor Ilic
87d6fef643
Merge branch 'dev' into kuzu-migration 2025-07-23 19:56:56 +02:00
Igor Ilic
8a7c6bfef0 feat: Add automatic Kuzu migration as exception handling attempt 2025-07-23 19:55:55 +02:00
Vasilije
daa4e9acc4
fix: Remove weaviate (#1139)
<!-- .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.
2025-07-23 19:34:35 +02:00
Igor Ilic
ce312fb397 feat: Add automatic mapping of Kuzu version based on file 2025-07-23 19:14:03 +02:00
Hande
f4a11a236d
chore: Update README.md (#1137)
<!-- .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.
2025-07-23 18:17:57 +02:00
Hande
4740f87947
chore: Update README.md (#1138)
<!-- .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.
2025-07-23 18:12:33 +02:00
Igor Ilic
7e1492b13c
Merge branch 'dev' into kuzu-migration 2025-07-23 17:18:34 +02:00
Igor Ilic
819e244616
Merge main changes (#1136)
<!-- .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.
2025-07-23 17:18:24 +02:00
Igor Ilic
7eff8b825f Merge branch 'main' into merge-main-changes 2025-07-23 17:16:24 +02:00
Igor Ilic
1453b3dd1a refactor: Move kuzu migration to tools 2025-07-23 17:12:22 +02:00
Igor Ilic
98f2cd3305 refactor: add comments 2025-07-23 16:59:08 +02:00
Igor Ilic
d780b54965 feat: Added delete old flag for kuzu 2025-07-23 16:48:36 +02:00
Igor Ilic
5c9835c610 feat: add overwrite old db option 2025-07-23 15:58:05 +02:00
hajdul88
1135a5e44d
chore: Sets sqlalchemy pool_size and max overflow to a hard limit instead of default values (#1133)
<!-- .github/pull_request_template.md -->

## Description
Sets sqlalchemy pool_size and max overflow to a hard limit instead of
default values

## 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.
2025-07-23 15:36:29 +02:00
Boris
f77183d001
fix: UI (#1134)
<!-- .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.
2025-07-23 15:35:21 +02:00
Igor Ilic
c98c3a3d53 feat: Add kuzu migration script 2025-07-23 14:43:44 +02:00
hajdul88
2b1c17404c
Feature: optimizes query embedding and edge collection search (#1126)
<!-- .github/pull_request_template.md -->

## Description
Optimizes query embedding by reducing the number of query embedding
calls and avoids multiple edge collection searches when they are
available.

## 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.
2025-07-23 11:47:22 +02:00