Quickstart
From an org invite to a widget answering with citations, in minutes.
Where this page gets you: a page on your site with a chat widget, answering from your own documents, with citations on every answer. The only code you write is the last step — two lines of HTML.
Accept your invite and sign in
Your organization's admin invites you by email. Accept the invite and sign in at app.harnix.vn. You'll land in your organization's admin console — where agents, knowledge bases, and integration keys live.
Create an agent
Go to Agents → New agent. Pick a provider/model (OpenAI, or an OpenAI-compatible endpoint), and write a short system prompt describing what the agent does. See Build an agent for the full set of options (history window, daily token budget, activate/deactivate).
Create a knowledge base and upload documents
Go to Knowledge bases → New knowledge base, upload a few documents (PDF,
DOCX, Markdown, text — 20 MB max per file). Wait for the ingest status to turn
completed, then attach the knowledge base to the agent you just created.
Once an agent has a knowledge base attached, knowledge_search is
automatically enabled — there's no separate toggle. Details on
Knowledge bases.
Get your publishable key
Go to Integration. Copy the publishable key (pk_...) — this is the
key that's safe to sit in your page's public HTML; it isn't a secret. Add
the domain you'll embed the widget on to Allowed origins (an exact
scheme + host + port match, e.g. https://example.com) — skip this and the
widget fails with origin_not_allowed.
Embed the widget
Paste these two lines into your page, just before </body>:
<script src="https://api.harnix.vn/v2/widget/v1/widget.js" async></script>
<harnix-chat pk="pk_xxxxxxxxxxxxxxxx"></harnix-chat>Reload the page: a chat bubble appears in the bottom-right corner. See Widget for changing its position, theme, title, or embedding it inline instead of as a floating bubble.
Ask it something
Open the widget and ask a question the answer to which is in the document you just uploaded. The answer comes back with citations — the exact source in the document the agent looked up to answer, not something the model made up.
Next
- Call it directly from your backend instead of the widget: Server-to-server.
- Let the agent call external tools through an MCP server: Tools.
- Review every answer — what the model thought, which tools it called, where the citations came from — in the console: Runs & traces.