KB-488F

Copy/Paste Agent Prompt — P3D Vector Search Hybrid Boost Implementation

4 min read Revision 1
copy-pasteagentvector-searchimplementationp3dhigh-effort2026-05-11

Copy/Paste Agent Prompt — P3D Vector Search Hybrid Path/Title Boost Implementation

Date: 2026-05-11 Recommended effort: high Mode: Production code patch with strict safety gates

Prompt

Implement the approved P3D Vector Search Hybrid Path/Title Boost pack.

Recommended effort: high.

Reason: The patch is small, but it touches production Agent Data search. Use careful preflight, backup, safe restart, tests, and rollback discipline.

Read first:

knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-final-approval-p3d-vector-search-boost-prompt-rev2-2026-05-11.md
knowledge/dev/laws/dieu44-trien-khai/prompts/p3d-vector-search-hybrid-path-title-boost-implementation-prompt.md
knowledge/dev/laws/dieu44-trien-khai/design/p3d-vector-search-hybrid-path-title-boost-design.md
knowledge/dev/laws/dieu44-trien-khai/reports/p3d-vector-search-freshness-audit-report.md

Then execute exactly the implementation prompt:

knowledge/dev/laws/dieu44-trien-khai/prompts/p3d-vector-search-hybrid-path-title-boost-implementation-prompt.md

Goal:

Add an app-layer rerank/path-title boost to Agent Data search so exact path/title/document-name queries rank the correct KB document first, while preserving semantic search quality.

Root cause:

SEARCH_RANKING_NO_PATH_TITLE_BOOST_NOT_VECTOR_FRESHNESS

Hard boundaries:

  • No Qdrant collection replacement.
  • No Qdrant point delete/upsert.
  • No bulk reindex.
  • No auto-heal.
  • No /kb/reindex.
  • No /kb/reindex-missing.
  • No /kb/cleanup-orphans write mode.
  • No PG schema mutation.
  • No DB INSERT/UPDATE/DELETE.
  • No trigger/function/index/permission changes.
  • No TAC/IU migration.
  • No IU vector implementation.
  • No event_outbox change.
  • No Pack 1 DDL.
  • No docker-compose or .env edit in this first patch.
  • Do not deploy/restart until preflight, backup, and code diff are complete.

Required safety behavior:

  1. Discover actual container names; do not assume qdrant or agent-data.
  2. Confirm runtime linkage before code patch. If unclear, STOP and report BLOCKED_RUNTIME_LINKAGE_UNCLEAR.
  3. Run baseline T1–T6 tests and record ranks.
  4. Backup target files before editing.
  5. Patch minimal app-layer rerank logic only.
  6. Run py_compile before restart.
  7. Restart Agent Data only if safe.
  8. Confirm Qdrant point count before/after is unchanged.
  9. Run post-patch T1–T6 tests.
  10. Roll back immediately if health fails or semantic regression occurs.

Expected report path:

knowledge/dev/laws/dieu44-trien-khai/reports/p3d-vector-search-hybrid-path-title-boost-implementation-report.md

Final response format:

vector_search_boost_status=PASS|FAIL|ROLLED_BACK|BLOCKED
report_path=knowledge/dev/laws/dieu44-trien-khai/reports/p3d-vector-search-hybrid-path-title-boost-implementation-report.md
files_changed=<list>
qdrant_points_before=<n>
qdrant_points_after=<n>
health_after=<status>
acceptance_summary=<short>
rollback_performed=true|false
no_qdrant_mutation=true
no_pg_schema_mutation=true

Return only the final response format plus critical blocker notes. Do not write a long essay.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/prompts/p3d-agent-copy-paste-vector-search-boost-implementation-2026-05-11.md