agentleFS
thunderphonethunderphone/skills/add-knowledge/SKILL.md

add-knowledge

Skill0 starsChanged 57 days agoMITView on GitHub

Create, import, search, update, or attach ThunderPhone knowledge. Use when someone asks to upload documents, import a URL, create a knowledge base, wait for indexing, search retrieved content, attach knowledge_base_ids or knowledge_document_ids to an agent, or debug missing answers.

  • Reads credentials
  • Sends data out

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Prepare the source: Use content the organization is authorized to store and expose to callers.

    line 13
  2. Very specific:

    Choose a container: Use POST /v1/knowledge-bases to group related material.

    line 16
  3. Very specific:

    Search directly: Use POST /v1/knowledge/search or POST /v1/knowledge-bases/{knowledge_base_id}/search with representative caller questions.

    line 67
  4. Distinctive:

    Verify: Test exact facts, paraphrases, conflicts, missing information, and content the agent should refuse to invent.

    line 74
  5. Distinctive:

    Follow knowledge base and the knowledge API reference.

    line 89
  6. Distinctive:

    Do not upload content without rights or expose secrets and unnecessary personal data.

    line 90

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Add knowledge to an agent

  1. Prepare the source. Use content the organization is authorized to store and expose to callers. Remove secrets and unrelated personal data. Prefer clear headings, canonical facts, and one maintained source per fact.
  2. Choose a container. Use POST /v1/knowledge-bases to group related material. Use flat POST /v1/knowledge/documents for a standalone upload or text document. Use POST /v1/knowledge/documents/import-url for a permitted URL.
  3. Submit the content. For files, send multipart form data and retain the returned document ID. For URL imports, record the canonical source URL and refresh policy.

Canonical JSON request for importing a permitted web page:

{
  "url": "https://example.com/pricing",
  "name": "Pricing"
}
curl --fail-with-body -X POST https://api.thunderphone.com/v1/knowledge/documents \
  -H "Authorization: Bearer $THUNDERPHONE_API_KEY" \
  -H "X-ThunderPhone-Client: skills/add-knowledge@1.0" \
  -F "file=@$DOCUMENT_PATH"
import os, requests

with open(os.environ["DOCUMENT_PATH"], "rb") as document:
    r = requests.post("https://api.thunderphone.com/v1/knowledge/documents",
        files={"file": document},
        headers={"Authorization": f"Bearer {os.environ['THUNDERPHONE_API_KEY']}",
                 "X-ThunderPhone-Client": "skills/add-knowledge@1.0"}, timeout=120)
r.raise_for_status()
print(r.json())
import { openAsBlob } from "node:fs";
const form = new FormData();
form.set("file", await openAsBlob(process.env.DOCUMENT_PATH!));
const response = await fetch("https://api.thunderphone.com/v1/knowledge/documents", {
  method: "POST", headers: { Authorization: `Bearer ${process.env.THUNDERPHONE_API_KEY}`,
    "X-ThunderPhone-Client": "skills/add-knowledge@1.0" }, body: form,
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
  1. Wait for readiness. Poll GET /v1/knowledge/documents/{document_id} or the knowledge-base document list. Do not attach or test content still marked pending/processing. Investigate failed indexing before retrying.
  2. Search directly. Use POST /v1/knowledge/search or POST /v1/knowledge-bases/{knowledge_base_id}/search with representative caller questions. Check that the retrieved passage supports the intended answer and excludes unrelated content.
  3. Attach to the agent. Patch knowledge_base_ids and/or knowledge_document_ids, review the draft, deploy it, and run spoken test scenarios.
  4. Verify. Test exact facts, paraphrases, conflicts, missing information, and content the agent should refuse to invent. Confirm source updates are reindexed before relying on them.

Errors

SymptomCauseFix
Document remains processingImport or extraction has not completedPoll with backoff; inspect failure detail before the retry endpoint.
Search returns irrelevant passagesDocument is broad, duplicated, or poorly structuredSplit and clean sources, then re-run representative queries.
Agent cannot use ready contentIDs are not attached to the deployed revisionPatch the agent, review its draft, and deploy.
Agent states unsupported factsPrompt allows guessing or sources conflictAdd a no-invention boundary and remove or reconcile stale sources.

Source and safety rules

  • Follow knowledge base and the knowledge API reference.
  • Do not upload content without rights or expose secrets and unnecessary personal data.
  • Direct search quality is evidence for retrieval, not proof of spoken answer quality.
  • Preserve source provenance and remove stale copies rather than relying on ordering.

See references/knowledge-lifecycle.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.