Skip to content

Sentinel Framework

Sentinel is an async-first Python framework for building production-ready AI Agents. It provides the scaffolding, memory, and tooling needed to take an LLM script and turn it into a scalable web application.

Quick Start

1. Installation

pip install antilogix

2. Create a Project

sentinel new my_ai_app
cd my_ai_app

3. Set API Keys

Open .env and add your keys:

GEMINI_API_KEY=AIza...
OPENAI_API_KEY=sk-...
MEM0_API_KEY=m0-...

4. Run It

python main.py

Visit http://127.0.0.1:8000/dashboard to verify it's running.


Setup & Configuration

Prerequisites

  • Python 3.10+
  • Redis (optional, for async queues)
  • API key for at least one LLM provider

Configuration File (sentinel.yaml)

app_name: "My Financial Agent"
debug: true

llm:
  provider: "gemini" # or "openai"
  model: "gemini-1.5-flash"
  temperature: 0.7

memory:
  provider: "mem0"
  user_id: "default_user"

Environment Variables

OPENAI_API_KEY=sk-...
GEMINI_API_KEY=AIza...
MEM0_API_KEY=m0-xxx

Agents

Agents combine an LLM brain with instructions and tools.

from antilogix.agents.base import BaseAgent

class SupportAgent(BaseAgent):
    def _set_system_prompt(self, context_notes=None):
        self.system_prompt = (
            "You are a helpful customer support assistant. "
            "Be polite and concise."
        )

        if context_notes:
            self.system_prompt += f"\nUser History: {context_notes}"

        self.history = [{"role": "system", "content": self.system_prompt}]

Tools

def check_order_status(order_id: str):
    return f"Order {order_id} is SHIPPED."

agent = SupportAgent(name="SupportBot")
agent.register_tool(check_order_status)

response = await agent.think("Where is my order #123?")

Memory

Sentinel integrates with Mem0 for long-term memory.

from antilogix.container import ServiceContainer

container = ServiceContainer.get_instance()
memory = container.get_memory()

await memory.save("User prefers dark mode", user_id="user_123")
facts = await memory.retrieve("What does the user like?", user_id="user_123")

Async Jobs

For long-running tasks, use the job queue.

from fastapi import APIRouter
from antilogix.services.queue import QueueService

router = APIRouter()
queue = QueueService.get_instance()

@router.post("/generate-book")
async def generate_book(topic: str):
    job_id = await queue.push({
        "task_type": "write_book",
        "topic": topic
    })
    return {"status": "queued", "job_id": job_id}
job = await queue.get_status(job_id)
if job["status"] == "COMPLETED":
    print(job["result"])