Description
Knowledge._update_content and Knowledge._aupdate_content in libs/agno/agno/knowledge/knowledge.py perform aget_knowledge_content lookup before upserting. when the row is missing, both methods log a warning ("Content row not found for id: ..., cannot update status") and return None instead of letting the backend upsert insert the new row. the field-merge logic between the sync and async variants is also duplicated
Steps to Reproduce
- create a
Knowledge instance with a SqliteDb (or any BaseDb) attached as contents_db
- build a
Content with an id that does not exist in the contents table
- call
knowledge._update_content(content)
- observe the warning log and
None return value, the row is never written
Agent Configuration (if applicable)
No response
Expected Behavior
the call should produce a row for the given id by trusting the backend upsert_knowledge_content. on a missing row this means insert; on an existing row it means partial update with metadata merge preserved
Actual Behavior
on a missing row the method logs "Content row not found for id: ..., cannot update status" and returns None. nothing is written. the same code path exists in _aupdate_content
Screenshots or Logs (if applicable)
No response
Environment
- OS: Windows 11
- Python: 3.13.7
Possible Solutions (optional)
No response
Additional Context
No response
Description
Knowledge._update_contentandKnowledge._aupdate_contentinlibs/agno/agno/knowledge/knowledge.pyperform aget_knowledge_contentlookup before upserting. when the row is missing, both methods log a warning ("Content row not found for id: ..., cannot update status") and returnNoneinstead of letting the backend upsert insert the new row. the field-merge logic between the sync and async variants is also duplicatedSteps to Reproduce
Knowledgeinstance with aSqliteDb(or anyBaseDb) attached ascontents_dbContentwith anidthat does not exist in the contents tableknowledge._update_content(content)Nonereturn value, the row is never writtenAgent Configuration (if applicable)
No response
Expected Behavior
the call should produce a row for the given id by trusting the backend
upsert_knowledge_content. on a missing row this means insert; on an existing row it means partial update with metadata merge preservedActual Behavior
on a missing row the method logs "Content row not found for id: ..., cannot update status" and returns
None. nothing is written. the same code path exists in_aupdate_contentScreenshots or Logs (if applicable)
No response
Environment
Possible Solutions (optional)
No response
Additional Context
No response