Repository navigation
Description
Bug Report: Concept generation fails with 'list' object has no attribute 'get'
Description
When running openkb add on documents that generate multiple concepts, the concept compiler frequently crashes with:
openkb.agent.compiler WARNING: Concept generation failed: 'list' object has no attribute 'get'
[WARN] N concept(s) planned but only M written for <Document Name> (AttributeError).
This occurs even when the LLM successfully generates all concept content — the compiler fails to parse the response and write the concept files.
Steps to Reproduce
- Add a document that generates multiple concepts (e.g., a long article with several distinct key phrases)
- Observe the warning in the output
- Check
wiki/concepts/— one or more concepts are missing - Re-running
openkb adddoes not recover the missing concepts (they are already "written" from the compiler's perspective)
Expected Behavior
All planned concepts should be written to wiki/concepts/ even when the LLM response format varies.
Root Cause Analysis
The concept compiler assumes that LLM responses for concept metadata (title, slug, brief) are dicts. When the LLM returns a list instead of a dict for any concept's metadata, calling .get() on the list raises AttributeError.
The concept content is successfully generated by the LLM — only the parsing/serialization step fails.
Affected code path: Concept compiler metadata extraction (likely in the function that parses LLM output into concept objects before writing to disk).
Error Traceback (typical)
openkb.agent.compiler WARNING: Concept generation failed: 'list' object has no attribute 'get'
File ".../openkb/agent/compiler.py", line XXX, in _parse_concept_metadata
title = metadata.get('title')
AttributeError: 'list' object has no attribute 'get'
Workaround
Manually extract concept content from the source document in wiki/sources/ and create the concept file in wiki/concepts/ following the standard concept format. This works because the source document contains the same content the LLM was attempting to extract.
I have built a SKILL.md file that will do this for me so that I don't have to manually go in and edit the concepts anymore. I can attach that as necessary if anyone is interested and facing the same issue.
Environment
- openkb version: 0.4.1
- Python version: 3.14
- OS: macOS
- LLM provider: OpenAI compatible (generally) - MegaLLM (more specifically)
Additional Context
This is a frequent failure in regular usage — occurs on approximately 45-65% of multi-concept document additions. The issue significantly impacts the reliability of the concept generation pipeline.
It typically impacts documents with 3 or more concepts and will often fail at least 2 concepts if the concept amount (to update or to add to the wiki) is greater than 3.
Tags
bug, concept-compiler, reliability
Activity
refactor(compiler): extract _page_fields + _llm_call_page_async; cove…