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.zipInstalls 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.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
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
| 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=["[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
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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| twinmind-sdk-patterns (this skill) | 0 | 27d | Review | Intermediate |
| mcp-builder | 136 | 3mo | Review | Advanced |
| stripe-integration | 48 | 2mo | No flags | Advanced |
| copilot-sdk | 7 | 4mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by jeremylongshore
View all by jeremylongshore →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).
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.
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.
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'.
telegram-dev
2025Emma
Telegram 生态开发全栈指南 - 涵盖 Bot API、Mini Apps (Web Apps)、MTProto 客户端开发。包括消息处理、支付、内联模式、Webhook、认证、存储、传感器 API 等完整开发资源。
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".