Omnara Agent Dashboard

repository·main·Indexed 25 days ago

https://github.com/omnara-ai/omnara

A mission control platform for AI agents (such as Claude Code and Codex CLI) providing real-time visibility and human-in-the-loop interaction. The project includes an MCP Server, Python SDK, a Next.js web dashboard, and a React Native mobile app for iOS and Android.

Tokens
63.8K
Snippets
184
Records
422
Agent score
82%

What's inside omnara

  1. Overview of Omnara Infrastructure

    main
    The infrastructure/ directory contains the DevOps, deployment, and infrastructure-related tooling for Omnara. It is organized into Docker configurations for containerized deployment and utility scripts for development workflows such as linting, formatting, and database initialization.
  2. Overview of Omnara capabilities

    main

    Omnara provides mission control for AI agents, enabling real-time visibility and two-way communication. Key integration paths include:

    • CLI Integration: Run AI coding agents with full dashboard sync.
    • n8n Workflows: Add human-in-the-loop capabilities to your automations.
    • Python SDK: Build custom agent integrations.
    • REST API: Direct API access for any platform.
  3. Overview of Shared infrastructure architecture

    main

    The shared directory provides the single source of truth for database operations and configurations across the Omnara platform. It includes:

    • Database Layer: Uses SQLAlchemy 2.0+ (declarative mapping) with PostgreSQL. It manages centralized schema definitions and session handling.
    • Configuration Management: Uses Pydantic settings for environment-aware configuration (development, production) and multiple deployment scenarios.
    • Schema Migrations: Uses Alembic for version-controlled schema changes and safe rollbacks.

    This architecture ensures consistency between the API backend and MCP servers.

  4. Overview of Omnara user-facing applications

    main

    The Omnara platform provides multiple user-facing applications to monitor and interact with AI agents in real-time:

    • Web Dashboard: A Next.js web interface for real-time agent monitoring and interaction.
    • Mobile App: A React Native application for iOS and Android that provides real-time notifications and agent communication.
    • Shared Frontend Packages: Common components and utilities used by both the web and mobile applications to ensure consistency.
  5. Choose an Omnara connection type

    main

    Omnara supports two connection types depending on your AI client:

    1. SSE (Server-Sent Events) (Recommended)

      • Clients: cursor, claude
      • Benefits: Hosted service, no local setup required.
    2. stdio (Local MCP server)

      • Clients: cline, roo-cline, windsurf, witsy, enconvo
      • Benefits: Local execution, full control.
  6. Backend API Architecture and Structure

    main

    The backend is built with FastAPI and organized into the following core components:

    • api/: RESTful API route handlers organized by domain.
    • auth/: Authentication and authorization logic.
    • db/: Database queries and data access layer.
    • models.py: Pydantic models defining API contracts (request/response schemas).
    • main.py: The application entry point and configuration.
    • tests/: The API functionality test suite.
  7. Understand the Omnara Platform Architecture

    main

    Omnara acts as a synchronization layer between AI Agents and Client Applications (Web/Mobile). The architecture is divided into several layers:

    • Integration Layer: Provides multiple ways to interact with the platform, including a Python SDK, Node.js CLI, MCP (Model Context Protocol), and a REST API.
    • API Layer:
      • Backend API (FastAPI): Handles read operations and serves Web/Mobile clients via WebSocket/REST.
      • Servers API (FastAPI + MCP): Handles write operations (e.g., from agents) via port :8080.
    • Authentication: Uses Supabase Auth for web users and Custom JWT for agent authentication.
    • Data Layer: Uses PostgreSQL for primary storage and an optional Redis Cache.

    Integration Methods by Agent Type

    • Claude Code / Cursor: Connect via MCP.
    • GitHub Copilot: Connect via REST API.
    • Custom Agents: Connect via the Python SDK.
  8. Understand Claude Code Action capabilities

    main

    The @anthropic-ai/claude-code-action GitHub integration provides an automated agent that interacts with your repository via comments.

    Key Capabilities:

    • Single-Comment Communication: Claude operates by updating a single initial comment with progress and results rather than posting multiple new comments.
    • Code Implementation & Review: It can implement simple to moderate code changes, answer questions about the codebase, and perform code reviews by analyzing PR changes.
    • Pull Request Preparation: It creates commits on a branch and provides a link to a prefilled PR creation page.
    • Smart Branching Logic:
      • On an Issue: Always creates a new branch for the work.
      • On an Open PR: Pushes directly to the existing PR branch.
      • On a Closed PR: Creates a new branch (as the original is inactive).
    • CI/CD Visibility: If configured with actions: read permissions, Claude can view workflow runs, job logs, and test results on the tagged PR.
  9. Manage Agent Instances and Conversations

    main
    In Omnara, an agent_instance_id represents a single conversation thread. Use the same agent_instance_id across all nodes in a single n8n workflow to ensure all messages are grouped together. This allows the Omnara dashboard to track the entire workflow as a single session.
  10. Manage Themes with ThemeProvider and useTheme

    main

    To enable runtime theme management, wrap your application in the ThemeProvider and use the useTheme hook to control or access the current theme state.

    Setup Theme Provider

    Wrap your main App component with ThemeProvider from @/lib/theme/ThemeProvider:

    import { ThemeProvider } from '@/lib/theme/ThemeProvider';
    
    function App() {
      return (
        <ThemeProvider defaultTheme="dark">
          <YourAppContent />
        </ThemeProvider>
      );
    }

    Using Theme Context

    Access theme, setTheme, and toggleTheme via the useTheme hook:

    import { useTheme } from '@/lib/theme/ThemeProvider';
    
    function MyComponent() {
      const { theme, setTheme, toggleTheme } = useTheme();
      
      return (
        <button onClick={toggleTheme}>
          Current theme: {theme}
        </button>
      );
    }
    import { ThemeProvider } from '@/lib/theme/ThemeProvider';
    
    function App() {
      return (
        <ThemeProvider defaultTheme="dark">
          <YourAppContent />
        </ThemeProvider>
      );
    }
    
    // In a component
    import { useTheme } from '@/lib/theme/ThemeProvider';
    
    function MyComponent() {
      const { theme, setTheme, toggleTheme } = useTheme();
      return <button onClick={toggleTheme}>{theme}</button>;
  11. Run the Omnara Write Operations Server

    main

    The Omnara write operations server provides a unified interface for AI agents to send messages, receive user feedback, and manage session lifecycles. It supports both MCP (Model Context Protocol) and REST API interfaces.

    To run the server, ensure you are in the project root with your virtual environment activated and execute the following command:

    python -m servers.app
  12. Use Automatic Mode Detection in Claude Code Action

    main

    The anthropics/claude-code-action@v1 action automatically detects the execution mode based on your workflow configuration:

    1. Automation Mode (Agent Mode): Triggered when a prompt input is provided. This is used for direct execution without requiring mentions, ideal for automated PR reviews or scheduled tasks.
    2. Interactive Mode (Tag Mode): Triggered when no prompt is provided but @claude is mentioned in comments, an issue is assigned to the claude user, or a label is applied. This mode creates tracking comments with progress checkboxes.
    3. No Action: If neither a prompt is provided nor @claude is mentioned, the action does nothing.
    ### Automation Mode (Agent Mode)
    ```yaml
    - uses: anthropics/claude-code-action@v1
      with:
        anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
        prompt: |
          Check for outdated dependencies and create an issue if any are found.
        # Automatically runs in agent mode when prompt is provided

    Interactive Mode (Tag Mode)

    - uses: anthropics/claude-code-action@v1
      with:
        anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
        # No prompt needed - responds to @claude mentions