QuickStart tutorial is not working
Trying to follow QuickStart first i noticed was
EMBEDDING_MODE="sentence-transformers/all-MiniLM-L6-v2" # should be EMBEDDING_MODEL
Which looks sane at first glance and takes some time to realize the typo.
Secondly, following the docs, I used
LLM_PROVIDER="gemini"
LLM_API_KEY=$GITHUB_PERSONAL_ACCESS_TOKEN
LLM_MODEL="gemini/gemini-2.0-flash"
LLM_ENDPOINT="https://generativelanguage.googleapis.com/"
LLM_API_VERSION="v1beta"
EMBEDDING_PROVIDER="fastembed"
EMBEDDING_MODEL="sentence-transformers/all-MiniLM-L6-v2"
EMBEDDING_DIMENSIONS=384
EMBEDDING_MAX_TOKENS=256
Got an infinite loop, then moved to EMBEDDING_MODEL="BAAI/bge-small-en-v1.5", just how fastembed suggests, but got the same.
the main.py has the same content as from the quickstart link, i just had to poetry add fastembed to make it work with free embeddings.
The logs:
❯ EMBEDDING_MODEL="BAAI/bge-small-en-v1.5" poetry run python main.py
HTTP Request: GET https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json "HTTP/1.1 200 OK"
2025-05-06T04:57:11.602941 [warning ] Ontology file 'None' not found. Using fallback ontology at http://example.org/empty_ontology [OntologyAdapter]
2025-05-06T04:57:11.603360 [info ] Lookup built: 0 classes, 0 individuals [OntologyAdapter]
Langfuse client is disabled since no public_key was provided as a parameter or environment variable 'LANGFUSE_PUBLIC_KEY'. See our docs: https://langfuse.com/docs/sdk/python/low-level-sdk#initialize-client04:57:16 - LiteLLM:INFO: utils.py:3108 -
LiteLLM completion() model= gemini-2.0-flash; provider = gemini
LiteLLM completion() model= gemini-2.0-flash; provider = gemini04:57:16 - LiteLLM:INFO: cost_calculator.py:638 - selected model name for cost calculation: gemini/gemini-2.0-flash
selected model name for cost calculation: gemini/gemini-2.0-flash04:57:16 - LiteLLM:INFO: cost_calculator.py:638 - selected model name for cost calculation: gemini/gemini-2.0-flash
selected model name for cost calculation: gemini/gemini-2.0-flash04:57:16 - LiteLLM:INFO: cost_calculator.py:638 - selected model name for cost calculation: gemini/gemini-2.0-flash
selected model name for cost calculation: gemini/gemini-2.0-flash04:57:16 - LiteLLM:INFO: cost_calculator.py:638 - selected model name for cost calculation: gemini/gemini-2.0-flash
selected model name for cost calculation: gemini/gemini-2.0-flash
2025-05-06T04:57:17.006322 [info ] Dataset 0ced9703-20b4-5a50-a755-53c793913704 is already being processed. [cognee.pipeline]
2025-05-06T04:57:17.006523 [warning ] Ontology file 'None' not found. Using fallback ontology at http://example.org/empty_ontology [OntologyAdapter]
2025-05-06T04:57:17.006635 [info ] Lookup built: 0 classes, 0 individuals [OntologyAdapter]
2025-05-06T04:57:17.020207 [info ] Dataset 0ced9703-20b4-5a50-a755-53c793913704 is already being processed. [cognee.pipeline]
HTTP Request: GET https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json "HTTP/1.1 200 OK"
HTTP Request: GET https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json "HTTP/1.1 200 OK"
HTTP Request: GET https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json "HTTP/1.1 200 OK"
HTTP Request: GET https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json "HTTP/1.1 200 OK"
HTTP Request: GET https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json "HTTP/1.1 200 OK"
HTTP Request: GET https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json "HTTP/1.1 200 OK"
HTTP Request: GET https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json "HTTP/1.1 200 OK"
HTTP Request: GET https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json "HTTP/1.1 200 OK"
HTTP Request: GET https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json "HTTP/1.1 200 OK"
HTTP Request: GET https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json "HTTP/1.1 200 OK"
2025-05-06T04:57:25.161183 [warning ] Ontology file 'None' not found. Using fallback ontology at http://example.org/empty_ontology [OntologyAdapter]
2025-05-06T04:57:25.162112 [info ] Lookup built: 0 classes, 0 individuals [OntologyAdapter]
2025-05-06T04:57:25.217458 [warning ] Ontology file 'None' not found. Using fallback ontology at http://example.org/empty_ontology [OntologyAdapter]
2025-05-06T04:57:25.217994 [info ] Lookup built: 0 classes, 0 individuals [OntologyAdapter]
2025-05-06T04:57:25.220909 [warning ] Ontology file 'None' not found. Using fallback ontology at http://example.org/empty_ontology [OntologyAdapter]
2025-05-06T04:57:25.221290 [info ] Lookup built: 0 classes, 0 individuals [OntologyAdapter]
2025-05-06T04:57:25.223726 [warning ] Ontology file 'None' not found. Using fallback ontology at http://example.org/empty_ontology [OntologyAdapter]
2025-05-06T04:57:25.224147 [info ] Lookup built: 0 classes, 0 individuals [OntologyAdapter]
2025-05-06T04:57:25.238786 [warning ] Ontology file 'None' not found. Using fallback ontology at http://example.org/empty_ontology [OntologyAdapter]
2025-05-06T04:57:25.239299 [info ] Lookup built: 0 classes, 0 individuals [OntologyAdapter]
2025-05-06T04:57:25.251959 [warning ] Ontology file 'None' not found. Using fallback ontology at http://example.org/empty_ontology [OntologyAdapter]
2025-05-06T04:57:25.252478 [info ] Lookup built: 0 classes, 0 individuals [OntologyAdapter]
2025-05-06T04:57:25.272321 [warning ] Ontology file 'None' not found. Using fallback ontology at http://example.org/empty_ontology [OntologyAdapter]
2025-05-06T04:57:25.273055 [info ] Lookup built: 0 classes, 0 individuals [OntologyAdapter]
2025-05-06T04:57:25.521269 [warning ] Ontology file 'None' not found. Using fallback ontology at http://example.org/empty_ontology [OntologyAdapter]
2025-05-06T04:57:25.521605 [info ] Lookup built: 0 classes, 0 individuals [OntologyAdapter]
2025-05-06T04:57:25.531653 [warning ] Ontology file 'None' not found. Using fallback ontology at http://example.org/empty_ontology [OntologyAdapter]
2025-05-06T04:57:25.533105 [info ] Lookup built: 0 classes, 0 individuals [OntologyAdapter]
2025-05-06T04:57:25.543711 [warning ] Ontology file 'None' not found. Using fallback ontology at http://example.org/empty_ontology [OntologyAdapter]
2025-05-06T04:57:25.544190 [info ] Lookup built: 0 classes, 0 individuals [OntologyAdapter]
Reader worker: 9 PID: 3142 Device: CPU
Reader worker: 0 PID: 3133 Device: CPU
Reader worker: 7 PID: 3140 Device: CPU
Reader worker: 2 PID: 3135 Device: CPU
Reader worker: 5 PID: 3138 Device: CPU
Reader worker: 4 PID: 3137 Device: CPU
Reader worker: 1 PID: 3134 Device: CPU
Reader worker: 3 PID: 3136 Device: CPU
Reader worker: 6 PID: 3139 Device: CPU
Reader worker: 8 PID: 3141 Device: CPU
Reader worker 4 finished
Reader worker 0 finished
Reader worker 5 finished
Reader worker 7 finished
Reader worker 3 finished
Reader worker 9 finished
Reader worker 8 finished
Reader worker 2 finished
Reader worker 6 finished ^C
It's run in a Ubuntu Linux docker container, with the allocation of 24 GB of RAM and 12 CPU cores, which seems to be enough with a remote LLM model, but in the process of execution, it consumes all the CPU provided.
python = ">=3.11,<=3.13" # Match cognee’s Python requirement
cognee = "^0.1.39"
fastembed = "^0.6.1"
python --version
Python 3.12.10
In issue #807, opened just a few hours ago, the author had a similar problem from another perspective.
@kvokka I updated the docs, I am unsure where is the problem exactly. @borisarzentar might be able to help or @soobrosa
Thanks for reporting this @kvokka, looking into it.
Hey @kvokka, so do I get it right that after Reader worker 6 finished on the terminal it hangs?
@soobrosa it goes to the infinite loop, consuming all CPU's provided. It's easy to reproduce, grab my boilerplate, run it in a devcontainer, and then follow the QuickStart Guide.
Thank you @kvokka, managed to reproduce in plain vanilla, looking into it.
I am getting a similar issue. I am using the following code:
from cognee.modules.search.types import SearchType import cognee import asyncio
results = await cognee.search( query_text="What laws, regulations, or sub-regulations are related to Regulation K?", query_type=SearchType.GRAPH_SUMMARY_COMPLETION )
results
But end up getting InvalidValueError: ('LLM API key is not set.', 'InvalidValueError')
Despite doing this above: os.environ["LLM_API_KEY"] = "XX"
os.environ["LLM_ENDPOINT"] = "XX" os.environ["LLM_MODEL"] = "gpt-4.1"
@Francisco-Reveriano can you share the log file here? what is the value of LLM_PROVIDER?
I managed to solve this one. But running into a problem. When I try to pull cognee.search into a seperate standalone function:
`import os from dotenv import load_dotenv from typing import Any, List, Dict import asyncio import cognee from cognee.infrastructure.databases.vector.pgvector import create_db_and_tables as create_pgvector_db_and_tables from cognee.infrastructure.databases.relational import create_db_and_tables as create_relational_db_and_tables from cognee.modules.search.types import SearchType from cognee.modules.users.models import User from cognee.modules.users.methods import get_default_user from cognee.tasks.ingestion.ingest_data import ingest_data
Load environment variables from .env
load_dotenv()
from cognee.modules.search.types import SearchType
async def query_cognee(question:str) -> str: """ Perform an async search against Cognee and attach the top-k chunks to state. """
search_results = await cognee.search(
query_text=question,
query_type=SearchType.SUMMARIES,
)
return str(search_results)`
I end up getting "No data found in the system, please add data first"
@Francisco-Reveriano I don't think these issues are related. I will close the current issue as the fix has been merged, and feel free to open another one
@Francisco-Reveriano, if you can push your script to a repo, please share it. This way it is really hard to troubleshoot