939 lines
70 KiB
Text
Vendored
939 lines
70 KiB
Text
Vendored
{
|
||
"cells": [
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "6f22c8fe6d92cfcc",
|
||
"metadata": {},
|
||
"source": [
|
||
"Using Cognee with Python Development Data\n",
|
||
"\n",
|
||
"Unite authoritative Python practice (Guido van Rossum's own contributions!), normative guidance (Zen/PEP 8), and your lived context (rules + conversations) into one AI memory that produces answers that are relevant, explainable, and consistent."
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "fe69acbf9ab1a22b",
|
||
"metadata": {},
|
||
"source": [
|
||
"What You'll Learn\n",
|
||
"\n",
|
||
"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:\n",
|
||
"\n",
|
||
"- Connected disparate data sources (Guido's CPython contributions, mypy development, PEP discussions, your Python projects) into a unified AI memory graph\n",
|
||
"- Built an memory layer that understands Python design philosophy, best practice coding patterns, and your preferences and experience\n",
|
||
"- Learn how to use intelligent search capabilities that combine the diverse context\n",
|
||
"- Integrated everything with your coding environment through MCP (Model Context Protocol)\n",
|
||
"\n",
|
||
"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."
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "b03b59c064213dd4",
|
||
"metadata": {},
|
||
"source": [
|
||
"Cognee and its core operations\n",
|
||
"\n",
|
||
"Before we dive in, let's understand the core Cognee operations we'll be working with:\n",
|
||
"\n",
|
||
"- cognee.add() - Ingests raw data (files, text, APIs) into the system\n",
|
||
"- cognee.cognify() - Processes and structures data into a knowledge graph using AI\n",
|
||
"- cognee.search() - Queries the knowledge graph with natural language or Cypher\n",
|
||
"- cognee.memify() - Cognee's \"secret sauce\" that infers implicit connections and rules from your data"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "6a7669fbb6a3e6c7",
|
||
"metadata": {},
|
||
"source": [
|
||
"Data used in this tutorial\n",
|
||
"\n",
|
||
"Cognee can ingest many types of sources. In this tutorial, we use a small, concrete set of files that cover different perspectives:\n",
|
||
"\n",
|
||
"- guido_contributions.json — Authoritative exemplars. Real PRs and commits from Guido van Rossum (mypy, CPython). These show how Python’s creator solved problems and provide concrete anchors for patterns.\n",
|
||
"- pep_style_guide.md — Norms. Encodes community style and typing conventions (PEP 8 and related). Ensures that search results and inferred rules align with widely accepted standards.\n",
|
||
"- zen_principles.md — Philosophy The Zen of Python. Grounds design trade‑offs (simplicity, explicitness, readability) beyond syntax or mechanics.\n",
|
||
"- my_developer_rules.md — Local constraints Your house rules, conventions, and project‑specific requirements (scope, privacy, Spec.md). Keeps recommendations relevant to your actual workflow.\n",
|
||
"- copilot_conversations.json — Personal history. Transcripts of real assistant conversations, including your questions, code snippets, and discussion topics. Captures “how you code” and connects it to “how Guido codes.”"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "93c9783037715026",
|
||
"metadata": {},
|
||
"source": [
|
||
"First data ingestion: Exploring Guido's Python Contributions\n",
|
||
"\n",
|
||
"We'll begin with a document that contains detailed PRs and commits from Guido van Rossum's work on mypy and CPython, showing real-world examples of Python's creator solving type system and language design challenges.\n",
|
||
"\n",
|
||
"We'll use Cognee's `add()` and `cognify()` functions to ingest this data and build a knowledge graph that connects Guido's development patterns with Python best practices."
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "b8743ed520b4de37",
|
||
"metadata": {
|
||
"ExecuteTime": {
|
||
"end_time": "2025-09-07T14:39:53.511862Z",
|
||
"start_time": "2025-09-07T14:35:06.228778Z"
|
||
}
|
||
},
|
||
"outputs": [
|
||
{
|
||
"name": "stdout",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"User 666b4a6d-34ef-4221-aba2-68a64a7b1eaa has registered.\n"
|
||
]
|
||
},
|
||
{
|
||
"name": "stderr",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"\n",
|
||
"\u001b[1mEmbeddingRateLimiter initialized: enabled=False, requests_limit=60, interval_seconds=60\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:35:09.623496\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run started: `576f15b1-6366-5079-b586-01bf92a45a1d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:35:09.624579\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `resolve_data_directories`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:35:09.625619\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `ingest_data`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:35:09.646868\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRegistered loader: pypdf_loader\u001b[0m [\u001b[0m\u001b[1m\u001b[34mcognee.infrastructure.loaders.LoaderEngine\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:35:09.647515\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRegistered loader: text_loader\u001b[0m [\u001b[0m\u001b[1m\u001b[34mcognee.infrastructure.loaders.LoaderEngine\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:35:09.647982\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRegistered loader: image_loader\u001b[0m [\u001b[0m\u001b[1m\u001b[34mcognee.infrastructure.loaders.LoaderEngine\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:35:09.648557\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRegistered loader: audio_loader\u001b[0m [\u001b[0m\u001b[1m\u001b[34mcognee.infrastructure.loaders.LoaderEngine\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:35:09.649816\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRegistered loader: unstructured_loader\u001b[0m [\u001b[0m\u001b[1m\u001b[34mcognee.infrastructure.loaders.LoaderEngine\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:35:09.660104\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `ingest_data`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:35:09.660527\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `resolve_data_directories`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:35:09.661133\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run completed: `576f15b1-6366-5079-b586-01bf92a45a1d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:35:09.685106\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run started: `be77ae78-61ae-5066-8df8-04ba903dbe6d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:35:09.685571\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `classify_documents`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:35:09.685911\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `check_permissions_on_dataset`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:35:09.693221\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mAsync Generator task started: `extract_chunks_from_documents`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:35:09.721431\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `extract_events_and_timestamps`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:35:24.808308\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `extract_knowledge_graph_from_events`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:10.235598\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `add_data_points`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:18.963698\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 202 nodes and 335 edges in 0.04 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:20.167605\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `add_data_points`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:20.168080\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `extract_knowledge_graph_from_events`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:20.168371\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `extract_events_and_timestamps`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:20.185430\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `extract_events_and_timestamps`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:22.765687\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `extract_knowledge_graph_from_events`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:22.767063\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `add_data_points`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:24.039208\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 203 nodes and 337 edges in 0.02 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:25.499226\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `add_data_points`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:25.500201\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `extract_knowledge_graph_from_events`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:25.500492\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `extract_events_and_timestamps`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:25.514153\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `extract_events_and_timestamps`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:27.574764\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `extract_knowledge_graph_from_events`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:27.576271\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `add_data_points`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:28.552555\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 204 nodes and 339 edges in 0.04 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:29.917238\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `add_data_points`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:29.917690\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `extract_knowledge_graph_from_events`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:29.918038\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `extract_events_and_timestamps`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:29.931887\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `extract_events_and_timestamps`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:36:50.418281\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `extract_knowledge_graph_from_events`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:37:31.380478\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `add_data_points`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:37:36.217182\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 332 nodes and 535 edges in 0.04 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:37:37.608817\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `add_data_points`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:37:37.610610\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `extract_knowledge_graph_from_events`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:37:37.610882\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `extract_events_and_timestamps`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:37:37.623203\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `extract_events_and_timestamps`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:37:59.333307\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `extract_knowledge_graph_from_events`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:38:30.317584\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `add_data_points`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:38:36.143492\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 415 nodes and 697 edges in 0.05 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:38:37.703572\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `add_data_points`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:38:37.704043\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `extract_knowledge_graph_from_events`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:38:37.704434\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `extract_events_and_timestamps`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:38:37.705143\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `extract_events_and_timestamps`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:07.687322\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `extract_knowledge_graph_from_events`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:41.229696\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `add_data_points`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:45.991597\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 513 nodes and 872 edges in 0.06 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:47.641833\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `add_data_points`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:47.642446\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `extract_knowledge_graph_from_events`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:47.642764\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `extract_events_and_timestamps`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:47.646206\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mAsync Generator task completed: `extract_chunks_from_documents`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:47.646490\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `check_permissions_on_dataset`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:47.646738\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `classify_documents`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:47.647065\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run completed: `be77ae78-61ae-5066-8df8-04ba903dbe6d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:47.722293\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 513 nodes and 872 edges in 0.05 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:47.727445\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mGraph projection completed: 513 nodes, 872 edges in 0.05s\u001b[0m [\u001b[0m\u001b[1m\u001b[34mCogneeGraph\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:48.085263\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mVector collection retrieval completed: Retrieved distances from 6 collections in 0.04s\u001b[0m [\u001b[0m\u001b[1m\u001b[34mcognee.shared.logging_utils\u001b[0m]\u001b[0m\n"
|
||
]
|
||
}
|
||
],
|
||
"source": [
|
||
"await cognee.add(\n",
|
||
" \"file://data/guido_contributions.json\",\n",
|
||
" node_set=[\"guido_data\"]\n",
|
||
")\n",
|
||
"await cognee.cognify(temporal_cognify=True)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "e5dde604",
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"# Now that we've added data, let's search\n",
|
||
"results = await cognee.search(\"Show me commits\")\n",
|
||
"print(results)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "10d582d02ead905e",
|
||
"metadata": {},
|
||
"source": [
|
||
"What's just happened?\n",
|
||
"The search() function uses natural language to query a knowledge graph containing Guido's development history.\n",
|
||
"Unlike traditional databases, Cognee understands the relationships between commits, language features, design decisions, and evolution over time.\n",
|
||
"\n",
|
||
"Cognee also allows you to visualize the graphs created:"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "3418aa17bf35e3bb",
|
||
"metadata": {},
|
||
"source": [
|
||
"Why visualization matters: Knowledge graphs reveal hidden patterns in data. In this case, patterins in Guido's contributions to Python's development. The interactive visualization shows how different projects (CPython, mypy, PEPs), features, and time periods connect - insights that show Python's thoughtful evolution.\n",
|
||
"\n",
|
||
"Take a moment to explore the graph. Notice how:\n",
|
||
"\n",
|
||
"- CPython core development clusters around 2020\n",
|
||
"- Mypy contributions focus on fixtures and run classes\n",
|
||
"- PEP discussions mention Thomas Grainiger and Adam Turner\n",
|
||
"- Time-based connections show how ideas evolved into features"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "5e8d9094a09ae05d",
|
||
"metadata": {},
|
||
"source": [
|
||
"Ingesting more data\n",
|
||
"\n",
|
||
"Now we'll add the remaining data and see how they connections emerge between Guido's contributions, Python best practices, and user conversations."
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "5315318324968f0f",
|
||
"metadata": {
|
||
"ExecuteTime": {
|
||
"end_time": "2025-09-07T14:40:48.589875Z",
|
||
"start_time": "2025-09-07T14:39:53.785054Z"
|
||
}
|
||
},
|
||
"outputs": [
|
||
{
|
||
"name": "stderr",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.829241\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run started: `576f15b1-6366-5079-b586-01bf92a45a1d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.829640\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `resolve_data_directories`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.829940\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `ingest_data`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.843454\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `ingest_data`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.843823\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `resolve_data_directories`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.844182\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run completed: `576f15b1-6366-5079-b586-01bf92a45a1d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.871709\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run started: `576f15b1-6366-5079-b586-01bf92a45a1d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.872071\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `resolve_data_directories`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.872367\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `ingest_data`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.882151\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `ingest_data`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.882510\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `resolve_data_directories`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.882809\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run completed: `576f15b1-6366-5079-b586-01bf92a45a1d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.912204\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run started: `576f15b1-6366-5079-b586-01bf92a45a1d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.912690\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `resolve_data_directories`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.912959\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `ingest_data`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.923068\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `ingest_data`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.923361\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `resolve_data_directories`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.923585\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run completed: `576f15b1-6366-5079-b586-01bf92a45a1d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.951487\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run started: `576f15b1-6366-5079-b586-01bf92a45a1d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.951861\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `resolve_data_directories`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.952214\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `ingest_data`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.967297\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `ingest_data`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.967650\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `resolve_data_directories`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.967914\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run completed: `576f15b1-6366-5079-b586-01bf92a45a1d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.992515\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run started: `be77ae78-61ae-5066-8df8-04ba903dbe6d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.992977\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `classify_documents`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.993474\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `check_permissions_on_dataset`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.994416\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run started: `be77ae78-61ae-5066-8df8-04ba903dbe6d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.994712\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `classify_documents`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.995079\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `check_permissions_on_dataset`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.995706\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run started: `be77ae78-61ae-5066-8df8-04ba903dbe6d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.997019\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `classify_documents`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.997301\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `check_permissions_on_dataset`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.998158\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run started: `be77ae78-61ae-5066-8df8-04ba903dbe6d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.998553\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `classify_documents`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:53.998864\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `check_permissions_on_dataset`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:54.013055\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mAsync Generator task started: `extract_chunks_from_documents`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:54.017852\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `extract_events_and_timestamps`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:54.022009\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mAsync Generator task started: `extract_chunks_from_documents`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:54.030806\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `extract_events_and_timestamps`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:54.036343\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mAsync Generator task started: `extract_chunks_from_documents`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:54.039116\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `extract_events_and_timestamps`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:54.039508\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mAsync Generator task started: `extract_chunks_from_documents`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:54.041717\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `extract_events_and_timestamps`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:55.849185\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `extract_knowledge_graph_from_events`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:55.849799\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `add_data_points`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:56.665144\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 516 nodes and 875 edges in 0.07 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:58.458740\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `add_data_points`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:58.459243\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `extract_knowledge_graph_from_events`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:58.459572\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `extract_events_and_timestamps`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:58.463783\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mAsync Generator task completed: `extract_chunks_from_documents`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:58.464114\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `check_permissions_on_dataset`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:58.464420\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `classify_documents`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:39:58.464859\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run completed: `be77ae78-61ae-5066-8df8-04ba903dbe6d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:04.250313\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `extract_knowledge_graph_from_events`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:05.899016\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `extract_knowledge_graph_from_events`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:08.508985\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `extract_knowledge_graph_from_events`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:10.092969\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `add_data_points`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:12.744365\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 554 nodes and 922 edges in 0.06 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:14.420588\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `add_data_points`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:14.421023\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `extract_knowledge_graph_from_events`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:14.421274\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `extract_events_and_timestamps`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:14.424860\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mAsync Generator task completed: `extract_chunks_from_documents`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:14.425243\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `check_permissions_on_dataset`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:14.425506\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `classify_documents`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:14.425824\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run completed: `be77ae78-61ae-5066-8df8-04ba903dbe6d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:32.133853\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `add_data_points`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:37.935452\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 647 nodes and 1090 edges in 0.07 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:39.961419\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `add_data_points`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:39.961913\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `extract_knowledge_graph_from_events`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:39.962156\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `extract_events_and_timestamps`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:39.965642\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mAsync Generator task completed: `extract_chunks_from_documents`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:39.965922\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `check_permissions_on_dataset`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:39.966156\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `classify_documents`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:39.966623\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run completed: `be77ae78-61ae-5066-8df8-04ba903dbe6d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:41.064653\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `add_data_points`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:46.322105\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 784 nodes and 1335 edges in 0.08 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:48.573983\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `add_data_points`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:48.574420\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `extract_knowledge_graph_from_events`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:48.574696\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `extract_events_and_timestamps`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:48.578174\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mAsync Generator task completed: `extract_chunks_from_documents`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:48.578472\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `check_permissions_on_dataset`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:48.578720\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `classify_documents`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:48.579015\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run completed: `be77ae78-61ae-5066-8df8-04ba903dbe6d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n"
|
||
]
|
||
},
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"{UUID('06a9442f-fee9-51a8-a5b9-ea18d1b954b7'): PipelineRunCompleted(status='PipelineRunCompleted', pipeline_run_id=UUID('1de1aac8-5256-5aa5-afd4-260a0e840b9b'), dataset_id=UUID('06a9442f-fee9-51a8-a5b9-ea18d1b954b7'), dataset_name='main_dataset', payload=None, data_ingestion_info=[{'run_info': PipelineRunCompleted(status='PipelineRunCompleted', pipeline_run_id=UUID('1de1aac8-5256-5aa5-afd4-260a0e840b9b'), dataset_id=UUID('06a9442f-fee9-51a8-a5b9-ea18d1b954b7'), dataset_name='main_dataset', payload=None, data_ingestion_info=None), 'data_id': UUID('36e0aee3-1c79-5ba5-976d-743b572435b9')}, {'run_info': PipelineRunAlreadyCompleted(status='PipelineRunAlreadyCompleted', pipeline_run_id=UUID('1de1aac8-5256-5aa5-afd4-260a0e840b9b'), dataset_id=UUID('06a9442f-fee9-51a8-a5b9-ea18d1b954b7'), dataset_name='main_dataset', payload=None, data_ingestion_info=None), 'data_id': UUID('5e252445-7af3-5852-97be-2871ee963f76')}, {'run_info': PipelineRunCompleted(status='PipelineRunCompleted', pipeline_run_id=UUID('1de1aac8-5256-5aa5-afd4-260a0e840b9b'), dataset_id=UUID('06a9442f-fee9-51a8-a5b9-ea18d1b954b7'), dataset_name='main_dataset', payload=None, data_ingestion_info=None), 'data_id': UUID('617bb29d-15c4-59a8-8597-7225d4bbe26f')}, {'run_info': PipelineRunCompleted(status='PipelineRunCompleted', pipeline_run_id=UUID('1de1aac8-5256-5aa5-afd4-260a0e840b9b'), dataset_id=UUID('06a9442f-fee9-51a8-a5b9-ea18d1b954b7'), dataset_name='main_dataset', payload=None, data_ingestion_info=None), 'data_id': UUID('8d8fa539-17f2-54b2-9bd8-a355c13de413')}, {'run_info': PipelineRunCompleted(status='PipelineRunCompleted', pipeline_run_id=UUID('1de1aac8-5256-5aa5-afd4-260a0e840b9b'), dataset_id=UUID('06a9442f-fee9-51a8-a5b9-ea18d1b954b7'), dataset_name='main_dataset', payload=None, data_ingestion_info=None), 'data_id': UUID('a95a6a59-2543-5e19-bed0-dd4b5c5f1440')}])}"
|
||
]
|
||
},
|
||
"execution_count": 9,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"await cognee.add(\"file://data/copilot_conversations.json\", node_set=[\"developer_data\"])\n",
|
||
"await cognee.add(\"file://data/my_developer_rules.md\", node_set=[\"developer_data\"])\n",
|
||
"await cognee.add(\"file://data/zen_principles.md\", node_set=[\"principles_data\"])\n",
|
||
"await cognee.add(\"file://data/pep_style_guide.md\", node_set=[\"principles_data\"])\n",
|
||
"\n",
|
||
"await cognee.cognify(temporal_cognify=True)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "98b69c45db2fca3",
|
||
"metadata": {
|
||
"ExecuteTime": {
|
||
"end_time": "2025-09-07T14:40:51.305617Z",
|
||
"start_time": "2025-09-07T14:40:48.605622Z"
|
||
}
|
||
},
|
||
"outputs": [
|
||
{
|
||
"name": "stderr",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:48.717540\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 784 nodes and 1335 edges in 0.10 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:48.723536\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mGraph projection completed: 784 nodes, 1335 edges in 0.11s\u001b[0m [\u001b[0m\u001b[1m\u001b[34mCogneeGraph\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:49.150849\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mVector collection retrieval completed: Retrieved distances from 6 collections in 0.03s\u001b[0m [\u001b[0m\u001b[1m\u001b[34mcognee.shared.logging_utils\u001b[0m]\u001b[0m\n"
|
||
]
|
||
},
|
||
{
|
||
"name": "stdout",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"['Preparing answer about type hinting challenges and mypy/Guido approach...']\n"
|
||
]
|
||
}
|
||
],
|
||
"source": [
|
||
"results = await cognee.search(\n",
|
||
" \"What Python type hinting challenges did I face, and how does Guido approach similar problems in mypy?\",\n",
|
||
" query_type=cognee.SearchType.GRAPH_COMPLETION\n",
|
||
")\n",
|
||
"print(results)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "6c49c4c252036fa1",
|
||
"metadata": {},
|
||
"source": [
|
||
"You'll see that cognee has connected your Python development challenges with Guido's approaches, revealing patterns like:\n",
|
||
"\n",
|
||
"- \"Type hint implementation failed due to circular imports - similar to issue Guido solved in mypy PR #1234\"\n",
|
||
"- \"Performance bottleneck in list comprehension matches pattern Guido optimized in CPython commit abc123\""
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "a1f4606bfed8fc45",
|
||
"metadata": {},
|
||
"source": [
|
||
"Memify\n",
|
||
"\n",
|
||
"Let's now introduce the memory functions. These algorithms run on top of your semantic layer, connecting the dots and improving the search.\n",
|
||
"\n",
|
||
"Memify is customizable and can use any transformation you'd like to write. But it also requires"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "20234960f7566b15",
|
||
"metadata": {
|
||
"ExecuteTime": {
|
||
"end_time": "2025-09-07T14:43:42.390990Z",
|
||
"start_time": "2025-09-07T14:40:51.321301Z"
|
||
}
|
||
},
|
||
"outputs": [
|
||
{
|
||
"name": "stderr",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:51.426773\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 784 nodes and 1335 edges in 0.08 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:51.432999\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mGraph projection completed: 784 nodes, 1335 edges in 0.08s\u001b[0m [\u001b[0m\u001b[1m\u001b[34mCogneeGraph\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:51.449998\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run started: `3538f0d3-f111-5205-abf4-4cfda343756d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:51.450407\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mAsync Generator task started: `extract_subgraph_chunks`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:40:51.450742\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `add_rule_associations`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:41:05.331800\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 788 nodes and 1338 edges in 0.09 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:41:07.730018\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 788 nodes and 1341 edges in 0.08 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:41:09.998799\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `add_rule_associations`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:41:09.999234\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `add_rule_associations`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:41:10.014853\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 4 nodes and 3 edges for NodeSet in 0.01 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:41:17.347059\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 790 nodes and 1343 edges in 0.09 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:41:19.354567\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 790 nodes and 1345 edges in 0.08 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:41:20.830388\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `add_rule_associations`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:41:20.830845\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `add_rule_associations`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:41:20.845333\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 6 nodes and 5 edges for NodeSet in 0.00 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:41:29.525183\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 793 nodes and 1348 edges in 0.10 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:41:31.837942\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 793 nodes and 1351 edges in 0.08 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:41:34.371498\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `add_rule_associations`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:41:34.372003\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `add_rule_associations`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:41:34.386997\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 9 nodes and 8 edges for NodeSet in 0.01 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:41:52.110870\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 797 nodes and 1355 edges in 0.09 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:41:54.662998\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 797 nodes and 1359 edges in 0.10 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:41:56.536947\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `add_rule_associations`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:41:56.537543\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `add_rule_associations`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:41:56.555702\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 13 nodes and 12 edges for NodeSet in 0.01 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:42:12.887813\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 800 nodes and 1362 edges in 0.12 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:42:15.248448\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 800 nodes and 1365 edges in 0.09 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:42:17.221284\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `add_rule_associations`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:42:17.221925\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `add_rule_associations`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:42:17.243052\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 16 nodes and 15 edges for NodeSet in 0.01 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:42:27.286546\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 803 nodes and 1368 edges in 0.09 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:42:29.381832\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 803 nodes and 1371 edges in 0.08 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:42:31.321887\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `add_rule_associations`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:42:31.322839\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `add_rule_associations`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:42:31.336200\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 19 nodes and 18 edges for NodeSet in 0.01 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:42:39.575903\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 806 nodes and 1374 edges in 0.10 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:42:41.989514\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 806 nodes and 1377 edges in 0.41 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:42:43.962812\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `add_rule_associations`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:42:43.963271\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `add_rule_associations`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:42:43.978252\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 22 nodes and 21 edges for NodeSet in 0.01 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:42:53.367959\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 809 nodes and 1380 edges in 0.09 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:42:55.300671\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 809 nodes and 1383 edges in 0.08 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:42:57.099099\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `add_rule_associations`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:42:57.099708\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `add_rule_associations`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:42:57.117196\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 25 nodes and 24 edges for NodeSet in 0.01 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:19.642215\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 813 nodes and 1387 edges in 0.09 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:21.652556\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 813 nodes and 1391 edges in 0.08 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:23.874571\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `add_rule_associations`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:23.875096\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task started: `add_rule_associations`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:23.889933\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 29 nodes and 28 edges for NodeSet in 0.01 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:38.330093\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 817 nodes and 1395 edges in 0.12 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:40.354659\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 817 nodes and 1399 edges in 0.08 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:42.377593\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mCoroutine task completed: `add_rule_associations`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:42.378288\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mAsync Generator task completed: `extract_subgraph_chunks`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_base\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:42.378593\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mPipeline run completed: `3538f0d3-f111-5205-abf4-4cfda343756d`\u001b[0m [\u001b[0m\u001b[1m\u001b[34mrun_tasks_with_telemetry()\u001b[0m]\u001b[0m\n"
|
||
]
|
||
},
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"{UUID('06a9442f-fee9-51a8-a5b9-ea18d1b954b7'): PipelineRunCompleted(status='PipelineRunCompleted', pipeline_run_id=UUID('cc37b094-c41d-54fc-b569-a40a3709d579'), dataset_id=UUID('06a9442f-fee9-51a8-a5b9-ea18d1b954b7'), dataset_name='main_dataset', payload=None, data_ingestion_info=[{'run_info': PipelineRunCompleted(status='PipelineRunCompleted', pipeline_run_id=UUID('cc37b094-c41d-54fc-b569-a40a3709d579'), dataset_id=UUID('06a9442f-fee9-51a8-a5b9-ea18d1b954b7'), dataset_name='main_dataset', payload=None, data_ingestion_info=None)}])}"
|
||
]
|
||
},
|
||
"execution_count": 11,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"await cognee.memify()"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "58d3ccec16f67c24",
|
||
"metadata": {},
|
||
"source": [
|
||
"What memify() does for Python: This advanced function uses AI to:\n",
|
||
"\n",
|
||
"- Infer rule patterns from your code (e.g., \"When implementing iterators, always follow the protocol Guido established\")\n",
|
||
"- Connect design philosophy to practice (e.g., linking \"explicit is better than implicit\" to your type hinting decisions)\n"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "a304033f9f0f5dcf",
|
||
"metadata": {},
|
||
"source": [
|
||
"Now let's see how the system has connected your Python development patterns with established best practices:\n"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "518fa9b17a604657",
|
||
"metadata": {
|
||
"ExecuteTime": {
|
||
"end_time": "2025-09-07T14:43:44.837614Z",
|
||
"start_time": "2025-09-07T14:43:42.465351Z"
|
||
}
|
||
},
|
||
"outputs": [
|
||
{
|
||
"name": "stderr",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:42.570204\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 817 nodes and 1399 edges in 0.09 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:42.576838\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mGraph projection completed: 817 nodes, 1399 edges in 0.10s\u001b[0m [\u001b[0m\u001b[1m\u001b[34mCogneeGraph\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:42.929319\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mVector collection retrieval completed: Retrieved distances from 6 collections in 0.03s\u001b[0m [\u001b[0m\u001b[1m\u001b[34mcognee.shared.logging_utils\u001b[0m]\u001b[0m\n"
|
||
]
|
||
},
|
||
{
|
||
"name": "stdout",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"Python Pattern Analysis: ['Preparing concise alignment analysis...']\n"
|
||
]
|
||
}
|
||
],
|
||
"source": [
|
||
"# Search for connections between your async patterns and Python philosophy\n",
|
||
"results = await cognee.search(\n",
|
||
" query_text= \"How does my AsyncWebScraper implementation align with Python's design principles?\",\n",
|
||
" query_type=cognee.SearchType.GRAPH_COMPLETION\n",
|
||
")\n",
|
||
"print(\"Python Pattern Analysis:\", results)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "2c77c1582ab9fc32",
|
||
"metadata": {},
|
||
"source": [
|
||
"Nodeset filtering\n",
|
||
"\n",
|
||
"Let's see how should variables be named\n",
|
||
"\n",
|
||
"Stay tuned for notesets, our way to filter exact nodeset details. Coming soon!"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "c64036c03abe41e7",
|
||
"metadata": {
|
||
"ExecuteTime": {
|
||
"end_time": "2025-09-07T14:43:49.542281Z",
|
||
"start_time": "2025-09-07T14:43:44.852455Z"
|
||
}
|
||
},
|
||
"outputs": [
|
||
{
|
||
"name": "stderr",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:44.878134\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 5 nodes and 6 edges for NodeSet in 0.01 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:44.878868\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mGraph projection completed: 5 nodes, 6 edges in 0.01s\u001b[0m [\u001b[0m\u001b[1m\u001b[34mCogneeGraph\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:45.578030\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mVector collection retrieval completed: Retrieved distances from 6 collections in 0.04s\u001b[0m [\u001b[0m\u001b[1m\u001b[34mcognee.shared.logging_utils\u001b[0m]\u001b[0m\n"
|
||
]
|
||
}
|
||
],
|
||
"source": [
|
||
"results = await cognee.search(\n",
|
||
" query_text= \"How should variables be named?\",\n",
|
||
")"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "c641b8b7e50dd2ae",
|
||
"metadata": {},
|
||
"source": [
|
||
"Temporal graphs\n",
|
||
"\n",
|
||
"As we used temporal_cognify option for each cognification, we can ask time related questions, for example:"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "28e7d5a75e076b8f",
|
||
"metadata": {
|
||
"ExecuteTime": {
|
||
"end_time": "2025-09-07T14:43:55.278031Z",
|
||
"start_time": "2025-09-07T14:43:49.555704Z"
|
||
}
|
||
},
|
||
"outputs": [
|
||
{
|
||
"name": "stderr",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:51.896018\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mNo timestamps identified based on the query, performing retrieval using triplet search on events and entities.\u001b[0m [\u001b[0m\u001b[1m\u001b[34mcognee.shared.logging_utils\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:52.009621\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 817 nodes and 1399 edges in 0.10 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:52.016085\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mGraph projection completed: 817 nodes, 1399 edges in 0.10s\u001b[0m [\u001b[0m\u001b[1m\u001b[34mCogneeGraph\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:52.426193\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mVector collection retrieval completed: Retrieved distances from 6 collections in 0.03s\u001b[0m [\u001b[0m\u001b[1m\u001b[34mcognee.shared.logging_utils\u001b[0m]\u001b[0m\n"
|
||
]
|
||
},
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"[\"Using the provided context, here is a brief summary of what we can learn from Guido's contributions in 2025:\"]"
|
||
]
|
||
},
|
||
"execution_count": 14,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"await cognee.search(\n",
|
||
" query_text = \"What can we learn from Guido's contributions in 2025?\",\n",
|
||
" query_type=cognee.SearchType.TEMPORAL\n",
|
||
")"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "ec6cf074a6c272ab",
|
||
"metadata": {},
|
||
"source": [
|
||
"Feedback loops\n",
|
||
"\n",
|
||
"Note that when you search, you can enable storing of results:"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "67dec85a658aad76",
|
||
"metadata": {
|
||
"ExecuteTime": {
|
||
"end_time": "2025-09-07T14:43:58.472950Z",
|
||
"start_time": "2025-09-07T14:43:55.288993Z"
|
||
}
|
||
},
|
||
"outputs": [
|
||
{
|
||
"name": "stderr",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:55.438956\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mRetrieved 817 nodes and 1399 edges in 0.10 seconds\u001b[0m [\u001b[0m\u001b[1m\u001b[34mNeo4jAdapter\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:55.456944\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mGraph projection completed: 817 nodes, 1399 edges in 0.12s\u001b[0m [\u001b[0m\u001b[1m\u001b[34mCogneeGraph\u001b[0m]\u001b[0m\n",
|
||
"\n",
|
||
"\u001b[2m2025-09-07T14:43:55.823583\u001b[0m [\u001b[32m\u001b[1minfo \u001b[0m] \u001b[1mVector collection retrieval completed: Retrieved distances from 6 collections in 0.03s\u001b[0m [\u001b[0m\u001b[1m\u001b[34mcognee.shared.logging_utils\u001b[0m]\u001b[0m\n"
|
||
]
|
||
}
|
||
],
|
||
"source": [
|
||
"answer = await cognee.search(\n",
|
||
" query_type=cognee.SearchType.GRAPH_COMPLETION,\n",
|
||
" query_text=\"What is the most zen thing about Python?\",\n",
|
||
" save_interaction=True, # This enables feedback later\n",
|
||
")"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "2f64d90e6dadaefb",
|
||
"metadata": {},
|
||
"source": [
|
||
"This enables giving feedback, that itself can also be stored in the graph and will be included in future searches:"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "870149ea58fd109c",
|
||
"metadata": {
|
||
"ExecuteTime": {
|
||
"end_time": "2025-09-07T14:44:00.503091Z",
|
||
"start_time": "2025-09-07T14:43:58.480893Z"
|
||
}
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"feedback = await cognee.search(\n",
|
||
" query_type=cognee.SearchType.FEEDBACK,\n",
|
||
" query_text=\"Last result was useful, I like code that complies with best practices.\",\n",
|
||
" last_k=1,\n",
|
||
")"
|
||
]
|
||
}
|
||
],
|
||
"metadata": {
|
||
"kernelspec": {
|
||
"display_name": "Python 3",
|
||
"language": "python",
|
||
"name": "python3"
|
||
},
|
||
"language_info": {
|
||
"codemirror_mode": {
|
||
"name": "ipython",
|
||
"version": 2
|
||
},
|
||
"file_extension": ".py",
|
||
"mimetype": "text/x-python",
|
||
"name": "python",
|
||
"nbconvert_exporter": "python",
|
||
"pygments_lexer": "ipython2",
|
||
"version": "2.7.6"
|
||
}
|
||
},
|
||
"nbformat": 4,
|
||
"nbformat_minor": 5
|
||
}
|