c889a57b6b
Test Suites / Build CI Environment (push) Has been cancelled
Test Suites / Basic Tests (push) Has been cancelled
Test Suites / End-to-End Tests (push) Has been cancelled
Test Suites / CLI Tests (push) Has been cancelled
Test Suites / Slow End-to-End Tests (push) Has been cancelled
Test Suites / Graph Database Tests (push) Has been cancelled
Test Suites / Vector DB Tests (push) Has been cancelled
Test Suites / Temporal Graph Test (push) Has been cancelled
Test Suites / Search Test on Different DBs (push) Has been cancelled
Test Suites / Example Tests (push) Has been cancelled
Test Suites / Notebook Tests (push) Has been cancelled
Test Suites / OS and Python Tests Ubuntu (push) Has been cancelled
Test Suites / OS and Python Tests Extended (push) Has been cancelled
Test Suites / LLM Test Suite (push) Has been cancelled
Test Suites / S3 File Storage Test (push) Has been cancelled
Test Suites / Run Integration Tests (push) Has been cancelled
Test Suites / MCP Tests (push) Has been cancelled
Test Suites / Docker Compose Test (push) Has been cancelled
Test Suites / Docker CI test (push) Has been cancelled
Test Suites / Relational DB Migration Tests (push) Has been cancelled
Test Suites / Distributed Cognee Test (push) Has been cancelled
Test Suites / DB Examples Tests (push) Has been cancelled
Test Suites / Test Completion Status (push) Has been cancelled
Test Suites / Claude Code Review (push) Has been cancelled
Test Suites / basic checks (push) Has been cancelled
build | Build and Push Cognee MCP Docker Image to dockerhub / docker-build-and-push (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
build | Build and Push Docker Image to dockerhub / docker-build-and-push (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges Core Functionality (3.11) (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges Core Functionality (3.12) (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges with Different Graph Databases (kuzu, kuzu) (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges with Different Graph Databases (neo4j, neo4j) (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges Examples (push) Has been cancelled
Weighted Edges Tests / Code Quality for Weighted Edges (push) Has been cancelled
74 lines
2.0 KiB
Python
Executable File
74 lines
2.0 KiB
Python
Executable File
import os
|
|
import pathlib
|
|
import cognee
|
|
from cognee.modules.search.operations import get_history
|
|
from cognee.modules.users.methods import get_default_user
|
|
from cognee.shared.logging_utils import get_logger
|
|
from cognee.modules.search.types import SearchType
|
|
|
|
logger = get_logger()
|
|
|
|
|
|
async def main():
|
|
data_directory_path = str(
|
|
pathlib.Path(
|
|
os.path.join(pathlib.Path(__file__).parent, ".data_storage/test_library")
|
|
).resolve()
|
|
)
|
|
cognee.config.data_root_directory(data_directory_path)
|
|
cognee_directory_path = str(
|
|
pathlib.Path(
|
|
os.path.join(pathlib.Path(__file__).parent, ".cognee_system/test_library")
|
|
).resolve()
|
|
)
|
|
cognee.config.system_root_directory(cognee_directory_path)
|
|
|
|
await cognee.prune.prune_data()
|
|
await cognee.prune.prune_system(metadata=True)
|
|
|
|
await cognee.add(["TEST1"], "test1")
|
|
await cognee.add(["TEST2"], "test2")
|
|
|
|
task_1_config = {
|
|
"vector_db_url": "cognee1.test",
|
|
"vector_db_key": "",
|
|
"vector_db_provider": "lancedb",
|
|
"vector_db_name": "",
|
|
}
|
|
task_2_config = {
|
|
"vector_db_url": "cognee2.test",
|
|
"vector_db_key": "",
|
|
"vector_db_provider": "lancedb",
|
|
"vector_db_name": "",
|
|
}
|
|
|
|
task_1_graph_config = {
|
|
"graph_database_provider": "ladybug",
|
|
"graph_file_path": "ladybug1.db",
|
|
}
|
|
task_2_graph_config = {
|
|
"graph_database_provider": "ladybug",
|
|
"graph_file_path": "ladybug2.db",
|
|
}
|
|
|
|
# schedule both cognify calls concurrently
|
|
task1 = asyncio.create_task(
|
|
cognee.cognify(
|
|
["test1"], vector_db_config=task_1_config, graph_db_config=task_1_graph_config
|
|
)
|
|
)
|
|
task2 = asyncio.create_task(
|
|
cognee.cognify(
|
|
["test2"], vector_db_config=task_2_config, graph_db_config=task_2_graph_config
|
|
)
|
|
)
|
|
|
|
# wait until both are done (raises first error if any)
|
|
await asyncio.gather(task1, task2)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
import asyncio
|
|
|
|
asyncio.run(main(), debug=True)
|