Skip to content

feat(llc/kb): Sub-company KB inheritance — parent KB read-through with weight decay #8241

Closed

Description

@mrveiss

Parent

Phase 5 (#8209) · Umbrella (#8204)

Depends On

#8235 — KB collection lifecycle. #8236 — Context builder (inheritance applied here).

Context

Sub-companies automatically inherit parent company policies and guidelines via read-through. A subsidiary can use parent LLC standards without duplicating them, while still prioritizing its own company context.

Acceptance Criteria

  • KbInheritanceResolver in llc/kb/inheritance.py:
    • get_query_collections(company_id) -> list[tuple[str, float]]:
      • Walks parent_org_id chain from company to root
      • Returns list of (collection_name, weight) tuples
      • Weight decay: own company = 1.0, parent = 0.6, grandparent = 0.36 (configurable multiplier, default 0.6 per level)
    • search_with_inheritance(company_id, query, top_k=10) -> list[KbResult]:
      • Issues parallel RAG queries across all collections in the chain
      • Merges and re-ranks results by score * weight
      • Returns top_k results with source_company_id annotation
  • Weight multiplier configurable per company: llc_companies.kb_inheritance_weight FLOAT DEFAULT 0.6
  • KbInheritanceResolver integrated into HeartbeatContextBuilder.build() — replaces direct company collection query with inherited query
  • Sub-company agents CANNOT write to parent company collections (enforced in collection write path)
  • GET /api/llc/companies/{id}/kb/ancestry-collections — returns the resolved collection chain for inspection
  • python -m pytest autobot-backend/llc/ -k kb_inheritance passes

Activity

  1. github-actions commented on May 24, 2026

    @github-actions
    Contributor

    PR #8554 (merged to Dev_new_gui) references this issue with a close keyword.

    feat(llc/kb): sub-company KB inheritance with parent read-through and weight decay (#8241)

    If this issue is fully resolved, close it manually. If work remains, no action is needed.

  2. mrveiss commented on May 24, 2026

    @mrveiss
    OwnerAuthor

    Implementation complete. Merged via PR into Dev_new_gui.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions