Skip to main content

No project description provided

Project description

๐Ÿ›ก๏ธ Antilogix Framework

Antilogix is a production-ready, async-first Python framework designed for building "Agentic" AI applications. It bridges the gap between simple LLM scripts and complex, scalable backend systems.

Built on top of FastAPI and Uvicorn, Antilogix provides a structured "framework" experience (similar to Laravel, Next.js, or Django) specifically tailored for AI Agents.


๐Ÿ“š Table of Contents

  1. Key Features
  2. Installation
  3. Quick Start
  4. Project Structure
  5. CLI Commands
  6. Framework Configurations
  7. Core Concepts
  8. Observability & Dashboard
  9. Deployment

๐Ÿš€ Key Features

  • โšก Async-First Core: Non-blocking I/O ensures your API stays responsive even while LLMs are thinking.
  • ๐Ÿง  Universal LLM Adapter: Switch between Google Gemini, OpenAI, or Ollama just by changing a config file.
  • ๐Ÿ’พ Smart Memory: Integrated Mem0 support (Cloud & Local) gives agents long-term memory of user preferences.
  • ๐Ÿ”Œ Auto-Routing: File-based routing system. Create a file in app/http/ and it automatically becomes an API endpoint.
  • ๐Ÿ› ๏ธ Tool System: Turn any Python function into a tool the Agent can "use" (e.g., get_weather, search_db).
  • โ›“๏ธ Workflows: Orchestrate complex tasks by chaining multiple agents together (e.g., Researcher -> Writer -> Editor).
  • ๐Ÿ‘ท Job Queue: Built-in SQLite-backed background worker for handling long-running tasks without timeouts.
  • ๐Ÿ“Š Live Dashboard: Monitor request latency, errors, and agent activity in real-time.

๐Ÿ“ฆ Installation

Prerequisites

  • Python 3.10 or higher
  • pip

Install via pip

pip install antilogix

Install from Source (Development)

git clone [https://github.com/iamaqdas/antilogix.git](https://github.com/iamaqdas/antilogix.git)
cd antilogix
pip install -e .

โšก Quick Start

  1. Create a New Project Antilogix comes with a CLI tool to scaffold your application structure.
antilogix new my_agent_app
cd my_agent_app
  1. Setup Environment Create a .env file in the root directory:
# --- LLM Keys (Choose one) ---
OPENAI_API_KEY=sk-...
GEMINI_API_KEY=AIza...

# --- Memory Key (Optional but recommended) ---
# Get free key at [https://mem0.ai](https://mem0.ai)
MEM0_API_KEY=m0-xxx...
  1. Run the Server
python main.py
  • API: http://127.0.0.1:8000
  • Dashboard: http://127.0.0.1:8000/dashboard

๐Ÿ“‚ Project Structure

When you run antilogix new, the following structure is created. Understanding this is key to using the framework.

my_agent_app/
โ”œโ”€โ”€ .env                 # API Keys and Secrets (Do not commit to Git)
โ”œโ”€โ”€ antilogix.yaml        # Main Configuration (LLM model, Memory settings)
โ”œโ”€โ”€ main.py              # Application Entry Point
โ”œโ”€โ”€ Dockerfile           # (Generated via CLI) for deployment
โ”‚
โ”œโ”€โ”€ app/                 # YOUR CODE GOES HERE
โ”‚   โ”œโ”€โ”€ agents/          # Agent Logic definitions (e.g., writer.py, coder.py)
โ”‚   โ”œโ”€โ”€ http/            # API Routes (Auto-discovered)
โ”‚   โ”‚   โ”œโ”€โ”€ blog_routes.py   # -> /blog_routes/
โ”‚   โ”‚   โ””โ”€โ”€ user_routes.py   # -> /user_routes/
โ”‚   โ”œโ”€โ”€ workflows/       # Orchestration logic (Chaining agents)
โ”‚   โ””โ”€โ”€ tools/           # Python functions tools for Agents
โ”‚
โ””โ”€โ”€ config/              # Advanced configurations (optional)

๐Ÿ’ป CLI Commands

Antilogix includes a CLI tool antilogix to help you manage your project.

Command Description
antilogix new <name> Scaffolds a completely new Antilogix project in a folder named <name>.
antilogix docker Generates a production-ready Dockerfile and .dockerignore in your project root.
antilogix help Shows the help menu and available commands.

โš™๏ธ Framework Configurations

antilogix.yaml

This file controls the behavior of the framework components.

app_name: "My Antilogix App"
version: "1.0.0"
debug: true

# --- Brain (LLM) ---
llm:
  provider: "gemini"  # Options: "openai", "gemini"
  model: "gemini-1.5-flash"
  # Base URL is optional, used for proxies or OpenAI-compatible endpoints
  # base_url: "..."

# --- Memory ---
memory:
  provider: "mem0"
  user_id: "default_user"  # Fallback user ID
  # API Key is read from .env automatically

๐Ÿง  Core Concepts

1. Agents

Agents are the primary workers. They inherit from BaseAgent.

Example: app/agents/writer.py

from antilogix.agents.base import BaseAgent

class ContentWriterAgent(BaseAgent):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        
    def _set_system_prompt(self, context_notes=None):
        # Define the personality here
        self.system_prompt = "You are an expert technical writer."
        # Context notes (Memory) are injected automatically if available
        if context_notes:
            self.system_prompt += f"\nUser Context: {context_notes}"
        
        self.history = [{"role": "system", "content": self.system_prompt}]

2. Tools (Function Calling)

You can give agents "hands" to perform actions. Define a standard Python function and register it.

# 1. Define the function
def get_stock_price(symbol: str):
    """
    Fetches the current stock price for a given symbol (e.g., AAPL).
    """
    return f"The price of {symbol} is $150."

# 2. Register it in your Agent
agent = ContentWriterAgent(name="BrokerBot")
agent.register_tool(get_stock_price)

# 3. Use it
# If the user asks "What is Apple's price?", the Agent will automatically 
# execute get_stock_price("AAPL") and use the result.

3. Memory (Persistent Context)

Antilogix uses Mem0 to store user facts. This happens automatically if memory is configured in antilogix.yaml.

  • Saving: Every user interaction is saved to the cloud.
  • Retrieving: Before answering, the Agent searches Memory for relevant context (e.g., "User likes concise answers") and injects it into the prompt.

4. Workflows (Orchestration)

Chain multiple agents together for complex tasks.

Example: app/workflows/news_flow.py

from antilogix.workflows.engine import Workflow
from app.agents.researcher import ResearcherAgent
from app.agents.writer import ContentWriterAgent

async def run_pipeline(topic: str):
    # 1. Setup Agents
    researcher = ResearcherAgent(name="Sherlock")
    writer = ContentWriterAgent(name="Shakespeare")

    # 2. Create Flow
    flow = Workflow(name="News Generator")
    
    # 3. Define Steps (Output of Step 1 -> Input of Step 2)
    flow.add_step(researcher) # Finds facts
    flow.add_step(writer)     # Writes article based on facts

    # 4. Run
    return await flow.run(topic)

5. Async Background Jobs

For tasks that take longer than 30 seconds (e.g., generating a book), use the Queue system to prevent HTTP timeouts.

Pushing a Job:

from antilogix.services.queue import QueueService

queue = QueueService.get_instance()
job_id = await queue.push({"topic": "Write a book about AI"})

The built-in worker process handles this in the background automatically.


๐Ÿ“Š Observability & Dashboard

Antilogix includes a built-in Metrics Dashboard.

  • URL: http://127.0.0.1:8000/dashboard
  • Features:
  • Average API Latency.
  • Recent Requests log.
  • Status Codes (200 vs 500 errors).

๐Ÿณ Deployment (Docker)

  1. Generate Configuration:
antilogix docker

(Creates Dockerfile & .dockerignore) 2. Build Image:

docker build -t my_antilogix_app .
  1. Run Container:
docker run -p 8000:8000 --env-file .env my_antilogix_app

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

antilogix-0.1.5.tar.gz (647.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

antilogix-0.1.5-py3-none-any.whl (701.5 kB view details)

Uploaded Python 3

File details

Details for the file antilogix-0.1.5.tar.gz.

File metadata

  • Download URL: antilogix-0.1.5.tar.gz
  • Upload date:
  • Size: 647.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for antilogix-0.1.5.tar.gz
Algorithm Hash digest
SHA256 ea74b4d7180f0bd81e0216785cefc73aec40c744b70d88a40261a7b4dc068519
MD5 0cbc2e9b136d6bb46fde3395e3c12b37
BLAKE2b-256 80a2d46873e59c89d7d94b74c0cbb6002b67fe431c852eea407e6ee88a033dbe

See more details on using hashes here.

File details

Details for the file antilogix-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: antilogix-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 701.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for antilogix-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b36bc0884eaf30a2979e6924d0c5bba45a75e206043cb04bc0092c31aa587ee2
MD5 f04d57fa7f27ff9d016dcee0b1b26260
BLAKE2b-256 21a774ed9b6ea8cb8cb54448633cd5fdeac64c2b49ed3bcec7165cf957ee4a10

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page