Skip to content

feat: hierarchical documents with semantic search (#438) #440

Closed

Description

@ajianaz

Goal

Upgrade document engine from flat to hierarchical (depth-10 tree) with semantic search capability.

Scope

Hierarchical Documents (depth-10 tree engine)

  • Schema v12: parent_id, path (materialized), depth, sort_order, has_children
  • doc create --parent, doc children, doc descendants, doc breadcrumbs, doc move
  • Cascade delete, circular reference guard, subtree queries

Document Semantic Search

  • doc_search(query) — embed query → search chunk embeddings → JOIN document metadata
  • FTS5 for documents (title/slug fuzzy search)
  • Hybrid search: semantic + FTS5 with RRF merge

Architecture Principle

  • SQLite = single source of truth (full docs, metadata, chunks)
  • usearch = index ONLY for semantic lookup
  • document_chunks embedding already exists but not searchable
  • doc_search bridges: embed query → usearch → SQLite JOIN → DocumentSearchResult

Branch

feat/hierarchical-documents → develop

Effort

~3-4 days dev (hierarchical already done, semantic search remaining)

Activity

  1. added
    enhancement
    on Jun 22, 2026
  2. ajianaz commented on Jun 22, 2026

    @ajianaz
    CollaboratorAuthor

    Closed: implemented in PR #439 (merged) + PR #441 (API endpoints). Doc search (semantic/fts/hybrid) with chunk embeddings + FTS5 + RRF fusion all shipped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions