node-red-contrib-context-weave 0.1.2

Connector-first retrieval and grounded answers for Node-RED

npm install node-red-contrib-context-weave

ContextWeave for Node-RED

Build tested on Node.js 24 and 26 Release quality checks passed Unit-test line coverage 91.05%

These badges describe the published release. The build runs on Node.js 24 and 26, and unit tests cover 91.05% of source lines.

What is ContextWeave?

ContextWeave is a set of Node-RED nodes for answering questions using your own documents. Connect a data source, index its documents, and the flow can find relevant passages and cite them in its answers. The context weave palette includes 34 flow nodes and five reusable configuration nodes. SQLite stores documents, vectors, keyword indexes and conversation history under the Node-RED user directory.

New to the nodes? Open the complete node user guide for recommended flows, configuration decisions, every node option, production guidance and troubleshooting.

Getting started

  1. Use Node.js 24.14+ with SQLite FTS5 support and Node-RED 5.0.10+. From your Node-RED user directory, run npm install node-red-contrib-context-weave and restart Node-RED.
  2. Start Ollama on the Node-RED host. Run ollama pull nomic-embed-text and ollama pull llama3.2. The example connects to http://localhost:11434.
  3. Open Menu → Import → Examples → node-red-contrib-context-weave → support-rag, then deploy the flow. You can also import the flow JSON directly.
  4. Click Index sample password-reset article. When Index result appears in Debug, click Ask about password reset. The response should cite the article and say that the link expires after 30 minutes.

Explore the support flow

The example has two entry points. Index the article once, then ask questions against the same library.

flowchart LR
    article["Support article"] --> index["index"]
    index -->|stores chunks| kb[("Support library")]
    kb -->|matching chunks| retrieve["retrieve"]
    question["Question"] --> retrieve
    retrieve --> rerank["rerank"] --> answer["answer with citations"]
Follow an article from your connector into the library
flowchart TD
    source["Inject a record or wire your connector"] --> map["source-map"]
    map -->|upsert| parse["parse-content"] --> record["record-ingest"]
    record --> split["split"] --> index["index"] --> debug["Debug: Index result"]
    map -->|delete event| del["document-delete"]

To use your own data, replace Index sample password-reset article with your connector. Open Map connector record and select the fields for the stable record ID, content and metadata. The example uses tenant_id to keep tenants separate and retrieves records with status set to published.

Follow a question from Inject or HTTP to a cited answer
flowchart TD
    inject["Inject: Ask about password reset"] --> validate["Validate question and identity"]
    http["POST /context-weave/ask"] --> validate
    validate --> retrieve["retrieve"] --> rerank["rerank"] --> answer["answer"]
    answer --> format["Return answer + citations"]
    format -->|Inject| debug["Debug sidebar"]
    format -->|HTTP| response["HTTP response"]

Try When does the reset link expire? The article says 30 minutes. Expand payload.citations in Debug to find the document ID behind the answer.

Choose a vector database

SQLite is the default. For external cosine search, add a provider and select it in the library’s vector provider field.

Provider adapter Example base URL Setup
Qdrant http://127.0.0.1:6333 Enter the API key if required. ContextWeave creates cosine collections.
pgvector postgresql://[email protected]:5432/support Enable CREATE EXTENSION vector in the database. Enter the database password in the provider credential field and grant the role permission to create its vector table.
Chroma http://127.0.0.1:8000 Use a Chroma v2 server with the default tenant and database. Enter its token if required.

Local-only libraries require a loopback endpoint. Other hosts require TLS and a compatible library privacy setting. Keep the SQLite user directory when using an external service. It holds document text, filters, keyword search and pending vector changes. On first use, an external provider receives existing vectors. Use a new library ID when switching between external services.

Configure models and access

A provider stores the service URL and Node-RED credential. A model-profile selects the model ID, purpose and privacy policy. Select an embedding profile in the library and a generation profile in the answer node. The local example stores everything on the Node-RED host. To send data to a managed service, explicitly select compatible library and model privacy settings and enter your provider credentials.

For POST /context-weave/ask, wire your authenticated identity step before the validation Function and set msg.auth.tenantId from that trusted identity. The route returns HTTP 401 when the identity is missing. The Inject nodes use a local example tenant.

Develop

npm ci --ignore-scripts
npm run build
npm run check
npm test
npm run coverage
npm audit --audit-level=high

Tests use a local model fixture and a temporary Node-RED instance. Each node has a runtime JS file, editor HTML and help text in nodes/. Shared implementations live in lib/. Run npm run build after editing field definitions or editor metadata; it regenerates both editors and the user guide. CI checks both supported Node.js release lines and enforces a minimum 70% line coverage across library code.

See the node user guide, design blueprint, and implementation scope for usage, architecture and release boundaries. MIT licensed.

Release to npm

To run the standalone build, open GitHub → Actions → Build → Run workflow, select the branch to test, and click Run workflow.

To release a new version:

  1. Run npm version patch --no-git-tag-version on a release branch. Commit both package.json and package-lock.json, then merge the change into main.
  2. Open Actions → Publish npm package → Run workflow, select main, and click Run workflow.
  3. Open the run to see the verification and publish results. The workflow rebuilds, tests and audits the package before publishing with npm trusted publishing. Each successful publish moves the npm latest tag to that version. Running the workflow again for an existing version skips publication and preserves the current tag.

The npm trusted publisher for this package is sidisl16/node-red-contrib-context-weave, workflow publish.yml.

After npm accepts the package, submit its npm name manually at the Node-RED Flow Library add-node page. New catalogue submissions are not automatic.

Node Info

Version: 0.1.2
Updated 2 days ago
License: MIT
Rating: not yet rated

Categories

Actions

Rate:

Downloads

414 in the last week

Nodes

  • context-weave-agent-run
  • context-weave-agent-tool
  • context-weave-answer
  • context-weave-cite
  • context-weave-context
  • context-weave-conversation-delete
  • context-weave-conversation-open
  • context-weave-conversation-read
  • context-weave-conversation-store
  • context-weave-conversation-turn
  • context-weave-document-delete
  • context-weave-document-get
  • context-weave-document-list
  • context-weave-document-patch
  • context-weave-document-replace-metadata
  • context-weave-document-summarize
  • context-weave-fact-check
  • context-weave-file-ingest
  • context-weave-filter
  • context-weave-format-evidence
  • context-weave-generate
  • context-weave-index
  • context-weave-library
  • context-weave-library-create
  • context-weave-library-delete
  • context-weave-library-info
  • context-weave-library-list
  • context-weave-library-reset
  • context-weave-library-update
  • context-weave-model-profile
  • context-weave-parse-content
  • context-weave-provider
  • context-weave-query-history
  • context-weave-record-ingest
  • context-weave-rerank
  • context-weave-retrieve
  • context-weave-source-map
  • context-weave-source-profile
  • context-weave-split

Keywords

  • node-red
  • rag
  • retrieval

Maintainers