Welcome to the Senso SDK—your fast-track to enterprise-grade AI automation. With just a few endpoints you can:

  1. Ingest structured or unstructured data.
  2. Configure agent prompts to guide AI behavior.
  3. Convert that data into executable context for downstream tasks.

Result: fully closed-loop automations—think “submit support ticket ➜ draft response ➜ route to CRM”—without stitching ten services together.

Spin up a key, hit /ingest, and you’re off—no orchestration glue or boilerplate brokers needed.

What is Context OS?

Context OS is a unified knowledge layer for your application. It:

  • Ingests documents, emails, and web content.
  • Normalises every item into schema‑safe records.
  • Exposes rule‑driven endpoints so AI agents, chatbots, or workflow automations can run with minimal integration effort and always‑accurate context.

SOURCE → CONTEXT OS → DESTINATION

ComponentDescriptionDetails
SOURCEPoint any raw input at SensoPOST /content/* — files, single pages, full‑site crawls
POST /conversations — calls, chats, support‑email threads
SENSO WORKSPACEIndex, label, transform, and route the data/search, /generate — query / transform
/rules, /rules/{id}/values — classify (e.g., BUG, FEATURE)
/triggers + /webhooks — fire actions when a rule matches
DESTINATIONHandle the JSON webhook payload (your code)You expose an endpoint (GitHub, HubSpot, Slack, DB, etc.); Senso POSTs the clean JSON payload for you to process

Now we’re going to walk through the simplest end-to-end flow:

  1. Upload content (our “Hello World” text) so Senso has something to work with.
  2. Create a rule that flags any content containing the word HELLO.
  3. Register a webhook (point it at RequestBin, Hookdeck, or any public URL).
  4. Link a trigger so that every HELLO hit instantly calls your webhook.
  5. (Bonus) Run a quick search and generate to prove the Workspace can answer questions and transform text.

Paste the snippet below (after exporting SENSO_KEY) and you’ll see the complete Source → Workspace → Destination loop in action—ready to copy-paste for your own use case.

import os, requests

API  = "https://sdk.senso.ai/api/v1"
HDR  = {
    "Authorization": f"Bearer {os.environ['SENSO_KEY']}",
    "Content-Type": "application/json"
}

# 1) SOURCE – upload a tiny text file
hello = "Hello World!  Senso makes context easy."
cid = requests.post(
    f"{API}/content/raw",
    headers=HDR,
    json={"title": "hello.txt", "body": hello}
).json()["content_id"]

# 2) WORKSPACE – create rule + value ("HELLO")
rule_id = requests.post(
    f"{API}/rules",
    headers=HDR,
    json={"name": "Hello detector", "type": "classification", "target": "all"}
).json()["rule_id"]

requests.post(
    f"{API}/rules/{rule_id}/values",
    headers=HDR,
    json={"value": "HELLO"}         # rule_value_id = "HELLO"
)

# 3) DESTINATION – register a webhook (e.g., RequestBin URL)
webhook_id = requests.post(
    f"{API}/webhooks",
    headers=HDR,
    json={
        "name": "EchoBin",
        "url": "https://webhook.site/your-id",
        "auth": {"type": "none"}
    }
).json()["webhook_id"]

# 4) WORKSPACE – link trigger (value → webhook)
requests.post(
    f"{API}/triggers",
    headers=HDR,
    json={
        "name": "Echo on HELLO",
        "rule_id": rule_id,
        "rule_value_id": "HELLO",
        "webhook_id": webhook_id
    }
)

# 5) Optional: query and transform
answer = requests.post(
    f"{API}/search",
    headers=HDR,
    json={"question": "What does the file say?"}
).json()["answer"]
print("Search answer →", answer)

cap = requests.post(
    f"{API}/generate",
    headers=HDR,
    json={
        "prompt": "Return the text in ALL CAPS",
        "filter": {"content_ids": [cid]}
    }
).json()["generated_text"]
print("Generated text →", cap)

print(f"\nRule + trigger armed. Any new content containing 'HELLO' "
      f"will POST to your webhook ({webhook_id}) 🚀")

Prerequisite

Ensure you have received the “Your Senso Platform Access” email containing your unique API key and access domain. Contact [email protected] if you require assistance.

Sample Projects