Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

476 B
Raw Blame
/** Match only visible resource metadata; preserve source order and object identity. */
export function matchesResourceQuery(resource: { name?: string; description?: string } | null | undefined, query: string): boolean {
  const terms = query.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean)
  if (!terms.length) return true
  const text = `${resource?.name ?? ''} ${resource?.description ?? ''}`.toLocaleLowerCase()
  return terms.every(term => text.includes(term))
}