Self-Hosting an AI Brand Monitoring Tool on Supabase

Self-hosting on Supabase turns shifting AI answers into data you own.

· 9 min read
Cover illustration for “Self-Hosting an AI Brand Monitoring Tool on Supabase”
AI Analytics Tools · November 11, 2026 · 9 min read · 1,929 words

When teams in answer engine optimization and GEO self-host an AI brand monitoring tool on Supabase, they own their prompts, model responses, and trend metrics. Teams aim to replace a subscription and to build a controlled measurement pipeline that repeats prompts, preserves every response, and turns changing AI recommendations into evidence the team can use.

Why AI assistants have become a brand discovery channel that existing monitoring tools were not built for

ChatGPT, Gemini, Claude, and Perplexity compose brand recommendations before a user ever reaches a website. That puts an assistant between the buyer and the business, deciding which names to include and how to describe them. A recommendation can shape the buyer’s shortlist without producing a click. Traditional monitoring tools track links, rankings, and social mentions, but those signals do not show whether an assistant recommended the brand.

A mention is not necessarily an endorsement, either. An answer can name one brand as a passing example while steering the buyer toward a competitor. Counting citations alone can thus make a brand look more visible than it is. The missing measurement is not simply whether a brand appeared, but what role it played in the answer.

Why AI brand visibility is hard to measure reliably, regardless of which tool a team uses

AI can give different answers to the same question. SparkToro research found that hundreds of recommendation prompts run nearly 3,000 times produced the same brand list in the same order less than one time in a thousand. That variation reflects the model’s behavior and can occur independently of the monitoring system. One answer is not a dependable baseline. A system that treats it as one makes normal changes in answers look like gains and losses.

Brand presence is more stable than exact ordering. The same research found that strong brands appeared in roughly 60–90% of answers for a given question. That makes mention rate, the fraction of runs containing a brand, a more useful signal than a single ranked list. The practical rule is to run each prompt at least three times per session, or five times in competitive categories. Every run needs its own stored record so the rate can be calculated later.

Personalization can also change the answers when teams test through a consumer interface. Research across multiple user personas found 33.3 percentage points of history-associated brand divergence in Gemini, while Claude showed no detectable effect. User history can therefore become part of what the test measures. API calls with no user history, fixed temperature settings, and consistent phrasing remove that variable and make the measurement conditions more reproducible. They do not make every answer identical.

What metrics a self-hosted AI brand monitor needs to capture, and why each one matters

The schema should keep four measurements separate, namely mention rate, position or share of voice, sentiment, and citation sources. Each answers a different question. Mention rate establishes whether the brand is regularly present, with appearance in 70% of category-query runs describing a different position from appearance in 10%. Position records where it appears relative to competitors. Citation-based AI share of voice uses the formula (brand citations ÷ total category citations) × 100, while rank helps show whether the brand is just included or recommended first.

Sentiment records whether the answer frames the brand in a positive, neutral, mixed, or negative way. Presence alone can hide a serious problem. A response may recommend a brand but give the wrong pricing, or attach caveats drawn from outdated reviews. The classification should distinguish omission as the highest-severity failure, misrepresentation as medium-high, and negative framing as medium. Claim accuracy needs its own field because a claim can sound good and still be wrong and harmful.

Citation sources identify the URLs shaping the answer and help direct content or PR work. Model-level separation is essential here. The overlap between brands mentioned and brands cited runs as high as 64% on Google AI Overviews and as low as 30% on Gemini, so a blended score hides meaningful differences. For implementation, each run needs prompt text, model, timestamp, brand_mentioned, mention type, rank, sentiment, claim accuracy, source URLs, and fix_needed.

Why data ownership is a structural argument for self-hosting, not just a preference

A monitoring history is the baseline against which future changes are judged. When prompts, responses, competitive benchmarks, and trends live in a vendor’s database, changing tools can mean losing that baseline. When the team self-hosts, those records are in its own database. Ownership changes what survives a tool change. It also keeps the prompt library and the competitive intelligence it contains under the team’s control.

Pricing can work against sound measurement, too. Per-seat or per-prompt charges encourage fewer questions and less frequent testing, even though repeated runs are necessary to calculate meaningful mention rates. With bring-your-own-key access, API charges go directly to model providers at published rates, without a monitoring vendor’s markup. Self-hosted storage removes the additional per-prompt monitoring charge while leaving the costs of model calls and infrastructure in place. Repetition still costs something, but it no longer has that extra pricing constraint.

The data-quality argument is separate from the cost argument. A controlled API pipeline fixes the prompt phrasing and temperature setting and excludes user history, while a consumer chat session can mix those influences together. Self-hosting alone does not create that discipline. Its value is that the team owns both the records and the conditions under which they are collected.

What Supabase provides as the foundation for a self-hosted brand monitoring stack

Supabase brings the database and supporting services into one open-source stack. Its self-hosted components include Postgres, Auth, PostgREST, Realtime, Storage, Edge Functions running on a server-side runtime, and Studio, deployed through Docker Compose on the team’s own servers. Postgres stores the prompt library and the records of each run, and Edge Functions do the API and processing work. The database remains the center of the system. The other services make those records accessible without requiring a separate application for every task.

Supabase says the minimum hardware needed is 4 GB RAM, 2 CPU cores, and 40 GB SSD, so a basic setup can run on a single low-cost VPS. For this monitoring stack, the key distinction is between using the hosted service and running the open-source stack on the team’s infrastructure. Studio provides an immediate place to query and chart metrics, so a separate BI dashboard is not required on day one.

The stack also supports semantic search through pgvector. That allows searches for responses describing a brand as expensive, rather than only responses containing an exact phrase. Automatic Embeddings create and update embeddings as rows change, so the search layer stays up to date as new responses come in. Search can follow meaning. This helps when different models make the same claim in different words as the response history grows.

How the data flow works end-to-end, from scheduled prompt to queryable brand metric

The pipeline begins with a schedule that triggers an Edge Function, using an external cron where needed. The prompt library in Postgres supplies the questions and the repetition count for each one. Each session then runs as planned without depending on someone to rerun an answer that seems surprising.

The function then calls the model APIs directly with the team’s own keys. Each call uses the chosen fixed temperature setting and excludes user history, keeping the conditions consistent across sessions. ChatGPT, Claude, and Gemini responses can then be tracked separately against the same prompt. Every response remains an individual observation. Combining them at this stage would discard the evidence needed to calculate mention rate and inspect variation.

Next, a second call to an LLM for classification turns each raw answer into a structured JSON object. Its fields include brand_mentioned, mention_type, rank, competitors_mentioned, sentiment, citation_present, cited_domains, source_type, claim_accuracy, and fix_needed. This is where judgments become explicit. Whether a mention is mixed or negative becomes a recorded classification rather than an unstated interpretation made while reading a dashboard. The raw response text stays with the parsed fields so historical answers can be reclassified if the schema changes.

Finally, each classified run becomes one Postgres row containing the prompt, model, run_timestamp, raw text, and parsed fields. Those rows support trend queries without requiring the answers to be parsed again for every report. Embeddings on the response text add searches for particular claims or clusters of related answers. Realtime subscriptions can support alerts when sentiment drops or a competitor’s mention rate crosses a threshold.

How to build and maintain the prompt library that determines what the pipeline actually measures

The prompt library is the contract for the measurement. A precise pipeline still produces misleading results if it asks questions that buyers would never ask. Teams should start with prompts that people write based on sales calls and support tickets, then use AI to make variants. Buyer vocabulary comes first. An LLM’s guess about the category is not a substitute for the objections and comparisons customers actually raise.

The library should cover category discovery, comparison, use-case, and branded intent. Questions such as “best [category] tools” test discovery, while “[brand] reviews” tests a different kind of visibility. A brand can perform well on the latter and disappear from the former. Comparison prompts deserve deliberate coverage because asking “[brand] vs [competitor]” forces the answer to characterize weaknesses relative to an alternative. Those answers often expose sentiment problems that discovery questions do not.

Specifics belong in prompts when they change the buying decision, including geography, company size, industry vertical, and budget tier. “Best project management tool” and “best project management tool for a 20-person engineering team under $50/seat” can produce entirely different recommendations. Fifty well-chosen prompts outperform three hundred generic ones. Store the library in Postgres with prompt versioning so revisions do not blur the historical baseline. Runs against an older version must remain separately queryable, or a changed question can masquerade as changed brand performance.

Turning stored response data into trend metrics a team can act on

A rolling 30-day mention rate, worked out for each prompt and each model, is the main sign of a trend. A drop on category discovery prompts can warn that the brand’s training-data footprint or citation presence is weakening. The model split helps locate the change. Without it, gains in one engine can conceal losses in another, leaving the team with a reassuring average and an unresolved visibility problem.

Share of voice adds the competitive view. A row-based query uses (brand rows ÷ total rows for that prompt set) × 100, grouped by model, to compare periods and tracked competitors. That calculation needs to remain distinct from the citation-based share of voice defined earlier because the denominators differ. Sentiment trends add a separate view of reputation by tracking the distribution of positive, neutral, mixed, and negative classifications. A brand can get more mentions even as answers frame it more negatively.

The fix_needed field connects those findings to work. A crawlability classification goes to technical SEO, content to the content team, citation to PR and digital authority building, and docs to product documentation. Raw text and source URLs let the receiving team inspect the claim behind an otherwise unexplained score before acting.

Studio provides SQL-based visualization for that work without a separate BI tool. If a team already has a dashboard, PostgREST exposes tables as REST endpoints, and the data can be exported to its BI layer. The team can change the reporting interface and keep the same history. That is the lasting benefit of this architecture, a measurement record the team can keep, question, and use as its monitoring needs develop.

More in AI Analytics Tools