Skip to content

Flowise

Flowise talks to Suprflo over its REST API, so there is nothing to install. You add two Custom Tool nodes, one to retrieve memories and one to store them, each a short JavaScript snippet that calls the API with fetch. Both use Bearer auth against https://api.suprflo.com. The request and response shapes match rest-api.md.

Add your API key

Put your key where the snippets can read it. The simplest option is a Flowise Variable named SUPRFLO_API_KEY (Settings → Variables), referenced below as $vars.SUPRFLO_API_KEY. You can also hardcode the key while testing.

Retrieve memories

Create a Custom Tool and give it inputs for query and user_id. This tool calls POST /api/memories/search and returns the matched memory strings.

javascript
const res = await fetch("https://api.suprflo.com/api/memories/search", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": `Bearer ${$vars.SUPRFLO_API_KEY}`,
  },
  body: JSON.stringify({
    query: $query,
    filters: { user_id: $user_id },
    top_k: 10,
  }),
});

const data = await res.json();
return (data.results || []).map((r) => r.memory).join("\n");

Place this node before the LLM node. Feed the user's message in as query and their id as user_id, then inject the returned text into the LLM's system prompt as known facts about the user.

Store memories

Create a second Custom Tool with inputs for messages and user_id. This tool calls POST /api/memories, which extracts durable facts from the messages and stores them.

javascript
const res = await fetch("https://api.suprflo.com/api/memories", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": `Bearer ${$vars.SUPRFLO_API_KEY}`,
  },
  body: JSON.stringify({
    messages: $messages,
    user_id: $user_id,
  }),
});

const data = await res.json();
return JSON.stringify(data.results || []);

Place this node after the LLM node. Pass the latest conversation turn in as messages and the same id as user_id so the exchange is remembered for next time.

Wiring it together

A typical chat flow looks like this:

  1. Retrieve memories with the incoming user message as query.
  2. LLM node answers, with the retrieved memories injected into its prompt.
  3. Store the new turn so it is available on the next request.

Use the same user_id on both calls so each user's memories stay isolated.

The memory layer for AI agents.