fuli-context 0.23.0-beta.9 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/web/assets/{AboutPage-Co0jsR1c.js → AboutPage-S8QFfzpA.js} +1 -1
- package/dist/web/assets/AboutSectionHeading-B5CzH4Zs.js +1 -0
- package/dist/web/assets/AboutSectionHeading-DjXpIV27.css +1 -0
- package/dist/web/assets/{AgentAppsPage-DY_TV5EE.js → AgentAppsPage-BYXraPFM.js} +1 -1
- package/dist/web/assets/{AgentHand-CTKH7yFY.js → AgentHand-BGGdVdd9.js} +1 -1
- package/dist/web/assets/AgentManagement-Bza8k5ra.js +7 -0
- package/dist/web/assets/AgentMentionCopy-C72hY2QL.js +1 -0
- package/dist/web/assets/{AgentName-DNxVHPb0.js → AgentName-CUjBNQ8j.js} +1 -1
- package/dist/web/assets/AgentProfilePage-kp7-gRRx.js +5 -0
- package/dist/web/assets/{AgentServicesPage-DEz1dnct.js → AgentServicesPage-IsGaz7FY.js} +1 -1
- package/dist/web/assets/{AppViewerPage-BMnN0lgj.js → AppViewerPage-CcOlwxck.js} +1 -1
- package/dist/web/assets/{BackToTop-BfdZE6xK.js → BackToTop-C3KYEoCW.js} +1 -1
- package/dist/web/assets/{BoardCardFieldsMenu-xjUzesvU.js → BoardCardFieldsMenu-BlBWT1j7.js} +1 -1
- package/dist/web/assets/{BoardMoveMenu-CCvochC4.js → BoardMoveMenu-Bc7xC1Uh.js} +1 -1
- package/dist/web/assets/{Breadcrumb-ys780J7e.js → Breadcrumb-C_xMiD-Z.js} +1 -1
- package/dist/web/assets/{CaptureChangePage-BY7KKPuU.js → CaptureChangePage-Bekp1aWg.js} +1 -1
- package/dist/web/assets/{ConnectionsPage-Cj-T0BH2.js → ConnectionsPage-BpvecWXD.js} +1 -1
- package/dist/web/assets/{CopyFixPrompt-ERDPz6w7.js → CopyFixPrompt-Bp-UX4Hq.js} +1 -1
- package/dist/web/assets/DataFormatPage-dsy8d3oA.js +2 -0
- package/dist/web/assets/DataFormatPage-sSnjjUY4.css +1 -0
- package/dist/web/assets/{DebugTurnPage-C6xOOTYf.js → DebugTurnPage-cIJV7xDW.js} +1 -1
- package/dist/web/assets/{DebugTurnsPage-uclemAXU.js → DebugTurnsPage-B6Te_Alp.js} +1 -1
- package/dist/web/assets/{DialogTitle-C86eI8Q_.js → DialogTitle-Lj5s6nwG.js} +1 -1
- package/dist/web/assets/{EmployeeRedirectPage-B5Sh-mOu.js → EmployeeRedirectPage-DnvwJeCN.js} +1 -1
- package/dist/web/assets/{EmployeeScopeDialog-DbEgouOr.js → EmployeeScopeDialog-CXNZ62Ab.js} +1 -1
- package/dist/web/assets/{EmployeeWorkbench-Cd0Yrv4Z.js → EmployeeWorkbench-DALIO-cM.js} +3 -3
- package/dist/web/assets/FieldRoot-DRnAC66O.js +1 -0
- package/dist/web/assets/{FlaGrowth-BS5MVg54.js → FlaGrowth-7wlv31Tl.js} +1 -1
- package/dist/web/assets/{FlaTaskSheets-IQ1HsEu5.js → FlaTaskSheets-CNdaBy1P.js} +1 -1
- package/dist/web/assets/{FlasPage-DsAcdiFS.js → FlasPage-BCs1Ffpf.js} +1 -1
- package/dist/web/assets/{GrowthLoading-BMf6Z2MU.js → GrowthLoading-Cr8xZwwO.js} +1 -1
- package/dist/web/assets/HowtoPage-Cv1YQy1s.js +1 -0
- package/dist/web/assets/{HowtoPage-BRV2W1Go.css → HowtoPage-t12tDDpS.css} +1 -1
- package/dist/web/assets/{InboxPage-DPV8n8FW.js → InboxPage-CgJnymOY.js} +1 -1
- package/dist/web/assets/{KnowledgeDeleteButton-Bo7gXmnS.js → KnowledgeDeleteButton-FEyEvhlR.js} +1 -1
- package/dist/web/assets/{KnowledgeHardDeleteSection-amJaLmkS.js → KnowledgeHardDeleteSection-CVwTeMEJ.js} +1 -1
- package/dist/web/assets/KnowledgeItemEditPage-rwpM8cF1.js +1 -0
- package/dist/web/assets/{KnowledgeItemSummaryCard-CjcKr6Xr.js → KnowledgeItemSummaryCard-49EADY_Z.js} +1 -1
- package/dist/web/assets/{KnowledgeOrganizerPage-CzXXBL9z.js → KnowledgeOrganizerPage-7IdnjM3L.js} +1 -1
- package/dist/web/assets/KnowledgePage-gxqOIZxf.js +1 -0
- package/dist/web/assets/KnowledgePeek-CQyCxHFj.js +1 -0
- package/dist/web/assets/{KnowledgeTurnReceiptPage-CbRSAOkW.js → KnowledgeTurnReceiptPage-BOz7IpaK.js} +1 -1
- package/dist/web/assets/{KnowledgeWorkspace-6C9dPHLk.js → KnowledgeWorkspace-A7zVb26p.js} +3 -3
- package/dist/web/assets/{MeAvatar-Ca5kjZR7.js → MeAvatar-CYVcRiuW.js} +1 -1
- package/dist/web/assets/{MeLink-CMsMg8E_.js → MeLink-BdqkzhT6.js} +1 -1
- package/dist/web/assets/{MenuSeparator-BlL75cLC.js → MenuSeparator-quqkZZXY.js} +1 -1
- package/dist/web/assets/ModelSettingsPage-B8jC_uew.js +3 -0
- package/dist/web/assets/ModelSettingsPage-DhCn_SF6.css +1 -0
- package/dist/web/assets/{NotFoundPage-j5qbgkxY.js → NotFoundPage-Dmn32VWo.js} +1 -1
- package/dist/web/assets/{OccupationsPage-DLIkdMDv.js → OccupationsPage-BVREfX_R.js} +1 -1
- package/dist/web/assets/{OverviewPage-BeExbgPK.js → OverviewPage-CHyEbdP4.js} +1 -1
- package/dist/web/assets/{PageColumns-C93sMwwH.js → PageColumns-DpfaPeu7.js} +1 -1
- package/dist/web/assets/{PageOutline-Dtu7R8Wo.js → PageOutline-BKBQ1T4d.js} +1 -1
- package/dist/web/assets/{PersonalProfilePage-CIeXNXqv.js → PersonalProfilePage-Cxp2gn6J.js} +1 -1
- package/dist/web/assets/PersonalProjectsPage-821imOxR.js +1 -0
- package/dist/web/assets/{PinIcon-Dp4Ubaw6.js → PinIcon-B7dvh7ld.js} +1 -1
- package/dist/web/assets/{PopperContent-D6WQ0NV4.js → PopperContent-DNqbLkNa.js} +1 -1
- package/dist/web/assets/{Presence-D-jzaDBV.js → Presence-D3HKb5Hb.js} +1 -1
- package/dist/web/assets/{ProfileAuthorChip-CpLzynWF.js → ProfileAuthorChip-7HSHODdR.js} +1 -1
- package/dist/web/assets/{ProjectAgentsPage-v-Wtq-2-.js → ProjectAgentsPage-DBsXS6Xa.js} +1 -1
- package/dist/web/assets/{ProjectJudgmentPolicy-DR8Rk_1K.js → ProjectJudgmentPolicy-GA33aSRi.js} +1 -1
- package/dist/web/assets/{PublicProjectsPage-QwAtKnu1.js → PublicProjectsPage-PJlBI8IE.js} +1 -1
- package/dist/web/assets/{RoundtablesPage-DLZdviOP.js → RoundtablesPage-DT5DUXsa.js} +1 -1
- package/dist/web/assets/{RovingFocusGroup-CmwaBpdi.js → RovingFocusGroup-BB0d3k17.js} +1 -1
- package/dist/web/assets/{RovingFocusItem-HhNodnJn.js → RovingFocusItem-CFd7tXzD.js} +1 -1
- package/dist/web/assets/{SessionMigrationPage-_W2BnsjS.js → SessionMigrationPage-BZ1lEDQr.js} +1 -1
- package/dist/web/assets/{SessionRecordsPage-CedaErNM.js → SessionRecordsPage-BMAAtIAt.js} +1 -1
- package/dist/web/assets/SettingsPage-BYNEk6BM.js +1 -0
- package/dist/web/assets/{SettingsPage-D85vqpZb.css → SettingsPage-Uj1IpZpS.css} +1 -1
- package/dist/web/assets/{SharedJefaReportPage-BkmmPYH1.js → SharedJefaReportPage-g35o6jUb.js} +1 -1
- package/dist/web/assets/{TagVocabularyPage-Bcd5fvzW.js → TagVocabularyPage-COubNJXz.js} +1 -1
- package/dist/web/assets/{TaskBlockerClear-Bln3zxga.js → TaskBlockerClear-B5MpHdlh.js} +1 -1
- package/dist/web/assets/{TaskBlockerNotice-Db1uAtT2.js → TaskBlockerNotice-CIN0HRiE.js} +1 -1
- package/dist/web/assets/{TaskReason-BgF2K1hA.js → TaskReason-LQ0CFiKu.js} +1 -1
- package/dist/web/assets/{TeamCard-B4J2jkm5.js → TeamCard-D-kLa5rT.js} +1 -1
- package/dist/web/assets/{TeamCardsWidget-CZTQVqyh.js → TeamCardsWidget-DGX9k0S6.js} +1 -1
- package/dist/web/assets/{TeamIsland-DXIQQ3bx.js → TeamIsland-BIo-l49b.js} +1 -1
- package/dist/web/assets/{Teleport-Dg_IoSZh.js → Teleport-C1upABpY.js} +1 -1
- package/dist/web/assets/{TextField-Y8DAIUw6.js → TextField-ZnmRqG0h.js} +1 -1
- package/dist/web/assets/{UiChip-vvwIQTGB.js → UiChip-CizeOu1Q.js} +1 -1
- package/dist/web/assets/UiDialog-CGTzxn3-.js +1 -0
- package/dist/web/assets/{UiDisclosure-Bp0vA9km.js → UiDisclosure-ueMA4jl0.js} +1 -1
- package/dist/web/assets/UiIcon-sD1hUsOF.js +1 -0
- package/dist/web/assets/{UiIconButton-EZ8ktpFH.js → UiIconButton-CCo4NPYv.js} +1 -1
- package/dist/web/assets/{UiNotice-DYZn5s6m.js → UiNotice-DGPFbVo7.js} +1 -1
- package/dist/web/assets/{UiSegmented-DX8WXXVn.js → UiSegmented-BZ-jqnPE.js} +1 -1
- package/dist/web/assets/{UiWeight-Ci6wZg1W.js → UiWeight-BRO3oVMZ.js} +1 -1
- package/dist/web/assets/{VirtualDirectoryList-XB8MT97E.js → VirtualDirectoryList-BkV3gj5E.js} +1 -1
- package/dist/web/assets/{VisuallyHidden-BLRDANy_.js → VisuallyHidden-B8wfJ_mU.js} +1 -1
- package/dist/web/assets/{VisuallyHiddenInput-D-GgOU3T.js → VisuallyHiddenInput-Bdcr9CwC.js} +1 -1
- package/dist/web/assets/WidgetSlot-DFojQaSo.js +2 -0
- package/dist/web/assets/_plugin-vue_export-helper-B9AJmZbc.js +9 -0
- package/dist/web/assets/{agent-apps-CQf2Eba8.js → agent-apps-CKGFfySp.js} +1 -1
- package/dist/web/assets/{agent-avatar-lPJyVS9O.js → agent-avatar-V6M_DF3r.js} +1 -1
- package/dist/web/assets/agent-occupation-PZ2YAIM8.js +1 -0
- package/dist/web/assets/{agent-pins-CoyKIkO2.js → agent-pins-8KX0ynzy.js} +1 -1
- package/dist/web/assets/{agent-workflows-CRdfc5xN.js → agent-workflows-DQlqVOoA.js} +1 -1
- package/dist/web/assets/{attach-closest-edge-BIyU46Kh.js → attach-closest-edge-D2qlayPy.js} +1 -1
- package/dist/web/assets/{attention-store-BrThOc88.js → attention-store-BnZ8l3kk.js} +1 -1
- package/dist/web/assets/{badge-mwWygmG4.js → badge-DX_xrLV6.js} +1 -1
- package/dist/web/assets/{button-byjQ5eLH.js → button-CEkPBC1E.js} +1 -1
- package/dist/web/assets/{card-Bo5Wyknz.js → card-DNQ0_6vT.js} +1 -1
- package/dist/web/assets/{catalog-CgoPKxd_.js → catalog-KnpBkv5t.js} +1 -1
- package/dist/web/assets/{checkbox-BB8_0W6A.js → checkbox-DPyLHneg.js} +1 -1
- package/dist/web/assets/{client-DmgW-kvA.js → client-CSQcWFRh.js} +1 -1
- package/dist/web/assets/{client-connection-model-CrDtN1yF.js → client-connection-model-vO2cap6a.js} +1 -1
- package/dist/web/assets/{client-links-store-B7VjTEfO.js → client-links-store-DMqe0MbK.js} +1 -1
- package/dist/web/assets/combobox-zUq9bkyM.js +1 -0
- package/dist/web/assets/{console-BB2sTsSs.js → console-DaoAO-EO.js} +1 -1
- package/dist/web/assets/{context-menu-DW29av0t.js → context-menu-CcGDnF_k.js} +1 -1
- package/dist/web/assets/{conversation-launcher-settings-DVd61o9s.js → conversation-launcher-settings-CXFE-q_A.js} +1 -1
- package/dist/web/assets/{dialog-CHAmruFj.js → dialog-CxhKMo0D.js} +1 -1
- package/dist/web/assets/{dist-Bz5tCO-_.js → dist-B9GqMC5C.js} +1 -1
- package/dist/web/assets/{dist-B9snV3GY.js → dist-DIJqkL4O.js} +1 -1
- package/dist/web/assets/dropdown-menu-CXmMnCBh.js +1 -0
- package/dist/web/assets/{field-ZZb3Sy9Y.js → field-LNsBZqam.js} +1 -1
- package/dist/web/assets/{format-bytes-DiEwa-ch.js → format-bytes-Bqefdt37.js} +1 -1
- package/dist/web/assets/{identity-4i_OR9WP.js → identity-DRfhWjty.js} +1 -1
- package/dist/web/assets/index-B4AMPpl_.css +1 -0
- package/dist/web/assets/index-BYIOAXnn.js +2 -0
- package/dist/web/assets/{input-BP9Wn4Yk.js → input-UoZ-0Xne.js} +1 -1
- package/dist/web/assets/{label-xRSp2rqO.js → label-DpjbTOxt.js} +1 -1
- package/dist/web/assets/label-table-BnWNYfyk.js +1 -0
- package/dist/web/assets/{model-CidDnNzT.js → model-13BQndfF.js} +1 -1
- package/dist/web/assets/{model-P1cRTtx9.js → model-B5g0CFcM.js} +1 -1
- package/dist/web/assets/{model-DiJvQFH-.js → model-BYKHVgJr.js} +1 -1
- package/dist/web/assets/{model-4BHOc7rR.js → model-CDevUwUw.js} +1 -1
- package/dist/web/assets/{model-DRrCt6Xz.js → model-CpuIG8Du.js} +1 -1
- package/dist/web/assets/{model-CxmTkWuw.js → model-P5fSGsiJ.js} +1 -1
- package/dist/web/assets/{model-6a2cm5q3.js → model-pJ6k3zYD.js} +1 -1
- package/dist/web/assets/{motion-eJ8Y9ulR.js → motion-C-ZimCUS.js} +1 -1
- package/dist/web/assets/{motion-TN6JdrrU.js → motion-QY5FKKko.js} +1 -1
- package/dist/web/assets/{motion-preference-CC0XwuGQ.js → motion-preference-BQiiwhab.js} +1 -1
- package/dist/web/assets/{occupation-catalog-C3Hj8p4a.js → occupation-catalog-uDDhZwKK.js} +1 -1
- package/dist/web/assets/{option-CdihAKf9.js → option-CcHPBOo6.js} +1 -1
- package/dist/web/assets/{page-title-CPUoKkyh.js → page-title-NXphgeQI.js} +1 -1
- package/dist/web/assets/{person-profile-Cmkd1uXt.js → person-profile-DXXfpvta.js} +1 -1
- package/dist/web/assets/popover-xSRzcSmY.js +1 -0
- package/dist/web/assets/popup-host-Bmvrf-2t.js +1 -0
- package/dist/web/assets/{profile-model-CmC9A3we.js → profile-model-6gTmScHC.js} +1 -1
- package/dist/web/assets/{project-board-layout-BPk55Azx.js → project-board-layout-DBQeP_QP.js} +1 -1
- package/dist/web/assets/{project-capture-zRbPkI54.js → project-capture-BhYsDWwJ.js} +1 -1
- package/dist/web/assets/{project-origin-BNl8Mqof.js → project-origin-D8jy8EF_.js} +1 -1
- package/dist/web/assets/{quick-edit-api-D6Xgntqh.js → quick-edit-api-WLh_88w6.js} +1 -1
- package/dist/web/assets/{radio-group-AkUGYCQ8.js → radio-group-B4r78nDh.js} +1 -1
- package/dist/web/assets/{role-names-BDswxugG.js → role-names-PECaMfQo.js} +1 -1
- package/dist/web/assets/{roundtable-live-C1wc_F30.js → roundtable-live-DFeDF56c.js} +1 -1
- package/dist/web/assets/{runtime-dom.esm-bundler-CjD1s0uc.js → runtime-dom.esm-bundler-f39i44Mt.js} +1 -1
- package/dist/web/assets/select-_JO3Mxdp.js +1 -0
- package/dist/web/assets/{session-launch-offers-2SxrTwBr.js → session-launch-offers-X9b0DwF1.js} +1 -1
- package/dist/web/assets/{settings-restart-fHB-lEm8.js → settings-restart-BnwcTv3i.js} +1 -1
- package/dist/web/assets/shared-report-BxNVLalR.js +3 -0
- package/dist/web/assets/{source-adapters-TLaUKVEM.js → source-adapters-aupsL146.js} +1 -1
- package/dist/web/assets/{switch-Cq1rT1Ti.js → switch-B3Y3oE_n.js} +1 -1
- package/dist/web/assets/{tabs-B8ccOT5z.js → tabs-BlcZiEMY.js} +1 -1
- package/dist/web/assets/{task-card-fields-BkwTMtq6.js → task-card-fields-DAx6zMLz.js} +1 -1
- package/dist/web/assets/{task-labels-CVomryt6.js → task-labels-BdDFvSAy.js} +1 -1
- package/dist/web/assets/{task-reason-BenU3Ly4.js → task-reason-7WnPreht.js} +1 -1
- package/dist/web/assets/{team-sheets-BIFVatFG.js → team-sheets-Cr0ZTPw3.js} +1 -1
- package/dist/web/assets/{textarea-CEokSlpT.js → textarea-CRzFqL9a.js} +1 -1
- package/dist/web/assets/{ui-Pf0_u3Mo.js → ui-BopQuQfc.js} +1 -1
- package/dist/web/assets/{useAgentRecords-B0ODDGeO.js → useAgentRecords-CMtpd3Fj.js} +1 -1
- package/dist/web/assets/{useAgentWorkSummary-CNoUxwOW.js → useAgentWorkSummary-BQbhaHov.js} +1 -1
- package/dist/web/assets/{useApi-CROJJdhE-CbQwoO_u.js → useApi-CROJJdhE-CRCgNOqq.js} +1 -1
- package/dist/web/assets/{useClipboardCopy-Dd9bf8dt.js → useClipboardCopy-DkqKK3wY.js} +1 -1
- package/dist/web/assets/{useFocusReturn-DFHFciMS.js → useFocusReturn-BZpVmQnM.js} +1 -1
- package/dist/web/assets/{useForwardExpose-D3bCxDJx.js → useForwardExpose-Di-MnbTz.js} +1 -1
- package/dist/web/assets/{useForwardPropsEmits-CshHUE63.js → useForwardPropsEmits-L9XcB5DG.js} +1 -1
- package/dist/web/assets/useForwardScopeId-CUQFIAIj.js +1 -0
- package/dist/web/assets/{useKnowledgeItemPeek-24H5cZzL.js → useKnowledgeItemPeek-PmQJixw5.js} +1 -1
- package/dist/web/assets/{useMinimumLoadingDisplay-Br2MBA-0.js → useMinimumLoadingDisplay-CWPiOaDl.js} +1 -1
- package/dist/web/assets/{useProjectAgentRoster-BLHF34Hj.js → useProjectAgentRoster-CWVpSsQ3.js} +1 -1
- package/dist/web/assets/{useRoutePeek-KvY9hOQI.js → useRoutePeek-DxLVksbJ.js} +1 -1
- package/dist/web/assets/useTeamPeople-CDISP0PM.js +1 -0
- package/dist/web/assets/{useTeamWork-wKGBRcNv.js → useTeamWork-BTZd_wKs.js} +1 -1
- package/dist/web/assets/{useTypeahead-C50w2tTI.js → useTypeahead-pEZNpBls.js} +1 -1
- package/dist/web/assets/{utils-_mWlJRpS.js → utils-B4pBTmyh.js} +1 -1
- package/dist/web/assets/{utils-CArDYAhe.js → utils-BsxOjD1Q.js} +1 -1
- package/dist/web/assets/version-db3QWWjt.js +1 -0
- package/dist/web/assets/{vue-router-BzQKabzW.js → vue-router-B79HWW1l.js} +1 -1
- package/dist/web/assets/website-YgovUEcN.js +1 -0
- package/dist/web/index.html +65 -64
- package/docs/client-connections.md +3 -2
- package/docs/employee-agents.md +1 -1
- package/docs/judgment-and-autonomy.md +2 -2
- package/graph-provider/fuli_graph/app.py +4 -0
- package/graph-provider/fuli_graph/graph_field_contract.py +10 -2
- package/graph-provider/fuli_graph/graph_format_migrations.py +10 -0
- package/graph-provider/fuli_graph/knowledge_index_scan.py +120 -0
- package/graph-provider/fuli_graph/knowledge_retrieval_models.py +95 -0
- package/graph-provider/fuli_graph/knowledge_retrieval_terms.py +116 -0
- package/graph-provider/fuli_graph/knowledge_search.py +191 -31
- package/graph-provider/fuli_graph/knowledge_semantic.py +87 -0
- package/graph-provider/fuli_graph/knowledge_semantic_index.py +98 -0
- package/graph-provider/fuli_graph/knowledge_semantic_models.py +72 -0
- package/graph-provider/fuli_graph/knowledge_semantic_query.py +19 -0
- package/graph-provider/fuli_graph/models.py +4 -0
- package/graph-provider/fuli_graph/task_context_routes.py +1 -1
- package/graph-provider/pyproject.toml +1 -1
- package/native/win32/fuli-win-helper.exe +0 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/skills/capturing-session-knowledge/SKILL.md +9 -5
- package/skills/capturing-session-knowledge/references/retrieval.md +2 -0
- package/skills/operating-fuli/SKILL.md +5 -1
- package/skills/operating-fuli/references/workflow-recipes.md +1 -1
- package/src/agent-kits/client-detection.js +7 -0
- package/src/agent-kits/client-installer.js +13 -0
- package/src/agent-tools/interface-catalog.js +6 -0
- package/src/agent-tools/model-backend-definitions.js +1 -1
- package/src/agents/claude-code/lifecycle-hook.js +1 -1
- package/src/agents/claude-code/transcript-format-probe.js +31 -0
- package/src/agents/codex/lifecycle-hook.js +1 -1
- package/src/agents/codex/transcript-format-probe.js +29 -0
- package/src/agents/transcript-format-registry.js +34 -0
- package/src/agents/transcript-format-scan.js +71 -0
- package/src/conversations/preference-lifecycle.js +2 -1
- package/src/conversations/reply-citations.js +21 -0
- package/src/conversations/stop-auto-close.js +21 -9
- package/src/dreaming/run.js +310 -0
- package/src/dreaming/scheduler.js +58 -0
- package/src/graphiti/current-project-knowledge-search.js +24 -1
- package/src/graphiti/federated-search.js +8 -1
- package/src/graphiti/provider-client.js +36 -0
- package/src/graphiti/task-entry-preferences.js +15 -2
- package/src/graphiti/task-entry-read-only.js +28 -0
- package/src/graphiti/task-knowledge-recall.js +19 -5
- package/src/http/api-router.js +11 -1
- package/src/http/dreaming-api-router.js +32 -0
- package/src/http/knowledge-item-api-router.js +7 -0
- package/src/http/retrieval-terms-api-router.js +37 -0
- package/src/http/semantic-api-router.js +26 -0
- package/src/local-runtime/lifecycle.js +3 -0
- package/src/local-runtime/windows-process-handle.js +9 -3
- package/src/mcp/process-registry.js +45 -3
- package/src/mcp/runtime.js +2 -1
- package/src/mcp/stdio-relay.js +4 -1
- package/src/model-backends/adapters/anthropic-messages.js +1 -1
- package/src/model-backends/adapters/exchange.js +2 -2
- package/src/model-backends/adapters/openai-chat.js +1 -1
- package/src/model-backends/adapters/openai-embeddings.js +60 -0
- package/src/model-backends/adapters/registry.js +3 -1
- package/src/model-backends/adapters/typesafe-systemone.js +1 -1
- package/src/model-backends/budget.js +14 -8
- package/src/model-backends/config.js +49 -15
- package/src/model-backends/decision-contract.js +2 -1
- package/src/model-backends/http.js +19 -1
- package/src/model-backends/model-fetch.js +37 -0
- package/src/model-backends/port.js +165 -67
- package/src/model-backends/prompt.js +4 -3
- package/src/model-backends/request.js +42 -3
- package/src/presence/windows-helper-pin.js +1 -1
- package/src/retrieval-terms/fill.js +102 -0
- package/src/retrieval-terms/runner.js +50 -0
- package/src/retrieval-terms/terms-model.js +99 -0
- package/src/semantic/scheduler.js +50 -0
- package/src/semantic/semantic-index.js +94 -0
- package/src/server.js +16 -1
- package/src/system/client-connection-status.js +6 -4
- package/src/system/doctor.js +62 -3
- package/src/system/mcp-process-scan.js +55 -0
- package/src/system/system-service.js +23 -5
- package/dist/web/assets/AboutSectionHeading-CiD3M3eG.css +0 -1
- package/dist/web/assets/AboutSectionHeading-w5P9g9WB.js +0 -1
- package/dist/web/assets/AgentManagement-VWpTW_38.js +0 -7
- package/dist/web/assets/AgentMentionCopy-DI23ym95.js +0 -1
- package/dist/web/assets/AgentProfilePage-DrqWGjqt.js +0 -5
- package/dist/web/assets/DataFormatPage-0Ne27K6I.css +0 -1
- package/dist/web/assets/DataFormatPage-D39VmkWL.js +0 -2
- package/dist/web/assets/FieldRoot-BZby7Lhw.js +0 -1
- package/dist/web/assets/HowtoPage-CKJAtKbM.js +0 -1
- package/dist/web/assets/KnowledgeItemEditPage-n0jtTdHB.js +0 -1
- package/dist/web/assets/KnowledgePage-CZ9oDt3D.js +0 -1
- package/dist/web/assets/KnowledgePeek-J6gHDda8.js +0 -1
- package/dist/web/assets/ModelSettingsPage-BwUnvtP6.js +0 -1
- package/dist/web/assets/ModelSettingsPage-ConWy_ec.css +0 -1
- package/dist/web/assets/PersonalProjectsPage-DM70jshg.js +0 -1
- package/dist/web/assets/SettingsPage-aRxdnfBu.js +0 -1
- package/dist/web/assets/UiDialog-Cbb3AvXb.js +0 -1
- package/dist/web/assets/UiIcon-o5x6Sf-c.js +0 -1
- package/dist/web/assets/WidgetSlot-URHq8Let.js +0 -2
- package/dist/web/assets/_plugin-vue_export-helper-PxAQThRD.js +0 -9
- package/dist/web/assets/agent-occupation-DM6nIHrD.js +0 -1
- package/dist/web/assets/combobox-BOXLFvvr.js +0 -1
- package/dist/web/assets/dropdown-menu-C0AuLdFm.js +0 -1
- package/dist/web/assets/index-CSV9nk7P.js +0 -2
- package/dist/web/assets/index-DFt6UfTv.css +0 -1
- package/dist/web/assets/label-table-BUAeArKh.js +0 -1
- package/dist/web/assets/popover-DyX7FE_t.js +0 -1
- package/dist/web/assets/select-CuhUd9VL.js +0 -1
- package/dist/web/assets/shared-report-BKhY4rtE.js +0 -3
- package/dist/web/assets/useForwardScopeId-Bzm9IM9h.js +0 -1
- package/dist/web/assets/useTeamPeople-IATXewrX.js +0 -1
- package/dist/web/assets/version-Cw272WBv.js +0 -1
|
@@ -21,11 +21,14 @@ from .search_projection import (
|
|
|
21
21
|
read_edge_epistemic_metadata,
|
|
22
22
|
source_uris_from_references,
|
|
23
23
|
)
|
|
24
|
+
from .knowledge_semantic import fused_ranking, meaning_matches, usable_vector
|
|
24
25
|
from .knowledge_weight import knowledge_weight, ranking_weight
|
|
25
26
|
from .knowledge_tag_ranking import TagRanking
|
|
26
27
|
from .knowledge_visibility import AgentReader, fla_endpoints_visible_cypher, fla_visible, reader_parameter
|
|
27
28
|
|
|
28
29
|
MIN_TERM_COVERAGE = 0.25
|
|
30
|
+
# How many items with a vector of the query's model one search compares (rec#88).
|
|
31
|
+
SEMANTIC_CANDIDATE_LIMIT = 5000
|
|
29
32
|
# A preference key's separators, so `reply-language` is also the words "reply language".
|
|
30
33
|
_KEY_SEPARATORS = re.compile(r'[-_.:/]+')
|
|
31
34
|
LATIN_QUERY_FILLERS = {
|
|
@@ -51,6 +54,14 @@ async def search_knowledge(store, actor: dict, request: SearchRequest, *, tag_ex
|
|
|
51
54
|
group_ids=group_ids,
|
|
52
55
|
num_results=min(max(request.limit * 8, 40), 100),
|
|
53
56
|
)
|
|
57
|
+
# Relationships found only by their retrieval terms join the lexical ones (rec#92).
|
|
58
|
+
edge_terms, term_edges = await _term_edge_candidates(store, personal_space, request)
|
|
59
|
+
found = {edge.uuid for edge in edges}
|
|
60
|
+
edges = [*edges, *(edge for edge in term_edges if edge.uuid not in found)]
|
|
61
|
+
lexical_ids = {edge.uuid for edge in edges}
|
|
62
|
+
# Relationships found by meaning pass the very same filters below.
|
|
63
|
+
meaning_vectors, meaning_edges = await _semantic_edge_candidates(store, personal_space, request)
|
|
64
|
+
edges = [*edges, *(edge for edge in meaning_edges if edge.uuid not in lexical_ids)]
|
|
54
65
|
if not request.include_historical:
|
|
55
66
|
edges = [edge for edge in edges if edge.invalid_at is None]
|
|
56
67
|
project_scopes = {}
|
|
@@ -85,6 +96,8 @@ async def search_knowledge(store, actor: dict, request: SearchRequest, *, tag_ex
|
|
|
85
96
|
]
|
|
86
97
|
names = await _entity_names(store, edges)
|
|
87
98
|
tag_ranking = await TagRanking.for_search(store, personal_space, request, project_scopes)
|
|
99
|
+
in_scope_vectors = {edge.uuid: meaning_vectors[edge.uuid] for edge in edges if edge.uuid in meaning_vectors}
|
|
100
|
+
edges = [edge for edge in edges if edge.uuid in lexical_ids]
|
|
88
101
|
ranked_edges = sorted(
|
|
89
102
|
(
|
|
90
103
|
(
|
|
@@ -95,6 +108,7 @@ async def search_knowledge(store, actor: dict, request: SearchRequest, *, tag_ex
|
|
|
95
108
|
names,
|
|
96
109
|
position,
|
|
97
110
|
len(edges),
|
|
111
|
+
edge_terms.get(edge.uuid),
|
|
98
112
|
),
|
|
99
113
|
epistemic.get(edge.uuid, {}),
|
|
100
114
|
),
|
|
@@ -106,6 +120,10 @@ async def search_knowledge(store, actor: dict, request: SearchRequest, *, tag_ex
|
|
|
106
120
|
reverse=True,
|
|
107
121
|
)
|
|
108
122
|
ranked_edges = [item for item in ranked_edges if item[0] > 0]
|
|
123
|
+
meaning_edges = {edge.uuid: edge for edge in meaning_edges}
|
|
124
|
+
ranked_edges, edge_matches = _fused_with_meaning(
|
|
125
|
+
ranked_edges, [meaning_edges[edge_id] for edge_id in _meaning_order(request, in_scope_vectors)],
|
|
126
|
+
lambda edge: edge.uuid)
|
|
109
127
|
if personal_space:
|
|
110
128
|
ranked_edges = _dedupe_ranked_edges(
|
|
111
129
|
ranked_edges,
|
|
@@ -135,7 +153,7 @@ async def search_knowledge(store, actor: dict, request: SearchRequest, *, tag_ex
|
|
|
135
153
|
space_ids_by_group[edge.group_id],
|
|
136
154
|
epistemic.get(edge.uuid, {}),
|
|
137
155
|
).model_copy(
|
|
138
|
-
update={'score': score}
|
|
156
|
+
update={'score': score, 'matched_by': edge_matches.get(edge.uuid, 'lexical')}
|
|
139
157
|
)
|
|
140
158
|
for score, edge in ranked_edges
|
|
141
159
|
],
|
|
@@ -355,9 +373,48 @@ async def _personal_entities(
|
|
|
355
373
|
) -> list[EntitySearchResult]:
|
|
356
374
|
if not project_scopes and not request.include_personal_global:
|
|
357
375
|
return []
|
|
376
|
+
scoped_records = await _scoped_entity_records(store, space, request, project_scopes)
|
|
377
|
+
ranked = sorted(
|
|
378
|
+
(
|
|
379
|
+
(
|
|
380
|
+
record,
|
|
381
|
+
_ranked_relevance(
|
|
382
|
+
_relevance(request.query, record),
|
|
383
|
+
record,
|
|
384
|
+
),
|
|
385
|
+
)
|
|
386
|
+
for record in scoped_records
|
|
387
|
+
),
|
|
388
|
+
key=lambda item: (item[1], _tie_weight(item[0]), _timestamp(item[0].get('created_at'))),
|
|
389
|
+
reverse=True,
|
|
390
|
+
)
|
|
391
|
+
ranked = [item for item in ranked if item[1] > 0]
|
|
392
|
+
meaning = await _semantic_entities(store, space, request, project_scopes)
|
|
393
|
+
fused, entity_matches = _fused_with_meaning(
|
|
394
|
+
[(score, record) for record, score in ranked], meaning, lambda record: record['id'])
|
|
395
|
+
ranked = _dedupe_ranked_entities(
|
|
396
|
+
[(record, score) for score, record in fused],
|
|
397
|
+
request.active_personal_project_id,
|
|
398
|
+
request.project_agent_id,
|
|
399
|
+
)
|
|
400
|
+
ranked = [(record, score) for _, score, record in await (tag_ranking or TagRanking()).rerank(
|
|
401
|
+
[(record['id'], score, record) for record, score in ranked], 'entity', tag_explanations
|
|
402
|
+
)][: request.limit]
|
|
403
|
+
return [
|
|
404
|
+
_entity_search_result(record, score, space['id'], entity_matches.get(record['id'], 'lexical'))
|
|
405
|
+
for record, score in ranked
|
|
406
|
+
]
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
async def _scoped_entity_records(store, space, request: SearchRequest, project_scopes: dict[str, dict],
|
|
410
|
+
*, semantic_model: str | None = None) -> list[dict]:
|
|
411
|
+
"""The entities this search may return, with their scope. With a
|
|
412
|
+
semantic_model, only those carrying a vector of that model, and the
|
|
413
|
+
vector: the same filters decide either way (rec#88)."""
|
|
358
414
|
records, _, _ = await store.runtime.driver.execute_query(
|
|
359
415
|
'''
|
|
360
416
|
MATCH (node:Entity {group_id: $group_id})
|
|
417
|
+
WHERE $semantic_model IS NULL OR node.fuli_semantic_model = $semantic_model
|
|
361
418
|
OPTIONAL MATCH (episode:Episodic {group_id: $group_id})-[:MENTIONS]->(node)
|
|
362
419
|
WITH node, collect(DISTINCT episode) AS episodes
|
|
363
420
|
OPTIONAL MATCH (assignment:FuliKnowledgeAssignment {
|
|
@@ -442,6 +499,12 @@ async def _personal_entities(
|
|
|
442
499
|
AS requires_attention,
|
|
443
500
|
node.fuli_last_feedback_kind AS last_feedback_kind,
|
|
444
501
|
node.fuli_last_feedback_at AS last_feedback_at,
|
|
502
|
+
node.fuli_retrieval_terms AS retrieval_terms,
|
|
503
|
+
node.fuli_retrieval_context AS retrieval_context,
|
|
504
|
+
CASE WHEN $semantic_model IS NOT NULL THEN node.fuli_semantic_vector END
|
|
505
|
+
AS semantic_vector,
|
|
506
|
+
CASE WHEN $semantic_model IS NOT NULL THEN node.fuli_semantic_hash END
|
|
507
|
+
AS semantic_hash,
|
|
445
508
|
[episode IN episodes | episode.uuid] AS evidence_ids,
|
|
446
509
|
[episode IN episodes
|
|
447
510
|
WHERE episode.fuli_source_uri IS NOT NULL |
|
|
@@ -458,7 +521,8 @@ async def _personal_entities(
|
|
|
458
521
|
project_ids=list(project_scopes),
|
|
459
522
|
include_historical=request.include_historical,
|
|
460
523
|
include_pending=request.include_pending,
|
|
461
|
-
|
|
524
|
+
semantic_model=semantic_model,
|
|
525
|
+
candidate_limit=SEMANTIC_CANDIDATE_LIMIT if semantic_model else store.settings.graph_limit,
|
|
462
526
|
routing_='r',
|
|
463
527
|
)
|
|
464
528
|
scoped_records = []
|
|
@@ -484,33 +548,119 @@ async def _personal_entities(
|
|
|
484
548
|
)
|
|
485
549
|
if scope is not None:
|
|
486
550
|
scoped_records.append({**record, **scope})
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
551
|
+
return scoped_records
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
async def _semantic_entities(store, space, request: SearchRequest, project_scopes: dict[str, dict]) -> list[dict]:
|
|
555
|
+
"""The in-scope entities that stand out for the query's meaning, best first."""
|
|
556
|
+
if request.semantic is None:
|
|
557
|
+
return []
|
|
558
|
+
records = await _scoped_entity_records(store, space, request, project_scopes,
|
|
559
|
+
semantic_model=request.semantic.model)
|
|
560
|
+
length = len(request.semantic.vector)
|
|
561
|
+
by_id, vectors = {}, {}
|
|
562
|
+
for record in records:
|
|
563
|
+
vector = usable_vector('entity', record, length)
|
|
564
|
+
if vector is not None:
|
|
565
|
+
by_id[record['id']], vectors[record['id']] = record, vector
|
|
566
|
+
return [by_id[item_id] for item_id in _meaning_order(request, vectors)]
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
async def _semantic_edge_candidates(store, space, request: SearchRequest) -> tuple[dict, list[EntityEdge]]:
|
|
570
|
+
"""Every relationship of the personal space with a usable vector of the
|
|
571
|
+
query's model, as candidates for the search's own filters (rec#88)."""
|
|
572
|
+
if request.semantic is None or space is None:
|
|
573
|
+
return {}, []
|
|
574
|
+
length = len(request.semantic.vector)
|
|
575
|
+
records, _, _ = await store.runtime.driver.execute_query(
|
|
576
|
+
'''
|
|
577
|
+
MATCH (source:Entity)-[edge:RELATES_TO {group_id: $group_id}]->(target:Entity)
|
|
578
|
+
WHERE edge.fuli_semantic_model = $semantic_model
|
|
579
|
+
AND size(edge.fuli_semantic_vector) = $length
|
|
580
|
+
RETURN edge.uuid AS uuid, source.uuid AS source_node_uuid, target.uuid AS target_node_uuid,
|
|
581
|
+
edge.group_id AS group_id, edge.name AS name, edge.fact AS fact,
|
|
582
|
+
coalesce(edge.episodes, []) AS episodes, edge.created_at AS created_at,
|
|
583
|
+
edge.valid_at AS valid_at, edge.invalid_at AS invalid_at, edge.expired_at AS expired_at,
|
|
584
|
+
edge.fuli_semantic_vector AS semantic_vector, edge.fuli_semantic_hash AS semantic_hash,
|
|
585
|
+
edge.fuli_retrieval_terms AS retrieval_terms, edge.fuli_retrieval_context AS retrieval_context
|
|
586
|
+
ORDER BY edge.uuid
|
|
587
|
+
LIMIT $candidate_limit
|
|
588
|
+
''',
|
|
589
|
+
group_id=space['group_id'],
|
|
590
|
+
semantic_model=request.semantic.model,
|
|
591
|
+
length=length,
|
|
592
|
+
candidate_limit=SEMANTIC_CANDIDATE_LIMIT,
|
|
593
|
+
routing_='r',
|
|
500
594
|
)
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
595
|
+
vectors, edges = {}, []
|
|
596
|
+
for record in records:
|
|
597
|
+
vector = usable_vector('relationship', record, length)
|
|
598
|
+
if vector is None:
|
|
599
|
+
continue
|
|
600
|
+
vectors[record['uuid']] = vector
|
|
601
|
+
edges.append(_edge_from_record(record))
|
|
602
|
+
return vectors, edges
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
async def _term_edge_candidates(store, space, request: SearchRequest) -> tuple[dict, list[EntityEdge]]:
|
|
606
|
+
"""The retrieval terms of the personal space's relationships, by id, and
|
|
607
|
+
the relationships the query finds through them, as candidates for the
|
|
608
|
+
search's own filters (rec#92). Word search over facts alone never sees
|
|
609
|
+
terms stored beside them."""
|
|
610
|
+
if space is None:
|
|
611
|
+
return {}, []
|
|
612
|
+
records, _, _ = await store.runtime.driver.execute_query(
|
|
613
|
+
'''
|
|
614
|
+
MATCH (source:Entity)-[edge:RELATES_TO {group_id: $group_id}]->(target:Entity)
|
|
615
|
+
WHERE edge.fuli_retrieval_terms IS NOT NULL
|
|
616
|
+
RETURN edge.uuid AS uuid, source.uuid AS source_node_uuid, target.uuid AS target_node_uuid,
|
|
617
|
+
edge.group_id AS group_id, edge.name AS name, edge.fact AS fact,
|
|
618
|
+
coalesce(edge.episodes, []) AS episodes, edge.created_at AS created_at,
|
|
619
|
+
edge.valid_at AS valid_at, edge.invalid_at AS invalid_at, edge.expired_at AS expired_at,
|
|
620
|
+
edge.fuli_retrieval_terms AS retrieval_terms, edge.fuli_retrieval_context AS retrieval_context
|
|
621
|
+
ORDER BY edge.uuid
|
|
622
|
+
LIMIT $candidate_limit
|
|
623
|
+
''',
|
|
624
|
+
group_id=space['group_id'],
|
|
625
|
+
candidate_limit=SEMANTIC_CANDIDATE_LIMIT,
|
|
626
|
+
routing_='r',
|
|
506
627
|
)
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
)
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
628
|
+
terms = {record['uuid']: {'retrieval_terms': record['retrieval_terms'],
|
|
629
|
+
'retrieval_context': record['retrieval_context']} for record in records}
|
|
630
|
+
found = [_edge_from_record(record) for record in records
|
|
631
|
+
if _relevance(request.query, {'summary': record['fact'], **terms[record['uuid']]}) > 0]
|
|
632
|
+
return terms, found
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
def _edge_from_record(record) -> EntityEdge:
|
|
636
|
+
return EntityEdge(
|
|
637
|
+
uuid=record['uuid'], source_node_uuid=record['source_node_uuid'],
|
|
638
|
+
target_node_uuid=record['target_node_uuid'], group_id=record['group_id'],
|
|
639
|
+
name=record['name'] or '', fact=record['fact'] or '', episodes=list(record['episodes']),
|
|
640
|
+
created_at=_native_datetime(record['created_at']), valid_at=_native_datetime(record['valid_at']),
|
|
641
|
+
invalid_at=_native_datetime(record['invalid_at']), expired_at=_native_datetime(record['expired_at']),
|
|
642
|
+
)
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
def _meaning_order(request: SearchRequest, vectors: dict) -> list[str]:
|
|
646
|
+
if request.semantic is None:
|
|
647
|
+
return []
|
|
648
|
+
return list(meaning_matches(vectors, request.semantic.vector, request.limit))
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
def _fused_with_meaning(lexical, meaning, item_id):
|
|
652
|
+
"""lexical: [(score, payload)] in its ranked order; meaning: [payload] best
|
|
653
|
+
first. Without meaning the lexical result stands as it is. Otherwise every
|
|
654
|
+
item's score is its reciprocal rank fusion value; an item found only by
|
|
655
|
+
meaning never met the term-coverage cut. Returns the ranked
|
|
656
|
+
[(score, payload)] and {item id: matched_by}."""
|
|
657
|
+
if not meaning:
|
|
658
|
+
return lexical, {}
|
|
659
|
+
fused = fused_ranking([item_id(payload) for _, payload in lexical], [item_id(payload) for payload in meaning])
|
|
660
|
+
payloads = {item_id(payload): payload for payload in meaning}
|
|
661
|
+
payloads.update({item_id(payload): payload for _, payload in lexical})
|
|
662
|
+
ranked = sorted(((fused[key][0], payloads[key]) for key in fused), key=lambda item: -item[0])
|
|
663
|
+
return ranked, {key: matched_by for key, (_, matched_by) in fused.items()}
|
|
514
664
|
|
|
515
665
|
|
|
516
666
|
def _item_scope_metadata(
|
|
@@ -720,7 +870,7 @@ def _tie_weight(metadata) -> float:
|
|
|
720
870
|
return ranking_weight(metadata, evidence_ids=metadata.get('evidence_ids') or [])
|
|
721
871
|
|
|
722
872
|
|
|
723
|
-
def _entity_search_result(record, score: float, space_id: str) -> EntitySearchResult:
|
|
873
|
+
def _entity_search_result(record, score: float, space_id: str, matched_by: str = 'lexical') -> EntitySearchResult:
|
|
724
874
|
value = dict(record)
|
|
725
875
|
value.update(knowledge_weight(record, evidence_ids=value.pop('evidence_ids', [])))
|
|
726
876
|
attributes = json_object(value.get('attributes_json'))
|
|
@@ -752,6 +902,10 @@ def _entity_search_result(record, score: float, space_id: str) -> EntitySearchRe
|
|
|
752
902
|
'has_global_episode',
|
|
753
903
|
'reference_project_ids',
|
|
754
904
|
'inherited',
|
|
905
|
+
'semantic_vector',
|
|
906
|
+
'semantic_hash',
|
|
907
|
+
'retrieval_terms',
|
|
908
|
+
'retrieval_context',
|
|
755
909
|
):
|
|
756
910
|
value.pop(field, None)
|
|
757
911
|
return EntitySearchResult(
|
|
@@ -769,6 +923,7 @@ def _entity_search_result(record, score: float, space_id: str) -> EntitySearchRe
|
|
|
769
923
|
),
|
|
770
924
|
source_uris=source_uris_from_references(source_references),
|
|
771
925
|
score=score,
|
|
926
|
+
matched_by=matched_by,
|
|
772
927
|
)
|
|
773
928
|
|
|
774
929
|
|
|
@@ -792,7 +947,7 @@ def _relevance(query: str, record) -> float:
|
|
|
792
947
|
needle = _normalized(query)
|
|
793
948
|
haystack = _normalized(' '.join(filter(None, [
|
|
794
949
|
record.get('name'), record.get('type'), record.get('summary'),
|
|
795
|
-
record.get('reasoning_summary'), record.get('profile_aspect'),
|
|
950
|
+
record.get('reasoning_summary'), record.get('profile_aspect'), record.get('retrieval_context'),
|
|
796
951
|
])))
|
|
797
952
|
if not needle:
|
|
798
953
|
return 0.0
|
|
@@ -809,8 +964,10 @@ def _relevance(query: str, record) -> float:
|
|
|
809
964
|
return round(score, 4)
|
|
810
965
|
|
|
811
966
|
|
|
812
|
-
def _edge_relevance(query: str, edge, names: dict[str, str], position: int, total: int
|
|
967
|
+
def _edge_relevance(query: str, edge, names: dict[str, str], position: int, total: int,
|
|
968
|
+
retrieval: dict | None = None) -> float:
|
|
813
969
|
lexical = _relevance(query, {
|
|
970
|
+
**(retrieval or {}),
|
|
814
971
|
'name': edge.name,
|
|
815
972
|
'type': 'Relationship',
|
|
816
973
|
'summary': ' '.join(filter(None, [
|
|
@@ -874,9 +1031,12 @@ def _retrieval_aliases(record) -> list[str]:
|
|
|
874
1031
|
values = [values]
|
|
875
1032
|
if not isinstance(values, list):
|
|
876
1033
|
return []
|
|
1034
|
+
# Terms stored beside the item later count like those it was saved with (rec#92).
|
|
1035
|
+
stored = record.get('retrieval_terms')
|
|
1036
|
+
values = [*values, *(stored if isinstance(stored, list) else [])]
|
|
877
1037
|
aliases = [
|
|
878
1038
|
value.strip()
|
|
879
|
-
for value in values[:
|
|
1039
|
+
for value in values[:64]
|
|
880
1040
|
if isinstance(value, str) and 0 < len(value.strip()) <= 256
|
|
881
1041
|
]
|
|
882
1042
|
# A preference is found by its key, as written and as words (rec#75).
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"""Search by meaning (rec#88): the text a vector stands for, whether a stored
|
|
2
|
+
vector still fits, the relevance floor and the fusion with the lexical result.
|
|
3
|
+
|
|
4
|
+
FULI ships no embedding model. Node computes vectors with a model a person
|
|
5
|
+
connected and stores them through knowledge_semantic_index; a query brings its
|
|
6
|
+
own vector. A stored vector counts only for its model, at the query's length,
|
|
7
|
+
while its hash is still the sha256 of the item's text: an edit or a version
|
|
8
|
+
copy that changed the text leaves it pending, never stale.
|
|
9
|
+
"""
|
|
10
|
+
import math
|
|
11
|
+
from statistics import fmean, pstdev
|
|
12
|
+
|
|
13
|
+
from .provider_values import sha256_text
|
|
14
|
+
|
|
15
|
+
# Reciprocal rank fusion constant (Cormack et al.).
|
|
16
|
+
RRF_K = 60
|
|
17
|
+
# Under this many in-scope items with a vector the floor means nothing.
|
|
18
|
+
MIN_IN_SCOPE_ITEMS = 12
|
|
19
|
+
# Kept: a cosine at least this many standard deviations above the mean of
|
|
20
|
+
# every in-scope item for this query. No model-specific number is needed.
|
|
21
|
+
FLOOR_STANDARD_DEVIATIONS = 3
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def item_text(item_kind: str, record: dict) -> str:
|
|
25
|
+
"""The item's own words: an entity's name and summary, a relationship's fact."""
|
|
26
|
+
if item_kind == 'entity':
|
|
27
|
+
return '\n'.join(part for part in (record.get('name'), record.get('summary')) if part)
|
|
28
|
+
return record.get('fact') or ''
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def semantic_text(item_kind: str, record: dict) -> str:
|
|
32
|
+
"""The text embedded: the item's own words, then the retrieval context and
|
|
33
|
+
terms stored beside it, when there are any (rec#92)."""
|
|
34
|
+
terms = ' · '.join(record.get('retrieval_terms') or [])
|
|
35
|
+
return '\n'.join(part for part in (item_text(item_kind, record), record.get('retrieval_context'), terms) if part)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def semantic_hash(text: str) -> str:
|
|
39
|
+
return sha256_text(text)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def usable_vector(item_kind: str, record: dict, length: int) -> list[float] | None:
|
|
43
|
+
"""The record's stored vector (already read for the query's model) when it
|
|
44
|
+
has the query's length and was computed from the item's current text."""
|
|
45
|
+
vector = record.get('semantic_vector')
|
|
46
|
+
if not vector or len(vector) != length:
|
|
47
|
+
return None
|
|
48
|
+
if record.get('semantic_hash') != semantic_hash(semantic_text(item_kind, record)):
|
|
49
|
+
return None
|
|
50
|
+
return vector
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def meaning_matches(candidates: dict, query_vector: list[float], limit: int) -> dict:
|
|
54
|
+
"""{key: cosine} of the candidates ({key: vector}, every in-scope item with
|
|
55
|
+
a usable vector) that stand out for this query, best first, at most limit."""
|
|
56
|
+
query_norm = math.sqrt(sum(value * value for value in query_vector))
|
|
57
|
+
if not query_norm:
|
|
58
|
+
return {}
|
|
59
|
+
scores = {}
|
|
60
|
+
for key, vector in candidates.items():
|
|
61
|
+
norm = math.sqrt(sum(value * value for value in vector))
|
|
62
|
+
if norm:
|
|
63
|
+
scores[key] = sum(a * b for a, b in zip(query_vector, vector)) / (query_norm * norm)
|
|
64
|
+
if len(scores) < MIN_IN_SCOPE_ITEMS:
|
|
65
|
+
return {}
|
|
66
|
+
mean = fmean(scores.values())
|
|
67
|
+
deviation = pstdev(scores.values(), mean)
|
|
68
|
+
if not deviation:
|
|
69
|
+
return {}
|
|
70
|
+
floor = mean + FLOOR_STANDARD_DEVIATIONS * deviation
|
|
71
|
+
kept = sorted((key for key, score in scores.items() if score >= floor),
|
|
72
|
+
key=lambda key: (-scores[key], key))[:limit]
|
|
73
|
+
return {key: scores[key] for key in kept}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def fused_ranking(lexical_ids: list[str], semantic_ids: list[str]) -> dict[str, tuple[float, str]]:
|
|
77
|
+
"""{item id: (reciprocal rank fusion score, matched_by)} over the lexical
|
|
78
|
+
and the semantic order of one kind."""
|
|
79
|
+
lexical = {item_id: rank for rank, item_id in enumerate(lexical_ids, 1)}
|
|
80
|
+
semantic = {item_id: rank for rank, item_id in enumerate(semantic_ids, 1)}
|
|
81
|
+
fused = {}
|
|
82
|
+
for item_id in dict.fromkeys([*lexical_ids, *semantic_ids]):
|
|
83
|
+
score = sum(1 / (RRF_K + ranks[item_id]) for ranks in (lexical, semantic) if item_id in ranks)
|
|
84
|
+
matched_by = ('both' if item_id in lexical and item_id in semantic
|
|
85
|
+
else 'lexical' if item_id in lexical else 'semantic')
|
|
86
|
+
fused[item_id] = (round(score, 6), matched_by)
|
|
87
|
+
return fused
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"""The meaning index (rec#88): which items still need a vector of a model,
|
|
2
|
+
storing the vectors Node computed, and how far the index is.
|
|
3
|
+
|
|
4
|
+
A vector is derived data, an index: storing one writes no history and no
|
|
5
|
+
human-change record, and changes no version, lock_version or timestamp. It
|
|
6
|
+
lives on the item, so a permanent delete takes it along. Only the items
|
|
7
|
+
knowledge_index_scan covers are indexed. The text embedded includes the
|
|
8
|
+
item's retrieval terms (rec#92), so storing terms leaves the item pending
|
|
9
|
+
until it is embedded again.
|
|
10
|
+
"""
|
|
11
|
+
from .knowledge_index_scan import indexable_from, indexable_items, locked_item, ITEM_KINDS
|
|
12
|
+
from .knowledge_item_view import personal_reader_space
|
|
13
|
+
from .knowledge_semantic import semantic_hash, semantic_text
|
|
14
|
+
from .knowledge_semantic_models import (
|
|
15
|
+
SemanticPendingItem,
|
|
16
|
+
SemanticPendingPage,
|
|
17
|
+
SemanticPendingRequest,
|
|
18
|
+
SemanticStatus,
|
|
19
|
+
SemanticStatusRequest,
|
|
20
|
+
SemanticVectorWrite,
|
|
21
|
+
SemanticVectorWriteResult,
|
|
22
|
+
)
|
|
23
|
+
from .store_transactions import query_store_transaction
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _indexed(item_kind: str, record, model: str) -> tuple[bool, str, str]:
|
|
27
|
+
text = semantic_text(item_kind, record)
|
|
28
|
+
text_hash = semantic_hash(text)
|
|
29
|
+
return record['semantic_model'] == model and record['semantic_hash'] == text_hash, text, text_hash
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
async def pending_semantic_items(store, actor, request: SemanticPendingRequest) -> SemanticPendingPage:
|
|
33
|
+
space = await personal_reader_space(store, actor, request.personal_space_id)
|
|
34
|
+
items = []
|
|
35
|
+
async for item_kind, record in indexable_from(store, space, request.after):
|
|
36
|
+
indexed, text, text_hash = _indexed(item_kind, record, request.model)
|
|
37
|
+
if indexed:
|
|
38
|
+
continue
|
|
39
|
+
if len(items) == request.limit:
|
|
40
|
+
last = items[-1]
|
|
41
|
+
return SemanticPendingPage(items=items, next=f'{last.item_kind}:{last.item_id}')
|
|
42
|
+
items.append(SemanticPendingItem(
|
|
43
|
+
item_kind=item_kind, item_id=record['id'], personal_project_id=record['personal_project_id'],
|
|
44
|
+
text=text, hash=text_hash))
|
|
45
|
+
return SemanticPendingPage(items=items, next=None)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
async def semantic_status(store, actor, request: SemanticStatusRequest) -> SemanticStatus:
|
|
49
|
+
space = await personal_reader_space(store, actor, request.personal_space_id)
|
|
50
|
+
total = done = 0
|
|
51
|
+
for item_kind in ITEM_KINDS:
|
|
52
|
+
async for record in indexable_items(store, space, item_kind):
|
|
53
|
+
total += 1
|
|
54
|
+
done += _indexed(item_kind, record, request.model)[0]
|
|
55
|
+
return SemanticStatus(total=total, done=done)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
_STORE_VECTOR = {
|
|
59
|
+
'entity': '''
|
|
60
|
+
MATCH (item:Entity {uuid: $item_id, group_id: $group_id})
|
|
61
|
+
SET item.fuli_semantic_vector = $vector, item.fuli_semantic_model = $model,
|
|
62
|
+
item.fuli_semantic_hash = $hash''',
|
|
63
|
+
'relationship': '''
|
|
64
|
+
MATCH ()-[item:RELATES_TO {uuid: $item_id, group_id: $group_id}]->()
|
|
65
|
+
SET item.fuli_semantic_vector = $vector, item.fuli_semantic_model = $model,
|
|
66
|
+
item.fuli_semantic_hash = $hash''',
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
async def write_semantic_vectors(store, actor, request: SemanticVectorWrite) -> SemanticVectorWriteResult:
|
|
71
|
+
space = await personal_reader_space(store, actor, request.personal_space_id)
|
|
72
|
+
written, skipped = 0, []
|
|
73
|
+
# One transaction: a vector never lands on text other than its own.
|
|
74
|
+
async with query_store_transaction(store) as scoped:
|
|
75
|
+
for item in request.items:
|
|
76
|
+
record = await locked_item(scoped, space, item.item_kind, item.item_id)
|
|
77
|
+
if record is None or semantic_hash(semantic_text(item.item_kind, record)) != item.hash:
|
|
78
|
+
skipped.append(item.item_id)
|
|
79
|
+
continue
|
|
80
|
+
await scoped.runtime.driver.execute_query(
|
|
81
|
+
_STORE_VECTOR[item.item_kind], vector=item.vector, model=request.model, hash=item.hash,
|
|
82
|
+
item_id=item.item_id, group_id=space['group_id'])
|
|
83
|
+
written += 1
|
|
84
|
+
return SemanticVectorWriteResult(written=written, skipped=skipped)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def register_knowledge_semantic_routes(application, store, Actor) -> None:
|
|
88
|
+
@application.post('/v1/semantic/pending', response_model=SemanticPendingPage)
|
|
89
|
+
async def semantic_pending(request: SemanticPendingRequest, actor: Actor):
|
|
90
|
+
return await pending_semantic_items(store, actor, request)
|
|
91
|
+
|
|
92
|
+
@application.post('/v1/semantic/vectors', response_model=SemanticVectorWriteResult)
|
|
93
|
+
async def semantic_vectors(request: SemanticVectorWrite, actor: Actor):
|
|
94
|
+
return await write_semantic_vectors(store, actor, request)
|
|
95
|
+
|
|
96
|
+
@application.post('/v1/semantic/status', response_model=SemanticStatus)
|
|
97
|
+
async def semantic_index_status(request: SemanticStatusRequest, actor: Actor):
|
|
98
|
+
return await semantic_status(store, actor, request)
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""Requests and answers of the meaning index (rec#88)."""
|
|
2
|
+
from typing import Annotated
|
|
3
|
+
|
|
4
|
+
from pydantic import Field, model_validator
|
|
5
|
+
|
|
6
|
+
from .knowledge_audit_models import KnowledgeItemKind
|
|
7
|
+
from .model_base import StrictModel
|
|
8
|
+
from .knowledge_semantic_query import SemanticVectorValues
|
|
9
|
+
|
|
10
|
+
SEMANTIC_BATCH_LIMIT = 64
|
|
11
|
+
SemanticModelName = Annotated[str, Field(min_length=1, max_length=256)]
|
|
12
|
+
Sha256 = Annotated[str, Field(pattern=r'^[0-9a-f]{64}$')]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class SemanticPendingRequest(StrictModel):
|
|
16
|
+
personal_space_id: str = Field(min_length=1, max_length=128)
|
|
17
|
+
model: SemanticModelName
|
|
18
|
+
limit: int = Field(default=SEMANTIC_BATCH_LIMIT, ge=1, le=SEMANTIC_BATCH_LIMIT)
|
|
19
|
+
# The `next` of the previous page; omitted for the first.
|
|
20
|
+
after: str | None = Field(default=None, min_length=1, max_length=320)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class SemanticPendingItem(StrictModel):
|
|
24
|
+
item_kind: KnowledgeItemKind
|
|
25
|
+
item_id: str
|
|
26
|
+
# None for an item no project owns, so the caller applies the project approval.
|
|
27
|
+
personal_project_id: str | None
|
|
28
|
+
text: str
|
|
29
|
+
hash: str
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class SemanticPendingPage(StrictModel):
|
|
33
|
+
items: list[SemanticPendingItem]
|
|
34
|
+
next: str | None
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class SemanticVectorItem(StrictModel):
|
|
38
|
+
item_kind: KnowledgeItemKind
|
|
39
|
+
item_id: str = Field(min_length=1, max_length=256)
|
|
40
|
+
hash: Sha256
|
|
41
|
+
vector: SemanticVectorValues
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class SemanticVectorWrite(StrictModel):
|
|
45
|
+
personal_space_id: str = Field(min_length=1, max_length=128)
|
|
46
|
+
model: SemanticModelName
|
|
47
|
+
items: list[SemanticVectorItem] = Field(min_length=1, max_length=SEMANTIC_BATCH_LIMIT)
|
|
48
|
+
|
|
49
|
+
@model_validator(mode='after')
|
|
50
|
+
def validate_one_length(self):
|
|
51
|
+
if len({len(item.vector) for item in self.items}) != 1:
|
|
52
|
+
raise ValueError('every vector in one write must have the same length')
|
|
53
|
+
if len({(item.item_kind, item.item_id) for item in self.items}) != len(self.items):
|
|
54
|
+
raise ValueError('each item may appear once')
|
|
55
|
+
return self
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class SemanticVectorWriteResult(StrictModel):
|
|
59
|
+
written: int = Field(ge=0)
|
|
60
|
+
# The items whose text changed since their hash was computed, or that are gone.
|
|
61
|
+
skipped: list[str]
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class SemanticStatusRequest(StrictModel):
|
|
65
|
+
personal_space_id: str = Field(min_length=1, max_length=128)
|
|
66
|
+
model: SemanticModelName
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class SemanticStatus(StrictModel):
|
|
70
|
+
total: int = Field(ge=0)
|
|
71
|
+
done: int = Field(ge=0)
|
|
72
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""What a search by meaning carries and answers (rec#88)."""
|
|
2
|
+
from typing import Annotated, Literal
|
|
3
|
+
|
|
4
|
+
from pydantic import Field
|
|
5
|
+
|
|
6
|
+
from .model_base import StrictModel
|
|
7
|
+
|
|
8
|
+
# How search found an item: by its words, by its meaning, or both.
|
|
9
|
+
SearchMatch = Literal['lexical', 'semantic', 'both']
|
|
10
|
+
SemanticVectorValues = Annotated[
|
|
11
|
+
list[Annotated[float, Field(allow_inf_nan=False)]], Field(min_length=1, max_length=8192)]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class SemanticQuery(StrictModel):
|
|
15
|
+
"""The query's own meaning vector, computed by the model a person
|
|
16
|
+
connected. A model or length no stored vector has is no error: the
|
|
17
|
+
search then has no semantic part."""
|
|
18
|
+
model: str = Field(min_length=1, max_length=256)
|
|
19
|
+
vector: SemanticVectorValues
|
|
@@ -33,6 +33,7 @@ from .knowledge_audit_models import (
|
|
|
33
33
|
PreferenceScopeChange,
|
|
34
34
|
)
|
|
35
35
|
from .model_base import StrictModel
|
|
36
|
+
from .knowledge_semantic_query import SearchMatch, SemanticQuery
|
|
36
37
|
from .knowledge_weight_models import KnowledgeWeightView
|
|
37
38
|
from .provider_values import json_object
|
|
38
39
|
from .project_profile_authors import AuthoredField, ProjectFieldAuthor, default_field_authors
|
|
@@ -818,6 +819,7 @@ class SearchRequest(StrictModel):
|
|
|
818
819
|
project_agent_id: str | None = Field(default=None, min_length=1, max_length=128)
|
|
819
820
|
inherit_project_knowledge: bool = True
|
|
820
821
|
include_personal_global: bool = False
|
|
822
|
+
semantic: SemanticQuery | None = None
|
|
821
823
|
|
|
822
824
|
@field_validator('personal_project_ids')
|
|
823
825
|
@classmethod
|
|
@@ -890,6 +892,7 @@ class EntitySearchResult(KnowledgeWeightView):
|
|
|
890
892
|
scope_path: list[str] = Field(default_factory=list, max_length=9)
|
|
891
893
|
source_uris: list[str] = Field(default_factory=list, max_length=20)
|
|
892
894
|
score: float | None = None
|
|
895
|
+
matched_by: SearchMatch = 'lexical'
|
|
893
896
|
|
|
894
897
|
|
|
895
898
|
class FactResult(KnowledgeWeightView):
|
|
@@ -941,6 +944,7 @@ class FactResult(KnowledgeWeightView):
|
|
|
941
944
|
scope_path: list[str] = Field(default_factory=list, max_length=9)
|
|
942
945
|
source_uris: list[str] = Field(default_factory=list, max_length=20)
|
|
943
946
|
score: float | None = None
|
|
947
|
+
matched_by: SearchMatch = 'lexical'
|
|
944
948
|
|
|
945
949
|
|
|
946
950
|
class SearchResult(StrictModel):
|
|
@@ -16,7 +16,7 @@ def register_task_context_routes(application, store, Actor):
|
|
|
16
16
|
personal_space_id: Annotated[str, Query(min_length=1, max_length=128)],
|
|
17
17
|
project_agent_id: Annotated[str, Query(min_length=1, max_length=128)],
|
|
18
18
|
personal_project_id: Annotated[str | None, Query(min_length=1, max_length=128)] = None,
|
|
19
|
-
limit: Annotated[int, Query(ge=1, le=
|
|
19
|
+
limit: Annotated[int, Query(ge=1, le=200)] = 5):
|
|
20
20
|
return await store.recent_agent_sessions(
|
|
21
21
|
actor, personal_space_id, project_agent_id, personal_project_id, limit,
|
|
22
22
|
)
|
|
Binary file
|