Step by step
Select the app and switch auth for the sources tools
The sources tools authenticate in app-token or B2B mode with an explicit appId. Store the token with ethora-app-select { appId, appToken }, which defaults the session to app-token mode, or ethora-configure { appToken } then ethora-auth-use-app. Switch back with ethora-auth-use-user before the agent tools, which reject app tokens.
Crawl the website
ethora-sources-site-crawl-v2 { url, followLink } ingests a URL and returns once the job is accepted; followLink: true follows in-domain links. ethora-sources-site-crawl-v2-wait { url, followLink, timeoutMs } blocks until crawl and embedding finish; on a timeout the job may still complete, so check ethora-sources-site-list-v2 before crawling again.
Upload documents
ethora-sources-docs-upload-v2 { files } takes one to five files as base64, PDF or text among others, 50MB each; an unsupported type returns 422. ethora-sources-docs-list-v2 shows each document’s id, name and tags. The legacy ethora-sources-docs-upload does the same in user auth for an app you own.
Tag sources so each agent retrieves the right slice
ethora-sources-site-tags-update-v2 { sourceId, tags } and ethora-sources-docs-tags-update-v2 { docId, tags } replace the tag set; not additive, and [] clears it. An agent created with ragTags retrieves only from sources carrying those tags, so one app can give each agent its own slice.
Create the agent that uses the sources
Back in user mode, ethora-agents-create-v2 { name, prompt, isRAG: true, ragTags } creates the persona; tune it later with ethora-agents-update-v2. Invite it to a room and ask a question with ethora-chats-message-v2 { waitForReplySec } to confirm it answers from the right material.
You: Crawl harbor-physio.example with linked pages, tag it public, make Front Desk answer only from public sources.
Assistant: ethora-sources-site-crawl-v2-wait { url, followLink: true, timeoutMs: 600000 } ... done in 84s.
ethora-sources-site-tags-update-v2 { sourceId, tags: ["public"] } ... ok.
ethora-agents-create-v2 { name: "Front Desk", isRAG: true, ragTags: ["public"] } ... created.Keep it fresh and prune
ethora-sources-site-reindex-v2 { urlId } re-crawls and re-embeds a source in place (ethora-sources-site-reindex-v2-wait blocks). Remove sources with ethora-sources-site-delete-url-v2-batch { ids } (1 to 100 ids) or ethora-sources-docs-delete-v2 { docId }; both delete the embeddings too and are irreversible.
The tools this uses
Names and descriptions come from the server’s own tool list. Read-only tools are safe to auto-approve; destructive ones make your client ask first. Full reference.
| Tool | Name | What it does | Access |
|---|---|---|---|
| Crawl Website Source | ethora-sources-site-crawl-v2 | Crawl a website URL and ingest its content into an app’s RAG sources (app-token / B2B variant of ethora-sources-site-crawl). | write |
| Crawl Website Source and Wait | ethora-sources-site-crawl-v2-wait | Crawl a website URL and block until the server finishes - a single-call, long-timeout variant of ethora-sources-site-crawl-v2 (same crawl + embed effect). | write |
| Reindex Website Source | ethora-sources-site-reindex-v2 | Re-crawl and re-embed a previously crawled URL by its urlId, refreshing its RAG content (app-token / B2B variant of ethora-sources-site-reindex). | write |
| List Website Sources | ethora-sources-site-list-v2 | List an app’s crawled website sources, including each source’s id, URL, and current RAG tags. | read-only |
| Update Website Source Tags | ethora-sources-site-tags-update-v2 | Set the RAG retrieval tags on a crawled website source - replaces the source’s tag set with the provided tags array (not additive; pass [] to clear all). | write |
| Delete Website Source URLs | ethora-sources-site-delete-url-v2-batch | Bulk-remove crawled website sources (1-100) from an app in one call, matched by their source record ids. | destructive |
| Upload Knowledge Document | ethora-sources-docs-upload-v2 | Upload documents (1-5; PDF, text, etc.) into an app’s RAG sources (app-token / B2B variant of ethora-sources-docs-upload). | write |
| List Knowledge Documents | ethora-sources-docs-list-v2 | List an app’s ingested documents, including each document’s id, name, and current RAG tags. | read-only |
| Update Knowledge Document Tags | ethora-sources-docs-tags-update-v2 | Set the RAG retrieval tags on an ingested document - replaces the document’s tag set with the provided tags array (not additive; pass [] to clear all). | write |
| Delete Knowledge Document | ethora-sources-docs-delete-v2 | Remove a previously ingested document from an app’s RAG sources by docId (app-token / B2B variant of ethora-sources-docs-delete). | destructive |
| Create Agent | ethora-agents-create-v2 | Create a reusable AI agent (POST /v2/apps/:appId/agents). | write |
| Update Agent | ethora-agents-update-v2 | Update a saved AI agent (PUT /v2/agents/:agentId). | write |
A physiotherapy practice grounds its agent
“For my Harbor Physio app, crawl harbor-physio.example including linked pages and upload the attached cancellation policy PDF. Tag the website public and the PDF policy. Then create an agent called Front Desk that answers only from public and policy sources, put it in Reception and ask it what the cancellation window is.”
ethora-app-select{ appId: "66f1a0b2c3d4e5f60718293a", appToken: "********" }ethora-sources-site-crawl-v2-wait{ url: "https://harbor-physio.example", followLink: true, timeoutMs: 600000 }ethora-sources-docs-upload-v2{ files: [ cancellation-policy.pdf as base64 ] }ethora-sources-site-list-v2{ appId: "66f1a0b2c3d4e5f60718293a" }ethora-sources-site-tags-update-v2{ sourceId: "src_9c1e", tags: ["public"] }ethora-sources-docs-tags-update-v2{ docId: "doc_41ab", tags: ["policy"] }ethora-auth-use-user{}ethora-agents-create-v2{ name: "Front Desk", prompt: "Answer patient questions using only the practice website and policy documents.", isRAG: true, ragTags: ["public", "policy"] }ethora-agent-invite-to-chat{ agentIdOrAddress: "66f1a1c4d5e6f7a8b9c0d1e2", chatJid: "66f1a0b2c3d4e5f60718293a_reception" }ethora-chats-message-v2{ text: "What is the cancellation window?", roomJid: "66f1a0b2c3d4e5f60718293a_reception", waitForReplySec: 45 }
An app whose sources are the practice website and a policy PDF, tagged, with an agent in Reception answering from them only.
Good to know
- Ids feed other tools: source ids from
ethora-sources-site-list-v2go into tags-update, reindex and batch delete; document ids fromethora-sources-docs-list-v2go into docs tags-update and delete. ethora-sources-site-delete-url-v2(single) matches the exact stored URL string; the batch variant matches record ids.- The
-waittools can time out on large sites while the job still completes server-side; list the sources before retrying. - Legacy user-auth routes
ethora-sources-docs-uploadandethora-sources-docs-deletelet an owner skip the app-token switch.
