home / skills / basedhardware / omi / omi-plugin-development

omi-plugin-development skill

/.cursor/skills/omi-plugin-development

This skill guides Omi plugin development, including webhook patterns, chat tools, and OAuth flows to streamline building robust integrations.

npx playbooks add skill basedhardware/omi --skill omi-plugin-development

Review the files below or copy the command above to add this skill to your agents.

Files (5)
SKILL.md
5.5 KB
---
name: omi-plugin-development
description: "Omi plugin app development webhook patterns chat tools OAuth flows prompt-based apps integration apps FastAPI Express"
---

# Omi Plugin Development Skill

This skill provides guidance for developing Omi plugins/apps, including webhook patterns, chat tools, and OAuth flows.

## When to Use

Use this skill when:
- Creating new Omi plugins/apps
- Implementing webhook handlers
- Adding chat tools for LangGraph
- Setting up OAuth integrations
- Building prompt-based apps

## Key Patterns

### Plugin Types

#### 1. Prompt-Based Apps
**No server required** - Just define prompts

- **Chat prompts**: Customize AI personality
- **Memory prompts**: Customize memory extraction

#### 2. Integration Apps
**Requires server endpoint** - Webhook-based

- **Memory triggers**: Webhook on memory creation
- **Real-time transcript**: Webhook for live transcripts
- **Chat tools**: Custom tools for LangGraph
- **Audio streaming**: Raw audio processing

### Webhook Patterns

#### Memory Creation Webhook

```python
from fastapi import FastAPI
from pydantic import BaseModel

app = FastAPI()

class MemoryWebhook(BaseModel):
    id: str
    content: str
    category: str
    user_id: str

@app.post("/webhook/memory-created")
async def memory_created(webhook: MemoryWebhook):
    """Called when a memory is created."""
    # Process memory
    # Can create new memories via API
    # Can trigger actions
    return {"status": "processed"}
```

#### Real-time Transcript Webhook

```python
@app.post("/webhook/transcript")
async def transcript_segment(segment: dict):
    """Called with live transcript segments."""
    text = segment.get("text")
    
    # Process in real-time
    if "hey omi" in text.lower():
        await trigger_action()
    
    return {"status": "received"}
```

### Chat Tools

#### Creating a Chat Tool

```python
from langchain.tools import tool

@tool
def my_custom_tool(query: str) -> str:
    """Description of what this tool does.
    
    Args:
        query: The search query
        
    Returns:
        Results as a string
    """
    result = perform_search(query)
    return json.dumps(result)

# Register in app configuration
CHAT_TOOLS = [my_custom_tool]
```

**Usage**: Tool becomes available in agentic chat path when app is enabled

### OAuth Integration

#### Setting Up OAuth

```python
from authlib.integrations.fastapi_oauth2 import OAuth2

oauth = OAuth2(
    client_id=os.getenv("CLIENT_ID"),
    client_secret=os.getenv("CLIENT_SECRET"),
    server_metadata_url="https://accounts.google.com/.well-known/openid-configuration",
)

@app.get("/auth")
async def auth():
    return await oauth.google.authorize_redirect(
        redirect_uri="https://your-app.com/callback"
    )
```

### Plugin Configuration

#### App Manifest

```json
{
  "id": "my-plugin",
  "name": "My Plugin",
  "description": "Plugin description",
  "capabilities": [
    "memory_trigger",
    "real_time_transcript",
    "chat_tools"
  ],
  "webhook_url": "https://your-app.com/webhook"
}
```

## Common Tasks

### Creating a New Plugin

1. Choose plugin type (prompt-based or integration)
2. Set up server (if integration app)
3. Implement webhook handlers
4. Register plugin in Omi app
5. Test with webhook.site first

### Adding Chat Tools

1. Create tool function with `@tool` decorator
2. Write clear tool description
3. Register in app configuration
4. Tool becomes available when app enabled

### Setting Up OAuth

1. Create OAuth app in provider (Google, Apple, etc.)
2. Configure redirect URIs
3. Implement OAuth flow in plugin
4. Store tokens securely

## Best Practices

1. **Error Handling**: Handle webhook errors gracefully
2. **Idempotency**: Make webhooks idempotent
3. **Rate Limiting**: Implement rate limiting
4. **Security**: Verify webhook signatures
5. **Documentation**: Document your plugin API
6. **Testing**: Test with webhook.site first

## Related Documentation

**The `docs/` folder is the single source of truth for all user-facing documentation, deployed at [docs.omi.me](https://docs.omi.me/).**

- **Plugin Introduction**: `docs/doc/developer/apps/Introduction.mdx` - [View online](https://docs.omi.me/doc/developer/apps/Introduction)
- **Integrations**: `docs/doc/developer/apps/Integrations.mdx` - [View online](https://docs.omi.me/doc/developer/apps/Integrations)
- **Chat Tools**: `docs/doc/developer/apps/ChatTools.mdx` - [View online](https://docs.omi.me/doc/developer/apps/ChatTools)
- **OAuth**: `docs/doc/developer/apps/Oauth.mdx` - [View online](https://docs.omi.me/doc/developer/apps/Oauth)
- **Prompt-Based Apps**: `docs/doc/developer/apps/PromptBased.mdx` - [View online](https://docs.omi.me/doc/developer/apps/PromptBased)
- **Audio Streaming**: `docs/doc/developer/apps/AudioStreaming.mdx` - [View online](https://docs.omi.me/doc/developer/apps/AudioStreaming)
- **Submitting Apps**: `docs/doc/developer/apps/Submitting.mdx` - [View online](https://docs.omi.me/doc/developer/apps/Submitting)
- **Plugin Development**: `.cursor/rules/plugin-development.mdc`

## Related Cursor Resources

### Rules
- `.cursor/rules/plugin-development.mdc` - Plugin development patterns
- `.cursor/rules/plugin-apps-js.mdc` - JavaScript plugin patterns
- `.cursor/rules/backend-api-patterns.mdc` - Backend API patterns
- `.cursor/rules/backend-architecture.mdc` - Backend architecture

### Subagents
- `.cursor/agents/plugin-developer/` - Uses this skill for plugin development

### Commands
- `/create-plugin` - Uses this skill for plugin scaffolding
- `/create-app` - Uses this skill for app creation

Overview

This skill guides developers through building Omi plugins and apps, covering webhook patterns, chat tools, OAuth flows, and prompt-based integrations. It focuses on practical patterns for FastAPI/Express endpoints, real-time transcription, chat tool registration, and secure OAuth setup. The guidance is focused on outcomes: reliable webhooks, reusable chat tools, and safe token handling.

How this skill works

The skill describes two primary plugin types: prompt-based apps that require no server and integration apps that expose webhook endpoints. It provides concrete webhook handlers for memory creation and live transcript segments, examples for registering chat tools, and OAuth flow snippets for common providers. It also outlines manifest configuration and testing approaches to validate behavior before production.

When to use it

  • When creating a new Omi plugin or app
  • When implementing webhook handlers for memories or transcripts
  • When adding agentic chat tools for LangGraph-style agents
  • When integrating third-party OAuth providers (Google, Apple, etc.)
  • When building prompt-based experiences without a backend

Best practices

  • Handle webhook errors and return clear HTTP statuses
  • Design webhooks to be idempotent to avoid duplicate processing
  • Verify webhook signatures and authenticate incoming requests
  • Rate-limit processing paths and protect expensive operations
  • Store OAuth tokens securely and rotate credentials when possible
  • Document endpoints and test with webhook inspection tools before production

Example use cases

  • Prompt-based assistant embedded in a wearable that customizes responses with no server
  • Integration app that receives memory-created webhooks and triggers follow-up actions
  • Real-time transcription webhook that listens for wake words and fires automations
  • Chat tool providing a domain-specific search or data lookup for agentic conversations
  • OAuth-enabled app that links user accounts to external providers and syncs data

FAQ

Do prompt-based apps require any server infrastructure?

No. Prompt-based apps can run entirely client-side by defining prompts and personalities; no server endpoint is required.

How should I test webhooks before deploying?

Use webhook inspection services or tools like webhook.site to validate payloads, confirm idempotency, and exercise retry scenarios before going live.