fix: typos in text and error handling

This commit is contained in:
Boris Arzentar 2025-12-18 22:52:09 +01:00
parent 672a776df5
commit 3311db55bf
No known key found for this signature in database
GPG key ID: D5CC274C784807B7
12 changed files with 123 additions and 111 deletions

View file

@ -8,13 +8,13 @@
"name": "cognee-frontend",
"version": "1.0.0",
"dependencies": {
"@auth0/nextjs-auth0": "^4.13.1",
"@auth0/nextjs-auth0": "^4.14.0",
"classnames": "^2.5.1",
"culori": "^4.0.1",
"d3-force-3d": "^3.0.6",
"next": "^16.0.10",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"next": "^16.1.0",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"react-force-graph-2d": "^1.27.1",
"react-markdown": "^10.1.0",
"uuid": "^9.0.1"
@ -48,9 +48,9 @@
}
},
"node_modules/@auth0/nextjs-auth0": {
"version": "4.13.1",
"resolved": "https://registry.npmjs.org/@auth0/nextjs-auth0/-/nextjs-auth0-4.13.1.tgz",
"integrity": "sha512-RGZKddUa/kNdudhxYsJ0xSPtx10qr3qQ6i1aq2PY5x+JJ7f1Ifkb6QwuwREzxJlWh80YQ0S5Ef26JWHCPN2PkQ==",
"version": "4.14.0",
"resolved": "https://registry.npmjs.org/@auth0/nextjs-auth0/-/nextjs-auth0-4.14.0.tgz",
"integrity": "sha512-1SGieoD/nM52G+bNE8Xg1SpuCYSVC0c2q74B6mlMTXimtpVk6uZOmYH75L1jdAUKxesum470BtxOiwo4MwUS6g==",
"license": "MIT",
"dependencies": {
"@edge-runtime/cookies": "^5.0.1",
@ -61,9 +61,9 @@
"swr": "^2.2.5"
},
"peerDependencies": {
"next": "^14.2.25 || ^15.2.3 || ^16.0.0",
"react": "^18.0.0 || ^19.0.0 || ^19.0.0-0",
"react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-0"
"next": "^14.2.35 || ~15.0.7 || ~15.1.11 || ~15.2.8 || ~15.3.8 || ~15.4.10 || ~15.5.9 || ^16.0.10",
"react": "^18.0.0 || ~19.0.1 || ~19.1.2 || ^19.2.1",
"react-dom": "^18.0.0 || ~19.0.1 || ~19.1.2 || ^19.2.1"
}
},
"node_modules/@babel/code-frame": {
@ -1075,9 +1075,9 @@
}
},
"node_modules/@next/env": {
"version": "16.0.10",
"resolved": "https://registry.npmjs.org/@next/env/-/env-16.0.10.tgz",
"integrity": "sha512-8tuaQkyDVgeONQ1MeT9Mkk8pQmZapMKFh5B+OrFUlG3rVmYTXcXlBetBgTurKXGaIZvkoqRT9JL5K3phXcgang==",
"version": "16.1.0",
"resolved": "https://registry.npmjs.org/@next/env/-/env-16.1.0.tgz",
"integrity": "sha512-Dd23XQeFHmhf3KBW76leYVkejHlCdB7erakC2At2apL1N08Bm+dLYNP+nNHh0tzUXfPQcNcXiQyacw0PG4Fcpw==",
"license": "MIT"
},
"node_modules/@next/eslint-plugin-next": {
@ -1091,9 +1091,9 @@
}
},
"node_modules/@next/swc-darwin-arm64": {
"version": "16.0.10",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.0.10.tgz",
"integrity": "sha512-4XgdKtdVsaflErz+B5XeG0T5PeXKDdruDf3CRpnhN+8UebNa5N2H58+3GDgpn/9GBurrQ1uWW768FfscwYkJRg==",
"version": "16.1.0",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.1.0.tgz",
"integrity": "sha512-onHq8dl8KjDb8taANQdzs3XmIqQWV3fYdslkGENuvVInFQzZnuBYYOG2HGHqqtvgmEU7xWzhgndXXxnhk4Z3fQ==",
"cpu": [
"arm64"
],
@ -1107,9 +1107,9 @@
}
},
"node_modules/@next/swc-darwin-x64": {
"version": "16.0.10",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.0.10.tgz",
"integrity": "sha512-spbEObMvRKkQ3CkYVOME+ocPDFo5UqHb8EMTS78/0mQ+O1nqE8toHJVioZo4TvebATxgA8XMTHHrScPrn68OGw==",
"version": "16.1.0",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.1.0.tgz",
"integrity": "sha512-Am6VJTp8KhLuAH13tPrAoVIXzuComlZlMwGr++o2KDjWiKPe3VwpxYhgV6I4gKls2EnsIMggL4y7GdXyDdJcFA==",
"cpu": [
"x64"
],
@ -1123,9 +1123,9 @@
}
},
"node_modules/@next/swc-linux-arm64-gnu": {
"version": "16.0.10",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.0.10.tgz",
"integrity": "sha512-uQtWE3X0iGB8apTIskOMi2w/MKONrPOUCi5yLO+v3O8Mb5c7K4Q5KD1jvTpTF5gJKa3VH/ijKjKUq9O9UhwOYw==",
"version": "16.1.0",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.1.0.tgz",
"integrity": "sha512-fVicfaJT6QfghNyg8JErZ+EMNQ812IS0lmKfbmC01LF1nFBcKfcs4Q75Yy8IqnsCqH/hZwGhqzj3IGVfWV6vpA==",
"cpu": [
"arm64"
],
@ -1139,9 +1139,9 @@
}
},
"node_modules/@next/swc-linux-arm64-musl": {
"version": "16.0.10",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.0.10.tgz",
"integrity": "sha512-llA+hiDTrYvyWI21Z0L1GiXwjQaanPVQQwru5peOgtooeJ8qx3tlqRV2P7uH2pKQaUfHxI/WVarvI5oYgGxaTw==",
"version": "16.1.0",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.1.0.tgz",
"integrity": "sha512-TojQnDRoX7wJWXEEwdfuJtakMDW64Q7NrxQPviUnfYJvAx5/5wcGE+1vZzQ9F17m+SdpFeeXuOr6v3jbyusYMQ==",
"cpu": [
"arm64"
],
@ -1155,9 +1155,9 @@
}
},
"node_modules/@next/swc-linux-x64-gnu": {
"version": "16.0.10",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.0.10.tgz",
"integrity": "sha512-AK2q5H0+a9nsXbeZ3FZdMtbtu9jxW4R/NgzZ6+lrTm3d6Zb7jYrWcgjcpM1k8uuqlSy4xIyPR2YiuUr+wXsavA==",
"version": "16.1.0",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.1.0.tgz",
"integrity": "sha512-quhNFVySW4QwXiZkZ34SbfzNBm27vLrxZ2HwTfFFO1BBP0OY1+pI0nbyewKeq1FriqU+LZrob/cm26lwsiAi8Q==",
"cpu": [
"x64"
],
@ -1171,9 +1171,9 @@
}
},
"node_modules/@next/swc-linux-x64-musl": {
"version": "16.0.10",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.0.10.tgz",
"integrity": "sha512-1TDG9PDKivNw5550S111gsO4RGennLVl9cipPhtkXIFVwo31YZ73nEbLjNC8qG3SgTz/QZyYyaFYMeY4BKZR/g==",
"version": "16.1.0",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.1.0.tgz",
"integrity": "sha512-6JW0z2FZUK5iOVhUIWqE4RblAhUj1EwhZ/MwteGb//SpFTOHydnhbp3868gxalwea+mbOLWO6xgxj9wA9wNvNw==",
"cpu": [
"x64"
],
@ -1187,9 +1187,9 @@
}
},
"node_modules/@next/swc-win32-arm64-msvc": {
"version": "16.0.10",
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.0.10.tgz",
"integrity": "sha512-aEZIS4Hh32xdJQbHz121pyuVZniSNoqDVx1yIr2hy+ZwJGipeqnMZBJHyMxv2tiuAXGx6/xpTcQJ6btIiBjgmg==",
"version": "16.1.0",
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.1.0.tgz",
"integrity": "sha512-+DK/akkAvvXn5RdYN84IOmLkSy87SCmpofJPdB8vbLmf01BzntPBSYXnMvnEEv/Vcf3HYJwt24QZ/s6sWAwOMQ==",
"cpu": [
"arm64"
],
@ -1203,9 +1203,9 @@
}
},
"node_modules/@next/swc-win32-x64-msvc": {
"version": "16.0.10",
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.0.10.tgz",
"integrity": "sha512-E+njfCoFLb01RAFEnGZn6ERoOqhK1Gl3Lfz1Kjnj0Ulfu7oJbuMyvBKNj/bw8XZnenHDASlygTjZICQW+rYW1Q==",
"version": "16.1.0",
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.1.0.tgz",
"integrity": "sha512-Tr0j94MphimCCks+1rtYPzQFK+faJuhHWCegU9S9gDlgyOk8Y3kPmO64UcjyzZAlligeBtYZ/2bEyrKq0d2wqQ==",
"cpu": [
"x64"
],
@ -2554,7 +2554,6 @@
"version": "2.8.31",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.31.tgz",
"integrity": "sha512-a28v2eWrrRWPpJSzxc+mKwm0ZtVx/G8SepdQZDArnXYU/XS+IF6mp8aB/4E+hH1tyGCoDo3KlUCdlSxGDsRkAw==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"baseline-browser-mapping": "dist/cli.js"
@ -6291,14 +6290,15 @@
"license": "MIT"
},
"node_modules/next": {
"version": "16.0.10",
"resolved": "https://registry.npmjs.org/next/-/next-16.0.10.tgz",
"integrity": "sha512-RtWh5PUgI+vxlV3HdR+IfWA1UUHu0+Ram/JBO4vWB54cVPentCD0e+lxyAYEsDTqGGMg7qpjhKh6dc6aW7W/sA==",
"version": "16.1.0",
"resolved": "https://registry.npmjs.org/next/-/next-16.1.0.tgz",
"integrity": "sha512-Y+KbmDbefYtHDDQKLNrmzE/YYzG2msqo2VXhzh5yrJ54tx/6TmGdkR5+kP9ma7i7LwZpZMfoY3m/AoPPPKxtVw==",
"license": "MIT",
"peer": true,
"dependencies": {
"@next/env": "16.0.10",
"@next/env": "16.1.0",
"@swc/helpers": "0.5.15",
"baseline-browser-mapping": "^2.8.3",
"caniuse-lite": "^1.0.30001579",
"postcss": "8.4.31",
"styled-jsx": "5.1.6"
@ -6310,14 +6310,14 @@
"node": ">=20.9.0"
},
"optionalDependencies": {
"@next/swc-darwin-arm64": "16.0.10",
"@next/swc-darwin-x64": "16.0.10",
"@next/swc-linux-arm64-gnu": "16.0.10",
"@next/swc-linux-arm64-musl": "16.0.10",
"@next/swc-linux-x64-gnu": "16.0.10",
"@next/swc-linux-x64-musl": "16.0.10",
"@next/swc-win32-arm64-msvc": "16.0.10",
"@next/swc-win32-x64-msvc": "16.0.10",
"@next/swc-darwin-arm64": "16.1.0",
"@next/swc-darwin-x64": "16.1.0",
"@next/swc-linux-arm64-gnu": "16.1.0",
"@next/swc-linux-arm64-musl": "16.1.0",
"@next/swc-linux-x64-gnu": "16.1.0",
"@next/swc-linux-x64-musl": "16.1.0",
"@next/swc-win32-arm64-msvc": "16.1.0",
"@next/swc-win32-x64-msvc": "16.1.0",
"sharp": "^0.34.4"
},
"peerDependencies": {
@ -6786,9 +6786,9 @@
"license": "MIT"
},
"node_modules/react": {
"version": "19.2.0",
"resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz",
"integrity": "sha512-tmbWg6W31tQLeB5cdIBOicJDJRR2KzXsV7uSK9iNfLWQ5bIZfxuPEHp7M8wiHyHnn0DD1i7w3Zmin0FtkrwoCQ==",
"version": "19.2.3",
"resolved": "https://registry.npmjs.org/react/-/react-19.2.3.tgz",
"integrity": "sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==",
"license": "MIT",
"peer": true,
"engines": {
@ -6796,16 +6796,16 @@
}
},
"node_modules/react-dom": {
"version": "19.2.0",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.0.tgz",
"integrity": "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ==",
"version": "19.2.3",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.3.tgz",
"integrity": "sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==",
"license": "MIT",
"peer": true,
"dependencies": {
"scheduler": "^0.27.0"
},
"peerDependencies": {
"react": "^19.2.0"
"react": "^19.2.3"
}
},
"node_modules/react-force-graph-2d": {

View file

@ -9,13 +9,13 @@
"lint": "next lint"
},
"dependencies": {
"@auth0/nextjs-auth0": "^4.13.1",
"@auth0/nextjs-auth0": "^4.14.0",
"classnames": "^2.5.1",
"culori": "^4.0.1",
"d3-force-3d": "^3.0.6",
"next": "^16.0.10",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"next": "^16.1.0",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"react-force-graph-2d": "^1.27.1",
"react-markdown": "^10.1.0",
"uuid": "^9.0.1"
@ -34,4 +34,4 @@
"tailwindcss": "^4.1.7",
"typescript": "^5"
}
}
}

View file

@ -4,7 +4,7 @@ const localApiUrl = process.env.NEXT_PUBLIC_LOCAL_API_URL || "http://localhost:8
export default async function localFetch(url: URL | RequestInfo, options: RequestInit = {}): Promise<Response> {
return global.fetch(
localApiUrl + "/api" + url,
localApiUrl + "/api" + (typeof url === "string" ? url : url.toString()),
{
...options,
credentials: "include",

View file

@ -7,5 +7,7 @@ export default function createNotebook(notebookName: string, instance: CogneeIns
headers: {
"Content-Type": "application/json",
},
}).then((response: Response) => response.json());
}).then((response: Response) =>
response.ok ? response.json() : Promise.reject(response)
);
}

View file

@ -6,5 +6,7 @@ export default function getNotebooks(instance: CogneeInstance) {
headers: {
"Content-Type": "application/json",
},
}).then((response) => response.json());
}).then((response: Response) =>
response.ok ? response.json() : Promise.reject(response)
);
}

View file

@ -7,5 +7,7 @@ export default function saveNotebook(notebookId: string, notebookData: object, i
headers: {
"Content-Type": "application/json",
},
}).then((response) => response.json());
}).then((response: Response) =>
response.ok ? response.json() : Promise.reject(response)
);
}

View file

@ -1,26 +1,28 @@
# Add data one by one, or pass a list to add multiple items at once
await cognee.add(
"Harry Potter is a student at Hogwarts and belongs to Gryffindor house. \
He is known for defeating Voldemort and his Patronus is a stag.",
dataset_name="cognee-basics",
)
await cognee.add(
"Hermione Granger is a student at Hogwarts and also belongs to Gryffindor house. \
She is known for her intelligence and deep knowledge of spells. Her Patronus is an otter.",
dataset_name="cognee-basics",
)
await cognee.add(
"Severus Snape is a professor at Hogwarts who teaches Potions. \
He belongs to Slytherin house and was secretly loyal to Albus Dumbledore.",
dataset_name="cognee-basics",
)
await cognee.add(
[
"""
Harry Potter is a student at Hogwarts and belongs to Gryffindor house.
He is known for defeating Voldemort and his Patronus is a stag.
""",
"""
Hermione Granger is a student at Hogwarts and also belongs to Gryffindor house.
She is known for her intelligence and deep knowledge of spells. Her Patronus is an otter.
""",
"""
Severus Snape is a professor at Hogwarts who teaches Potions.
He belongs to Slytherin house and was secretly loyal to Albus Dumbledore.
""",
"""
Hogwarts is a magical school located in Scotland. During Harry Potter's time at school, the headmaster was Albus Dumbledore.
""",
"""
A Horcrux is a dark magic object used to store a fragment of a wizard's soul. Voldemort created multiple Horcruxes to achieve immortality.
""",
"""
The Elder Wand is a powerful wand believed to be unbeatable. Its final known owner was Harry Potter.
""",
"Hogwarts is a magical school located in Scotland. During Harry Potter's time at school, the headmaster was Albus Dumbledore.",
"A Horcrux is a dark magic object used to store a fragment of a wizard's soul. Voldemort created multiple Horcruxes to achieve immortality.",
"The Elder Wand is a powerful wand believed to be unbeatable. Its final known owner was Harry Potter.",
],
dataset_name="cognee-basics",
)

View file

@ -1 +1,3 @@
# Run cognify to process the data and create a knowledge graph
await cognee.cognify(datasets=["cognee-basics"])

View file

@ -1,22 +1,9 @@
result_1 = await cognee.search(
# And after the cognification, search the knowledge graph
result = await cognee.search(
"Which characters belong to Gryffindor?",
datasets=["cognee-basics"],
)
print(result_1)
result_2 = await cognee.search(
"Who taught Potions at Hogwarts at time Albus Dumbledore was the headmaster?",
datasets=["cognee-basics"],
)
print(result_2)
result_3 = await cognee.search(
"How to defeat Voldemort?",
datasets=["cognee-basics"],
)
print(result_3)
# Print the result so you can see it in the notebook output
print(result)

View file

@ -0,0 +1,17 @@
# Run multiple searches and print the results
result_1 = await cognee.search(
"Who taught Potions at Hogwarts at time Albus Dumbledore was the headmaster?",
datasets=["cognee-basics"],
)
# Print the result so you can see it in the notebook output
print(result_1)
result_2 = await cognee.search(
"How to defeat Voldemort?",
datasets=["cognee-basics"],
)
print(result_2)

View file

@ -2,8 +2,8 @@
In this comprehensive tutorial, you'll discover how to transform scattered development data into an intelligent knowledge system that enhances your coding workflow. By the end, you'll have:
- Connected disparate data sources (Guido's CPython contributions, mypy development, PEP discussions, your Python projects) into a unified AI memory graph
- Built an memory layer that understands Python design philosophy, best practice coding patterns, and your preferences and experience
- Learn how to use intelligent search capabilities that combine the diverse context
- Built a memory layer that understands Python design philosophy, best practice coding patterns, and your preferences and experience
- Learned how to use intelligent search capabilities that combine the diverse context
- Integrated everything with your coding environment through MCP (Model Context Protocol)
This tutorial demonstrates the power of knowledge graphs and retrieval-augmented generation (RAG) for software development, showing you how to build systems that learn from Python's creator and improve your own Python development.

View file

@ -563,8 +563,7 @@ class TestCreateTutorialNotebooks:
class TestNotebookFromIpynbString:
"""Test cases for Notebook.from_ipynb_string (legacy method, still used)."""
@pytest.mark.asyncio
async def test_notebook_from_ipynb_string_success(self):
def test_notebook_from_ipynb_string_success(self):
"""Test successful creation of notebook from JSON string."""
import json
@ -603,8 +602,7 @@ class TestNotebookFromIpynbString:
assert notebook.cells[0].type == "markdown"
assert notebook.cells[1].type == "code"
@pytest.mark.asyncio
async def test_notebook_from_ipynb_string_invalid_json(self):
def test_notebook_from_ipynb_string_invalid_json(self):
"""Test error handling for invalid JSON."""
user_id = uuid4()
invalid_json = "{ invalid json content"