Skip to content
Skillv1.0.0

twinmind-sdk-patterns

Apply production-ready TwinMind SDK patterns for TypeScript and Python. Use when implementing TwinMind integrations, refactoring API usage, or establishing team coding standards for meeting AI integra

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (plugins/saas-packs/twinmind-pack/skills/twinmind-sdk-patterns/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill twinmind-sdk-patterns. Copyright stays with the author (MIT).

TwinMind SDK Patterns

Overview

Production patterns for TwinMind's AI memory and meeting intelligence REST API. TwinMind captures, organizes, and retrieves contextual memories from conversations and meetings.

Prerequisites

  • TwinMind API key configured
  • Understanding of REST API patterns
  • Familiarity with memory/context retrieval concepts

Instructions

Step 1: Client Wrapper with Authentication

import requests
import os

class TwinMindClient:
    def __init__(self, api_key: str = None, base_url: str = "https://api.twinmind.com/v1"):
        self.api_key = api_key or os.environ["TWINMIND_API_KEY"]
        self.base_url = base_url
        self.session = requests.Session()
        self.session.headers.update({
            "Authorization": f"Bearer {self.api_key}",
            "Content-Type": "application/json"
        })

    def _request(self, method: str, path: str, **kwargs):
        response = self.session.request(method, f"{self.base_url}{path}", **kwargs)
        response.raise_for_status()
        return response.json()

Step 2: Memory Storage and Retrieval

class TwinMindClient:
    # ... (continued from Step 1)

    def store_memory(self, content: str, context: dict = None, tags: list = None) -> dict:
        return self._request("POST", "/memories", json={
            "content": content,
            "context": context or {},
            "tags": tags or [],
            "timestamp": datetime.utcnow().isoformat()
        })

    def search_memories(self, query: str, limit: int = 10, tags: list = None) -> list:
        params = {"q": query, "limit": limit}
        if tags:
            params["tags"] = ",".join(tags)
        return self._request("GET", "/memories/search", params=params)

    def get_memory(self, memory_id: str) -> dict:
        return self._request("GET", f"/memories/{memory_id}")

Step 3: Meeting Context Integration

    def create_meeting_context(self, meeting_id: str, transcript: str, participants: list) -> dict:
        return self._request("POST", "/contexts/meeting", json={
            "meeting_id": meeting_id,
            "transcript": transcript,
            "participants": participants,
            "extract_action_items": True,
            "extract_decisions": True
        })

    def get_meeting_insights(self, meeting_id: str) -> dict:
        return self._request("GET", f"/contexts/meeting/{meeting_id}/insights")

Step 4: Batch Operations with Rate Limiting

import time

def batch_store_memories(client: TwinMindClient, memories: list, batch_size: int = 20):
    results = []
    for i in range(0, len(memories), batch_size):
        batch = memories[i:i+batch_size]
        for memory in batch:
            try:
                result = client.store_memory(**memory)
                results.append({"status": "ok", "id": result["id"]})
            except requests.HTTPError as e:
                if e.response.status_code == 429:  # HTTP 429 Too Many Requests
                    time.sleep(int(e.response.headers.get("Retry-After", 5)))
                    result = client.store_memory(**memory)
                    results.append({"status": "ok", "id": result["id"]})
                else:
                    results.append({"status": "error", "error": str(e)})
        time.sleep(1)  # rate limit between batches
    return results

Error Handling

Error Cause Solution
401 Unauthorized Invalid API key Verify TWINMIND_API_KEY
429 Rate Limited Too many requests Respect Retry-After header
404 Not Found Invalid memory/meeting ID Validate IDs before lookup
Empty search results Query too specific Broaden query terms

Examples

Full Meeting Workflow

client = TwinMindClient()
# After meeting ends
ctx = client.create_meeting_context(
    meeting_id="mtg-123",
    transcript=transcript_text,
    participants=["alice@co.com", "bob@co.com"]
)
insights = client.get_meeting_insights("mtg-123")
for item in insights.get("action_items", []):
    print(f"- [{item['assignee']}] {item['task']}")

Resources

Output

  • Configuration files or code changes applied to the project
  • Validation report confirming correct implementation
  • Summary of changes made and their rationale

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-twinmind-sdk-98d38d/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-twinmind-sdk-98d38d.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-twinmind-sdk-98d38d",
  "kind": "skill",
  "name": "twinmind-sdk-patterns",
  "description": "Apply production-ready TwinMind SDK patterns for TypeScript and Python. Use when implementing TwinMind integrations, refactoring API usage, or establishing team coding standards for meeting AI integration. Trigger with phrases like \"twinmind SDK patterns\", \"twinmind best practices\", \"twinmind code patterns\", \"idiomatic twinmind\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "saas",
      "twinmind",
      "api",
      "python",
      "typescript",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Apply production-ready TwinMind SDK patterns for TypeScript and Python. Use when implementing TwinMind integrations, refactoring API usage, or establishing team coding standards for meeting AI integration. Trigger with phrases like \"twinmind SDK patterns\", \"twinmind best practices\", \"twinmind code patterns\", \"idiomatic twinmind\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "plugins/saas-packs/twinmind-pack/skills/twinmind-sdk-patterns/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/plugins/saas-packs/twinmind-pack/skills/twinmind-sdk-patterns/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/plugins/saas-packs/twinmind-pack/skills/twinmind-sdk-patterns/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Write,",
      "Edit"
    ],
    "license": "MIT"
  },
  "instructions": "# TwinMind SDK Patterns\n\n## Overview\n\nProduction patterns for TwinMind's AI memory and meeting intelligence REST API. TwinMind captures, organizes, and retrieves contextual memories from conversations and meetings.\n\n## Prerequisites\n\n- TwinMind API key configured\n- Understanding of REST API patterns\n- Familiarity with memory/context retrieval concepts\n\n## Instructions\n\n### Step 1: Client Wrapper with Authentication\n\n```python\nimport requests\nimport os\n\nclass TwinMindClient:\n    def __init__(self, api_key: str = None, base_url: str = \"https://api.twinmind.com/v1\"):\n        self.api_key = api_ke",
  "cost": {
    "context_tokens": 1097
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-twinmind-sdk-98d38d/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.