TW

twinmind-sdk-patterns

Provides standardized patterns for implementing TwinMind's memory and meeting intelligence REST API in TypeScript and Python projects.

Install

mkdir -p .claude/skills/twinmind-sdk-patterns && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/8863" && unzip -o skill.zip -d .claude/skills/twinmind-sdk-patterns && rm skill.zip

Installs to .claude/skills/twinmind-sdk-patterns

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Apply production-ready TwinMind SDK patterns for TypeScript and Python.
71 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Wrap REST API calls with authentication headers
  • Store and retrieve AI memory context
  • Integrate meeting transcripts for action item extraction
  • Implement batch operations with rate limiting
  • Handle HTTP 429 retry logic

How it works

The client wrapper manages authentication via a requests session and provides methods to interact with the TwinMind REST API for memory storage and meeting context analysis.

Inputs & outputs

You give it
Meeting transcript and participant list
You get back
Extracted action items and meeting insights

When to use twinmind-sdk-patterns

  • Refactoring existing TwinMind API integrations
  • Implementing TwinMind client wrappers
  • Setting up memory retrieval logic
  • Standardizing TwinMind SDK usage across a codebase

About this skill

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

ErrorCauseSolution
401 UnauthorizedInvalid API keyVerify TWINMIND_API_KEY
429 Rate LimitedToo many requestsRespect Retry-After header
404 Not FoundInvalid memory/meeting IDValidate IDs before lookup
Empty search resultsQuery too specificBroaden query terms

Examples

Full Meeting Workflow

client = TwinMindClient()
# After meeting ends
ctx = client.create_meeting_context(
    meeting_id="mtg-123",
    transcript=transcript_text,
    participants=["[email protected]", "[email protected]"]
)
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

When not to use it

  • Hardcoding API keys in source code
  • Ignoring Retry-After headers during rate limits

Prerequisites

TwinMind API keyrequests library

Limitations

  • 401 Unauthorized on invalid keys
  • 429 Rate Limited on excessive requests
  • 404 Not Found on invalid IDs

How it compares

This pattern centralizes authentication and error handling logic compared to writing raw API requests in every module.

Compared to similar skills

twinmind-sdk-patterns side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
twinmind-sdk-patterns (this skill)027dReviewIntermediate
mcp-builder1363moReviewAdvanced
stripe-integration482moNo flagsAdvanced
copilot-sdk74moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

mcp-builder

anthropics

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

136215

stripe-integration

wshobson

Implement Stripe payment processing for robust, PCI-compliant payment flows including checkout, subscriptions, and webhooks. Use when integrating Stripe payments, building subscription systems, or implementing secure checkout flows.

48165

copilot-sdk

github

Build agentic applications with GitHub Copilot SDK. Use when embedding AI agents in apps, creating custom tools, implementing streaming responses, managing sessions, connecting to MCP servers, or creating custom agents. Triggers on Copilot SDK, GitHub SDK, agentic app, embed Copilot, programmable agent, MCP server, custom agent.

763

openrouter-hello-world

jeremylongshore

Create your first OpenRouter API request with a simple example. Use when learning OpenRouter or testing your setup. Trigger with phrases like 'openrouter hello world', 'openrouter first request', 'openrouter quickstart', 'test openrouter'.

733

telegram-dev

2025Emma

Telegram 生态开发全栈指南 - 涵盖 Bot API、Mini Apps (Web Apps)、MTProto 客户端开发。包括消息处理、支付、内联模式、Webhook、认证、存储、传感器 API 等完整开发资源。

232

mistral-upgrade-migration

jeremylongshore

Analyze, plan, and execute Mistral AI SDK upgrades with breaking change detection. Use when upgrading Mistral SDK versions, detecting deprecations, or migrating to new API versions. Trigger with phrases like "upgrade mistral", "mistral migration", "mistral breaking changes", "update mistral SDK", "analyze mistral version".

17

Search skills

Search the agent skills registry