EMBED-003: RAG System with Vector Search #126

Closed
opened 2026-04-11 02:50:16 +00:00 by Mark · 1 comment
Owner

Overview

Implement Retrieval-Augmented Generation using the embedding engine for knowledge retrieval.

Architecture

User Query → Embed → Vector Search → Retrieve Chunks → Augment Prompt → LLM Response

Components

Knowledge Store

  • Document chunking strategy
  • Chunk embedding pipeline
  • Vector storage for chunks
  • Metadata preservation (source, timestamp, context)

Retrieval

  • Query embedding
  • Similarity search across chunks
  • Relevance scoring
  • Top-k retrieval (configurable k)

Augmentation

  • Context window management
  • Prompt templating with retrieved context
  • Source attribution in responses

Integration Points

  • Worker skills can declare RAG requirements
  • File upload triggers automatic embedding
  • Artifact store searchable via vectors
  • Conversational memory uses same retrieval

API

class RAGSystem:
    def index_document(self, doc_id: str, content: str, metadata: dict)
    def query(self, query: str, top_k: int = 5) -> list[RetrievedChunk]
    def augment_prompt(self, query: str, system_prompt: str) -> str

Use Cases

  • Research worker retrieves from knowledge base
  • Writer references previous articles
  • Validation worker checks against policy docs
  • File upload content searchable

Acceptance Criteria

  • Document upload → automatically embedded
  • Query retrieves semantically similar chunks
  • Response includes source references
  • End-to-end latency <2s

Priority

HIGH - Enables knowledge workers

  • EMBED-001: Embedding Engine Infrastructure
  • EMBED-005: Artifact Semantic Search
## Overview Implement Retrieval-Augmented Generation using the embedding engine for knowledge retrieval. ## Architecture ``` User Query → Embed → Vector Search → Retrieve Chunks → Augment Prompt → LLM Response ``` ## Components ### Knowledge Store - [ ] Document chunking strategy - [ ] Chunk embedding pipeline - [ ] Vector storage for chunks - [ ] Metadata preservation (source, timestamp, context) ### Retrieval - [ ] Query embedding - [ ] Similarity search across chunks - [ ] Relevance scoring - [ ] Top-k retrieval (configurable k) ### Augmentation - [ ] Context window management - [ ] Prompt templating with retrieved context - [ ] Source attribution in responses ## Integration Points - [ ] Worker skills can declare RAG requirements - [ ] File upload triggers automatic embedding - [ ] Artifact store searchable via vectors - [ ] Conversational memory uses same retrieval ## API ```python class RAGSystem: def index_document(self, doc_id: str, content: str, metadata: dict) def query(self, query: str, top_k: int = 5) -> list[RetrievedChunk] def augment_prompt(self, query: str, system_prompt: str) -> str ``` ## Use Cases - Research worker retrieves from knowledge base - Writer references previous articles - Validation worker checks against policy docs - File upload content searchable ## Acceptance Criteria - [ ] Document upload → automatically embedded - [ ] Query retrieves semantically similar chunks - [ ] Response includes source references - [ ] End-to-end latency <2s ## Priority HIGH - Enables knowledge workers ## Related - EMBED-001: Embedding Engine Infrastructure - EMBED-005: Artifact Semantic Search
Author
Owner

Feature Triage Assessment

Scope: large
Risk: medium
Spec Alignment: misaligned
Summary: Designs a full RAG subsystem (document chunking, vector storage, prompt augmentation, worker integration) that far exceeds the Milestone 3 definition of EMBED-003 (intent embedding extraction for semantic bidding).
Recommendation: Revert EMBED-003 to original milestone scope (intent embedding for bid matching). If RAG is desired, file as a new issue on the Phase 3/Artifact track — the embedding_service.py already provides encode/find_most_similar primitives that both features share, but the RAG system is a separate deliverable with its own storage, chunking, and templating. This issue should not block #123 (semantic bidding) since it addresses a different use case.
Rationale: SCOPE=large: Describes a new subsystem (chunking, vector store, prompt templating, RAGSystem API) plus 4 integration points (worker skills, file upload, artifact store, conversational memory). Conservatively 15+ files. RISK=medium: Additive atop existing embedding_service, but touches worker contracts and artifact pipeline; performance requirement (<2s) and vector store durability add implementation risk. SPEC=misaligned: MILESTONES.md explicitly defines EMBED-003 as 'Intent embedding extraction' — a focused component of the semantic bidding pipeline. The issue body describes an entirely different feature (knowledge retrieval RAG for workers) that was never scoped in the embedding milestone. The ROADMAP.md and AGENTS.md show zero mention of RAG, confirming this is scope-creep on the issue number.

Labeled blocked:needs-decision — unblock on Forgejo to dispatch to the fixer pipeline.

## Feature Triage Assessment **Scope:** large **Risk:** medium **Spec Alignment:** misaligned **Summary:** Designs a full RAG subsystem (document chunking, vector storage, prompt augmentation, worker integration) that far exceeds the Milestone 3 definition of EMBED-003 (intent embedding extraction for semantic bidding). **Recommendation:** Revert EMBED-003 to original milestone scope (intent embedding for bid matching). If RAG is desired, file as a new issue on the Phase 3/Artifact track — the embedding_service.py already provides encode/find_most_similar primitives that both features share, but the RAG system is a separate deliverable with its own storage, chunking, and templating. This issue should not block #123 (semantic bidding) since it addresses a different use case. **Rationale:** SCOPE=large: Describes a new subsystem (chunking, vector store, prompt templating, RAGSystem API) plus 4 integration points (worker skills, file upload, artifact store, conversational memory). Conservatively 15+ files. RISK=medium: Additive atop existing embedding_service, but touches worker contracts and artifact pipeline; performance requirement (<2s) and vector store durability add implementation risk. SPEC=misaligned: MILESTONES.md explicitly defines EMBED-003 as 'Intent embedding extraction' — a focused component of the semantic bidding pipeline. The issue body describes an entirely different feature (knowledge retrieval RAG for workers) that was never scoped in the embedding milestone. The ROADMAP.md and AGENTS.md show zero mention of RAG, confirming this is scope-creep on the issue number. Labeled `blocked:needs-decision` — unblock on Forgejo to dispatch to the fixer pipeline.
Mark 2026-06-16 03:50:59 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/mesh-seed#126
No description provided.