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
- Key Features
- Installation
- Quick Start
- Project Structure
- CLI Commands
- Framework Configurations
- Core Concepts
- Observability & Dashboard
- 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
- Create a New Project Antilogix comes with a CLI tool to scaffold your application structure.
antilogix new my_agent_app
cd my_agent_app
- Setup Environment
Create a
.envfile 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...
- 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)
- Generate Configuration:
antilogix docker
(Creates Dockerfile & .dockerignore)
2. Build Image:
docker build -t my_antilogix_app .
- Run Container:
docker run -p 8000:8000 --env-file .env my_antilogix_app
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea74b4d7180f0bd81e0216785cefc73aec40c744b70d88a40261a7b4dc068519
|
|
| MD5 |
0cbc2e9b136d6bb46fde3395e3c12b37
|
|
| BLAKE2b-256 |
80a2d46873e59c89d7d94b74c0cbb6002b67fe431c852eea407e6ee88a033dbe
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b36bc0884eaf30a2979e6924d0c5bba45a75e206043cb04bc0092c31aa587ee2
|
|
| MD5 |
f04d57fa7f27ff9d016dcee0b1b26260
|
|
| BLAKE2b-256 |
21a774ed9b6ea8cb8cb54448633cd5fdeac64c2b49ed3bcec7165cf957ee4a10
|