Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

fix: use reason as instruction fallback in resource processing (#258)

Sense_wang35bc7a6a6321
diff --git a/openviking/utils/resource_processor.py b/openviking/utils/resource_processor.py
index ff240d984..b28776f6e 100644
--- a/openviking/utils/resource_processor.py
+++ b/openviking/utils/resource_processor.py
@@ -95,9 +95,12 @@ class ResourceProcessor:
# ============ Phase 1: Parse source (Parser generates L0/L1 and writes to temp) ============
try:
media_processor = self._get_media_processor()
+ # Use reason as instruction fallback so it influences L0/L1
+ # generation and improves search relevance as documented.
+ effective_instruction = instruction or reason
parse_result = await media_processor.process(
source=path,
- instruction=instruction,
+ instruction=effective_instruction,
**kwargs,
)
result["source_path"] = parse_result.source_path or path