Skip to main content
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. 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 requests
import time

API = "https://sdk.senso.ai/api/v1"
HDR = {
    "X-API-Key": "YOUR API KEY",
    "Content-Type": "application/json"
}

print("🚀 Senso API Quickstart Demo")
print("=" * 40)

# 1) CREATE CONTENT - Upload raw text content
print("\n1️⃣ Creating content...")
content_data = {
    "title": "Senso Platform Overview",
    "summary": "An introduction to Senso's content alignment capabilities",
    "text": """Senso is a powerful platform that aligns content with conversations. 
    It provides AI-powered search and generation capabilities that help developers 
    build intelligent applications. With Senso, you can easily store, search, 
    and generate contextually relevant content using advanced vector embeddings 
    and large language models."""
}

create_response = requests.post(
    f"{API}/content/raw",
    headers=HDR,
    json=content_data
)

if create_response.status_code == 202:
    content_result = create_response.json()
    content_id = content_result["id"]
    print(f"✅ Content queued for processing! ID: {content_id}")
    
    # Poll for completion
    print("⏳ Waiting for content processing to complete...")
    max_attempts = 30  # 30 seconds max
    for attempt in range(max_attempts):
        status_response = requests.get(
            f"{API}/content/{content_id}",
            headers=HDR
        )
        
        if status_response.status_code == 200:
            status_data = status_response.json()
            processing_status = status_data.get("processing_status", "unknown")
            
            if processing_status == "completed":
                print(f"✅ Content processing completed!")
                break
            elif processing_status == "failed":
                print(f"❌ Content processing failed!")
                exit(1)
            else:
                print(f"⏳ Status: {processing_status} (attempt {attempt + 1}/{max_attempts})")
                time.sleep(1)
        else:
            print(f"⚠️ Could not check status: {status_response.status_code}")
            time.sleep(1)
    else:
        print("⚠️ Timeout waiting for content processing")
        # Continue anyway - content might still be usable
else:
    print(f"❌ Failed to create content: {create_response.status_code}")
    print(create_response.text)
    exit(1)

# 2) SEARCH - Query the content
print("\n2️⃣ Searching content...")
search_data = {
    "query": "What is Senso and what capabilities does it provide?",
    "max_results": 5
}

search_response = requests.post(
    f"{API}/search",
    headers=HDR,
    json=search_data
)

if search_response.status_code == 200:
    search_result = search_response.json()
    print(f"✅ Search completed in {search_result['processing_time_ms']}ms")
    print(f"📝 Answer: {search_result['answer']}")
    print(f"📊 Found {search_result['total_results']} results")
else:
    print(f"❌ Search failed: {search_response.status_code}")
    print(search_response.text)

# 3) GENERATE - Create new content based on existing content
print("\n3️⃣ Generating content...")
generate_data = {
    "content_type": "blog_post",
    "instructions": "Write a brief introduction paragraph for developers who want to get started with Senso",
    "save": False,
    "max_results": 3
}

generate_response = requests.post(
    f"{API}/generate",
    headers=HDR,
    json=generate_data
)

if generate_response.status_code == 200:
    generate_result = generate_response.json()
    print(f"✅ Content generated in {generate_result['processing_time_ms']}ms")
    print(f"📄 Generated text:\n{generate_result['generated_text']}")
    print(f"🔗 Used {len(generate_result['sources'])} source(s)")
else:
    print(f"❌ Generation failed: {generate_response.status_code}")
    print(generate_response.text)

print("\n🎉 Quickstart demo completed!")
print("Visit https://docs.senso.ai for more examples and documentation.")
PrerequisiteEnsure you have received the “Your Senso Platform Access” email containing your unique API key and access domain. Contact tom@senso.ai if you require assistance.

Sample Projects

I