Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions openviking/retrieve/hierarchical_retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,20 +320,27 @@ def merge_filter(base_filter: Dict, extra_filter: Optional[Dict]) -> Dict:
alpha * score + (1 - alpha) * current_score if current_score else score
)

if passes_threshold(final_score) and uri not in visited:
if not passes_threshold(final_score):
logger.debug(
f"[RecursiveSearch] URI {uri} score {final_score} did not pass threshold {effective_threshold}"
)
continue

# Always collect results that pass threshold, even if already
# visited as a directory starting point. The visited set only
# prevents re-entering directories for child search.
if not any(c.get("uri") == uri for c in collected):
r["_final_score"] = final_score
collected.append(r)
logger.debug(
f"[RecursiveSearch] Added URI: {uri} to candidates with score: {final_score}"
)

if uri not in visited:
if r.get("is_leaf"):
visited.add(uri)
continue
heapq.heappush(dir_queue, (-final_score, uri))
else:
logger.debug(
f"[RecursiveSearch] URI {uri} score {final_score} did not pass threshold {effective_threshold}"
)
else:
heapq.heappush(dir_queue, (-final_score, uri))

# Convergence check
current_topk = sorted(collected, key=lambda x: x.get("_final_score", 0), reverse=True)[
Expand Down
6 changes: 4 additions & 2 deletions openviking/utils/skill_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ async def process_skill(
"source_path": skill_dict.get("source_path", ""),
},
)
context.set_vectorize(Vectorize(text=context.abstract))

overview = await self._generate_overview(skill_dict, config)

# Use overview for vectorization (richer semantic content than abstract alone)
vectorize_text = overview if overview else context.abstract
context.set_vectorize(Vectorize(text=vectorize_text))

skill_dir_uri = f"viking://agent/skills/{context.meta['name']}"

await self._write_skill_content(
Expand Down
Loading