LearnNewsExamplesServices
Frontmatter
id8417
titleRefine RAG System Prompt for Identity & Accuracy
stateClosed
labels
enhancementai
assigneestobiu
createdAtJan 8, 2026, 11:52 AM
updatedAtJan 8, 2026, 11:56 AM
githubUrlhttps://github.com/neomjs/neo/issues/8417
authortobiu
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 8, 2026, 11:56 AM

Refine RAG System Prompt for Identity & Accuracy

Closed v11.19.0 enhancementai
tobiu
tobiu commented on Jan 8, 2026, 11:52 AM

The current RAG prompt allows the model to slip into generic training data, referring to the framework as "Neo.js" instead of "Neo.mjs". We need to harden the system prompt in SearchService.mjs:

  1. Explicitly enforce the "Neo.mjs" name.
  2. Emphasize that it is a worker-based, multi-threaded framework (grounding context).
  3. Re-verify with test_rag.mjs.
tobiu added the enhancement label on Jan 8, 2026, 11:52 AM
tobiu added the ai label on Jan 8, 2026, 11:52 AM
tobiu referenced in commit e34f0d4 - "fix: Harden RAG prompt to enforce Neo.mjs terminology (#8417)" on Jan 8, 2026, 11:54 AM
tobiu assigned to @tobiu on Jan 8, 2026, 11:54 AM
tobiu
tobiu Jan 8, 2026, 11:54 AM

Input from Gemini 3 Pro:

✦ Refined the system prompt in SearchService.mjs to strictly enforce "Neo.mjs" terminology. Verified with test_rag.mjs that the model now correctly refers to the framework as "Neo.mjs" instead of "Neo.js".

tobiu
tobiu Jan 8, 2026, 11:55 AM
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓  Shell node ai/examples/test_rag.mjs [current working directory /Users/Shared/github/neomjs/neo]                                                              │
│                                                                                                                                                                 │
│ 🔍 Testing RAG Service...                                                                                                                                       │
│ ⏳ Waiting for service to be ready...                                                                                                                           │
│ [2026-01-08T10:53:58.222Z] [INFO] Connected to Neural Link Bridge as agent-733af1cc-39e9-4332-ae98-4a173ad16b02                                                 │
│ ✅ Service Ready                                                                                                                                                │
│                                                                                                                                                                 │
│ ❓ Asking: "How do I use the Viewport component?"                                                                                                               │
│                                                                                                                                                                 │
│ 📝 Answer:                                                                                                                                                      │
│ To use the Viewport component, you import it and then assign it as the `mainView` configuration property when initializing a Neo.mjs application.               │
│                                                                                                                                                                 │
│ For example, as seen in `DOCUMENT 1 (examples/component/helix/app.mjs)`, `DOCUMENT 2 (examples/component/multiWindowHelix/childapp/app.mjs)`, and `DOCUMENT 3   │
│ (examples/component/coronaGallery/app.mjs)`:                                                                                                                    │
│                                                                                                                                                                 │
│ 1.  **Import the Viewport component:**                                                                                                                          │
│     `import Viewport from './Viewport.mjs';`                                                                                                                    │
│ 2.  **Assign it as the `mainView` in `Neo.app()`:**                                                                                                             │
│     `export const onStart = () => Neo.app({ mainView: Viewport, name: '...' });`                                                                                │
│                                                                                                                                                                 │
│ This sets the Viewport as the primary view for your Neo.mjs application.                                                                                        │
│                                                                                                                                                                 │
│ 📚 References:                                                                                                                                                  │
│    1. [0.4748] examples/component/helix/app.mjs - [Module Context] (examples/component/helix/app.mjs)                                                           │
│    2. [0.5043] examples/component/multiWindowHelix/childapp/app.mjs - [Module Context] (examples/component/multiWindowHelix/childapp/app.mjs)                   │
│    3. [0.5060] examples/component/coronaGallery/app.mjs - [Module Context] (examples/component/coronaGallery/app.mjs)                                           │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
tobiu closed this issue on Jan 8, 2026, 11:56 AM