Troubleshooting
Common problems and how to fix them. If your problem is not here, open an issue on GitHub or check the FAQ.
The CLI exits with code 1 and “Connection failed”
The HTTP client could not reach the URL after KNOWLEDGE_MAX_RETRIES attempts.
Fix
- Verify the URL in a browser or with
curl -I <url>. - If the URL is correct but flaky, raise the retry count by editing
MAX_RETRIESinknowledge/sdk.py(planned: environment override in v0.2). - If your network blocks the request, configure a proxy or use a local source file instead (see Run the SDK without network access).
“Response too large”
The HTTP response body exceeds KNOWLEDGE_MAX_BODY_SIZE (50 MiB by default).
Fix
- If the source has a smaller “printable” version, use that URL instead.
- For local files, you can bypass the limit by reading the file directly with
Knowledge.read_sourceand passing the string toLLMExtractor.extract. - For very large documents, split the source into multiple files and run
knowledge createon each, then merge the bundles by hand.
“Invalid LLM response for section ‘’”
The LLM returned text that could not be parsed as JSON, even after stripping the Markdown fence.
Fix
- The section is logged at
WARNINGlevel and skipped — extraction continues. - If many sections fail, the prompt may be poorly suited to your model. Try a different
--modelvalue. - If the failure is consistent for a specific heading, edit the source document to remove the offending heading.
“Concept id must be a kebab-case slug”
The LLM returned an id field that does not match ^[a-z][a-z0-9-]*$.
Fix
- The concept is logged at
WARNINGlevel and skipped. Extraction continues. - If a particular model keeps producing invalid IDs, lower the
temperature(the SDK uses0.0by default; customiseLLMExtractordirectly if you need to change it).
“Knowledge.update destroyed my hand-edits”
update is destructive — see Refresh a bundle after the source changes. Hand-edited files in the bundle are overwritten.
Fix
The cleanest fix is prevention: keep hand-edits in a separate directory or in a separate branch and merge them in after update. If you have already lost edits, look in the git history if the bundle was tracked, or restore from your editor’s autosave.
“Concept ID was not found in the bundle”
knowledge remove reported one or more unknown IDs (exit code 2). This is a warning, not a hard failure — typos in the requested IDs are visible to operators without aborting the whole command.
Fix
- Open the bundle’s
index.mdand find the correct IDs. - Re-run
knowledge removewith the corrected IDs.
“ModuleNotFoundError: No module named ‘knowledge’”
The package is not installed in the active Python environment.
Fix
pip install knowledge
If you are working from a checkout of the repository:
pip install -e ".[dev]"
“litellm.AuthenticationError”
The API key for your provider is missing or invalid.
Fix
export OPENAI_API_KEY=sk-...
or for Anthropic:
export ANTHROPIC_API_KEY=sk-ant-...
For local Ollama, ensure the daemon is running and OLLAMA_HOST points at it.
Getting more help
- Read the FAQ for high-level questions.
- Open an issue at https://github.com/sachncs/knowledge/issues — include the command you ran, the full output, and the version (
python -c "import knowledge; print(knowledge.__version__)"). - For security issues, follow the security policy — do not open a public issue.