Skip to content

Agent Mate is a highly modular, async-powered backend framework designed for seamless integration with Omi. It enables AI agents to ingest, process, and relay structured information from multiple data sources like Gmail, Notion, and more β€” delivering it back to Omi in the form of conversations or memories.

License

Notifications You must be signed in to change notification settings

ibrahimAlbyrk/AgentMate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Agent Mate

Modular Β· Event-Driven Β· AI-Powered
The cognitive bridge between your world and Omi.


πŸš€ Overview

Agent Mate is a highly modular, async-powered backend framework designed for seamless integration with Omi. It enables AI agents to ingest, process, and relay structured information from multiple data sources like Gmail, Notion, and more β€” delivering it back to Omi in the form of conversations or memories.


🧠 Key Capabilities

  • πŸ”„ Real-Time & Scheduled Data Collection
  • 🧠 AI-Based Summarization & Classification
  • βš™οΈ Dynamic Plugin-based Agent/Subscriber System
  • πŸ”— Seamless Omi Memory & Conversation API Integration
  • 🚦 Async Architecture + Redis Event Bus
  • πŸ”„ Automatic Retry & Rate Limit Management
  • πŸ” OAuth-Based Auth

πŸ—οΈ Architecture

AgentMate/
β”œβ”€β”€ Agents/             # Data source agents like Gmail and LLM
β”œβ”€β”€ Connectors/         # External system connectors (e.g., Omi)
β”œβ”€β”€ Core/               # Core logic: EventBus, config, DI, logging, retry
β”œβ”€β”€ DB/                 # Database structure: models, schemas, repos, services
β”œβ”€β”€ Engines/            # AI processing engines (Classifier, Summarizer, Queue, Token tools)
β”œβ”€β”€ Plugins/            # Plugin system interfaces and implementations
β”œβ”€β”€ Routers/            # FastAPI endpoint routers
β”œβ”€β”€ Subscribers/        # Event subscribers / consumers
└── main.py             # Entry point of the application

πŸ”Œ Agent Overview

Agent Status Functionality
GmailAgent βœ… Periodically fetches and classifies emails
NotionAgent πŸ”œ Extracts content blocks and page metadata
CalendarAgent πŸ”œ Pulls upcoming events
FacebookAgent πŸ”œ Reads user feed and messages
InstagramAgent πŸ”œ Captures post insights and messages
YouTubeAgent πŸ”œ Gathers video metadata and notifications
WhatsAppAgent πŸ”œ Parses chat messages for intent and memory
DiscordAgent πŸ”œ Listens to server channels and DMs
LinkedInAgent πŸ”œ Extracts professional interactions and alerts

All agents implement the shared IAgent interface, and are registered via AgentFactory.


πŸ§ͺ AI Engine Layer

The NLP processing pipeline supports:

  • πŸ“ Summarization (OpenAI, GPT)
  • πŸ—‚οΈ Classification
  • 🧠 Memory & Conversation Mapping
  • 🧾 Intent/NLU & Entity Extraction (NER)

All processors are pluggable and can be run in parallel using asyncio.


πŸ” Event-Driven System

We utilize Redis Pub/Sub to:

  • Trigger agents dynamically
  • Communicate between micro-modules
  • Schedule async background jobs
  • Broadcast processed data to WebSocket endpoints

🧩 Design Patterns

Pattern Purpose
Factory Create agents dynamically
Observer Manage event subscriptions
Strategy NLP engine logic
Adapter Normalize 3rd-party APIs
Builder Format memory/conversation payloads
DI Plugin/subscriber/service injection

🧱 Database Schema

user_settings

Column Type Description
uid TEXT Omi user ID
service_name TEXT Agent name (gmail, etc.)
service_id TEXT OAuth/session token key
config JSONB Agent config JSON
is_logged_in BOOLEAN Service login status

processed_data

Column Type Description
uid TEXT User ID
service TEXT Agent name
data_type TEXT summary, classify
content TEXT Final processed result

🧠 Omi Integration


πŸ› οΈ Setup Guide

Requirements

  • Python 3.9+
  • PostgreSQL
  • Redis
  • Docker (optional)

Installation

git clone https://github.com/ibrahimAlbyrk/AgentMate.git
cd AgentMate

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

cp .env.template .env
# Update .env with your values

Run Server

python main.py

πŸ§‘β€πŸ’» Developer Usage

Create a New Agent

class MyAgent(IAgent):
    VERSION = AgentVersion(1, 0, 0)

    async def _initialize_impl(self): ...
    async def _run_impl(self): ...
    async def _stop_impl(self): ...

Add a Subscriber

class MySubscriber(BaseSubscriber):
    async def setup(self, event_bus, **services): ...
    async def handle_event(self, data): ...
    async def stop(self): ...

πŸ“‘ API Reference

πŸ‘€ User Settings

Method Endpoint Description
POST /settings/ Create or update user settings
GET /settings/{uid}/{service_name} Fetch user settings for specific service

βš™οΈ Service Configuration

Method Endpoint Description
GET /{service}/get-settings Retrieve merged config (user + default)
POST /{service}/update-settings Update user config and restart agent

πŸ” Auth System

Method Endpoint Description
GET /{service}/login Begin OAuth login
GET /{service}/callback OAuth callback
GET /{service}/is-logged-in Check login state
POST /{service}/login-directly Login using known service ID
POST /{service}/logout Logout and revoke token

πŸ€– Agent Status

Method Endpoint Description
GET /agent/status Show currently active agents for user

πŸ“© Gmail API

Method Endpoint Description
GET /gmail/get-email-subjects Fetch recent email subjects
POST /gmail/convert-to-memory Convert selected/last emails to memory

πŸ”§ Admin Tools

Method Endpoint Description
GET /admin/user-count Return total unique user count
GET /admin/users-info Return total unique user count
and users' services status, logged-in status

Info: To use the users-info API, you need to send the x_admin_token info as a query. You can assign from the .env

πŸ”„ Composio Webhook

Method Endpoint Description
POST /composio/webhook Webhook listener for composio actions

🧠 Omi Integration

Method Endpoint Description
GET /setup-complete Check if user's setup is complete

🌐 WebSocket

Method Endpoint Description
WS /ws/{uid} WebSocket endpoint for real-time events

πŸ“„ License

MIT License – see LICENSE file.


Build AI agents that truly think, act, and integrate β€” with Agent Mate.

About

Agent Mate is a highly modular, async-powered backend framework designed for seamless integration with Omi. It enables AI agents to ingest, process, and relay structured information from multiple data sources like Gmail, Notion, and more β€” delivering it back to Omi in the form of conversations or memories.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages