Skip to content

Commit 80e399f

Browse files
committed
docs(rfc): propose join-free artifact retrieval
1 parent ba7dc8d commit 80e399f

2 files changed

Lines changed: 390 additions & 0 deletions

File tree

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
---
2+
title: Artifact Search Projections and Join-Free Retrieval
3+
---
4+
5+
- Proposal Name: `artifact_search_projections`
6+
- Start Date: 2026-09-30
7+
- RFC PR: [oceanbase/powercontext#1803](https://github.com/oceanbase/powercontext/pull/1803)
8+
- Migration dependency: [Unified Versioned Database Migrations, #1771](https://github.com/oceanbase/powercontext/pull/1771)
9+
- Amends RFCs: [0014](0014_memory_layer_design.md), [0051](0051_experience_skill_artifact_families.md),
10+
[0080](0080_memory_search_reranking.md), [1417](1417_topic_memory.md)
11+
- Related RFCs: [1396](1396_handoff_access_control.md), [1467](1467_artifact_tags.md),
12+
[1549](1549_artifact_family_unification.md), [1652](1652_memory_quality_and_lifecycle.md)
13+
14+
# Summary
15+
16+
This RFC proposes a common query boundary for searchable Artifact Families: **full-text and vector retrieval statements
17+
must not use business-table joins**. Matching, eligibility filtering, candidate ordering, and truncation cannot depend
18+
on joins to authoritative history, heads, tags, or other business tables.
19+
20+
OceanBase must follow this query boundary. Whether it is also mandatory for other backends remains an open question.
21+
22+
Each Family should use a search wide table or separate current search projections. Tables may be separated by full-text
23+
and vector capabilities or by search granularity, such as topics and chunks. All data need not occupy one physical table.
24+
After candidates are selected, content and display fields may be fetched in batches using exact references.
25+
26+
Authoritative revisions and heads retain their identity, history, and current-version responsibilities. Search projections
27+
are rebuildable derived data maintained synchronously with authoritative state. The standard covers Memory, Topic Memory,
28+
Experience, and Skill; each Family's adaptation proceeds independently.
29+
30+
# Motivation
31+
32+
## Joins affect search indexes and retrieval results
33+
34+
Families already maintain partial search projections, but search still involves cross-table associations:
35+
36+
| Family | Current search structure |
37+
| --- | --- |
38+
| Memory | Separate full-text and vector projections; retrieval joins entry versions for content and uses correlated tag filters |
39+
| Topic Memory | Separate Topic/chunk full-text and vector projections; vector candidates join display content after truncation |
40+
| Experience | Full-text matching on common heads, followed by a join to authoritative revision content |
41+
| Skill | The same full-text retrieval path as Experience |
42+
43+
In OceanBase, a distance-ordered vector scan participating in a merge join causes nearest-neighbor loss. Joining full-text
44+
search with other business tables also degrades the full-text index path. Topic Memory already limits ANN candidates
45+
before joining content to work around the vector merge-join issue, showing that candidate selection and content reads
46+
can be organized separately.
47+
48+
Families need a clear retrieval boundary that keeps business associations for content, current state, and tags out of
49+
full-text and vector retrieval plans.
50+
51+
## Search data has different maintenance costs
52+
53+
Full text, vectors, and multivalued tags use different indexes. Topics and chunks also have different search granularities.
54+
Requiring one physical table couples content duplication, vector configuration, tag updates, and index lifecycles.
55+
Colocating fields alone does not ensure that multivalued tags and vector filtering combine efficiently.
56+
57+
Wide tables suit direct return of complete results. Separate projections suit independently maintained capabilities and
58+
granularities. The common contract should allow Families to choose an appropriate layout.
59+
60+
## Eligibility and content completion need different boundaries
61+
62+
Content can be fetched in batches after candidates are selected. Scope, tags, lifecycle, and access eligibility affect
63+
which objects qualify as candidates. Applying them only after taking a global top-k lets ineligible objects consume
64+
candidate slots and can exclude relevant eligible objects.
65+
66+
Allowing separate tables therefore requires guarantees for eligibility, exact references, and read consistency.
67+
68+
# Guide-level explanation
69+
70+
## Use a wide table or separate projections
71+
72+
A Family may store search fields and response content in its own wide table and return complete results directly.
73+
Alternatively, it may maintain separate current full-text and vector projections, retrieve exact references, match
74+
positions, and scores, then fetch content in batches.
75+
76+
Topic Memory can retain separate topic and chunk search granularities. Chunk hits still reference the exact Topic
77+
revision, preserving candidate budgets, result folding, and scoring semantics. Full-text-only Experience and Skill do
78+
not need vector projections.
79+
80+
The corresponding Family owns these layouts. Families do not have to share one search table.
81+
82+
## Return complete, consistent results
83+
84+
Search interfaces continue returning their promised content, metadata, and exact version references. With separate
85+
projections, the service performs batch content reads; callers need not request details per hit. Content reads use the
86+
version selected during retrieval and cannot replace it by resolving latest again.
87+
88+
After publication, deactivation, or tag changes, search selects candidates from consistent current state. Historical
89+
references remain readable under access control. Search projection layout does not affect exact historical reads.
90+
91+
## Preserve tag filtering semantics
92+
93+
Tag management may retain independent authoritative assignments. Search uses synchronously maintained tag projections
94+
or complete, bounded filter inputs established before retrieval to apply existing all/any matching semantics during
95+
candidate selection.
96+
97+
It cannot arbitrarily truncate the tag-matching object set before ranking or join tags after retrieval to filter results.
98+
Deployments without embeddings retain existing full-text search. Backend capability boundaries explicitly define the
99+
supported combinations of filtering and retrieval modes.
100+
101+
# Reference-level explanation
102+
103+
## Core contract
104+
105+
The following query organization and projection maintenance requirements apply to backends covered by this standard.
106+
Whether non-OceanBase backends are included remains an unresolved question. Every backend must preserve existing
107+
authorization, filtering, current-version, and returned-content semantics.
108+
109+
1. **No business joins in retrieval statements.** Full-text and vector candidate selection must not join authoritative
110+
history, heads, tags, or other business tables. Correlated subqueries cannot bring those associations back into retrieval.
111+
2. **Multiple current projections are allowed.** Family-owned wide tables or separate projections are recommended.
112+
The Family and backend determine physical table counts, whether full text and vectors share storage, and search granularity.
113+
3. **Eligibility participates in candidate selection.** Scope, tags, lifecycle, and access control retain their semantics.
114+
Filtering after truncation cannot replace retrieval of eligible candidates.
115+
4. **Content completion runs separately.** Once candidates exist, separate batch reads may complete their content.
116+
Business tables must not be joined in the same statement that performs full-text or vector retrieval. Content reads
117+
do not redetermine eligibility, the current version, or relevance ordering.
118+
5. **Current state is consistent.** Authoritative changes and affected projections update atomically. All retrieval
119+
channels and content reads in one search share a consistent committed state.
120+
6. **History and budgets are preserved.** Rebuilding changes no authoritative identities, historical content, exact
121+
references, or Source processing positions. Candidates, filter-input transfer, content reads, and fusion respect
122+
budgets, without per-hit queries or unbounded object lists connecting stages.
123+
124+
## Responsibilities and scope
125+
126+
`pc_artifacts` and `pc_artifact_heads` retain their existing roles. Projections maintained by Family writers establish
127+
currentness; retrieval does not join heads to identify the latest revision. Candidates carry exact identities sufficient
128+
to identify their original content and match positions.
129+
130+
Content completion may read the corresponding current content projection or authoritative exact-version records.
131+
It must not silently substitute another revision, omit missing content, or interpret inconsistencies as empty results.
132+
Returned content must correspond to the candidates used for scoring.
133+
134+
Independent changes to tags and other eligibility information also update every affected projection synchronously.
135+
Metadata changes need not all create content revisions. Existing Scope-level authorization can run before search;
136+
changing search storage does not require changing the authorization model.
137+
138+
Backends covered by this standard may implement search with native or auxiliary indexes. Internal database index access
139+
is not a business-table join prohibited by this RFC. Application queries still respect the boundary between retrieval
140+
and content reads. A shared standard allows backend-specific DDL and index implementations.
141+
142+
This RFC covers existing and future searchable Families and defines only the common search standard. Each Family's
143+
adaptation is designed and delivered independently; simultaneous completion is not required. Domain contracts own content
144+
generation, evidence semantics, and semantic merging. Public return content, filters, and scoring contracts remain unchanged.
145+
146+
## Upgrade and compatibility
147+
148+
Schema changes and search projection rebuilding follow
149+
[RFC #1771: Unified Versioned Database Migrations](https://github.com/oceanbase/powercontext/pull/1771),
150+
using its unified maintenance entry point for the offline upgrade.
151+
152+
Search projections are rebuilt from authoritative data without creating content revisions or re-extracting processed
153+
Sources. Existing exact references and access control are preserved. Historical content reads do not depend on historical
154+
vectors.
155+
156+
# Drawbacks
157+
158+
- **Projection maintenance costs.** Wide tables may duplicate content. Separate projections still duplicate some
159+
eligibility attributes and require synchronous maintenance of multiple current representations.
160+
- **Read coordination.** Batch content completion adds a read and must use the same versions and consistent state as retrieval.
161+
- **Index combination limits.** Backend capabilities determine how multivalued tags combine with vector retrieval.
162+
Removing joins does not eliminate filtering or scanning costs.
163+
- **Upgrade downtime.** Projection migration and index rebuilding require extra space and a maintenance window.
164+
Authoritative history continues to grow independently.
165+
166+
# Rationale and alternatives
167+
168+
## Constrain retrieval while allowing projection choices
169+
170+
Wide tables reduce content lookups and coordination between copies, suiting Families whose response fields align with
171+
search units. Separate projections allow independent maintenance of full text, vectors, topics, and chunks, reducing
172+
large-field duplication and separating index management. This proposal recommends both layouts under the same query
173+
boundary and consistency responsibilities.
174+
175+
## Require exactly one wide table per Family
176+
177+
This simplifies direct result return but restricts independent evolution of search granularities, vector configurations,
178+
and backend indexes. It also cannot replace multivalued-tag index design, so it is not a mandatory physical requirement.
179+
180+
## Keep business associations in OceanBase retrieval
181+
182+
This reduces some duplication but retains OceanBase nearest-neighbor loss and full-text index degradation. Expressing
183+
associations as correlated subqueries or outer joins in the same retrieval statement still combines business tables
184+
with the retrieval plan. Separate batch content reads establish an explicit boundary between the two stages.
185+
186+
# Prior art
187+
188+
[RFC 1417](1417_topic_memory.md) provides current Topic/chunk projections, separate retrieval channels, and atomic
189+
publication as a foundation for independent projections. [RFC 0051](0051_experience_skill_artifact_families.md) defines
190+
Experience/Skill content and admission. [RFC 1467](1467_artifact_tags.md) and
191+
[RFC 1396](1396_handoff_access_control.md) define tag and authorization semantics that must be preserved.
192+
193+
# Unresolved questions
194+
195+
1. Determine the minimum supported OceanBase version.
196+
2. Decide whether this standard is also mandatory for non-OceanBase backends.
197+
198+
The second question has two options; the backend scope remains undecided:
199+
200+
| Option | Benefits | Costs |
201+
| --- | --- | --- |
202+
| Require every backend to follow the standard | Consistent query organization supports reuse of table models, projection maintenance, and content-read code, reducing maintenance of multiple models and branches. | Backends without the same query limitations must also adapt, potentially adding data duplication, write maintenance, and content-read costs. |
203+
| Require OceanBase to follow the standard; let other backends choose | Other backends can retain queries suited to their index capabilities, reducing mandatory adaptation costs. | Table models and retrieval paths may diverge, potentially requiring multiple implementations and increasing feature-development and verification costs. |
204+
205+
A shared standard does not require identical DDL or indexes across backends. Backends that are not required to follow it
206+
may still reuse the same models and retrieval implementation voluntarily.
207+
208+
# Future possibilities
209+
210+
A unified search could combine each Family's results, for example returning Memory, Experience, and Skill in one request
211+
and ranking them together. Scoring and ranking across Families would need separate decisions. This capability is not a
212+
delivery requirement of this proposal.

0 commit comments

Comments
 (0)