Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions networks/infra-genius/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# InfraGenius Environment Configuration
# Copy this file to .env and fill in your API keys

# =============================================================================
# GROQ - Agent Reasoning (Required)
# =============================================================================
# Get your free API key at: https://console.groq.com
# Used for the agent's LLM reasoning (llama-3.3-70b-versatile)
GROQ_API_KEY=your-groq-api-key-here
CUSTOM_API_KEY=your-groq-api-key-here

# =============================================================================
# E2B - Cloud Sandboxes (Optional)
# =============================================================================
# Get your API key at: https://e2b.dev
# Used for provisioning cloud sandboxes for deployment testing
E2B_API_KEY=your-e2b-api-key-here

# =============================================================================
# NEBIUS - MemU Memory (Required for memory features)
# =============================================================================
# Get your API key at: https://nebius.com
# Used for MemU long-term memory (chat + embeddings)
NEBIUS_API_KEY=your-nebius-api-key-here

# MemU Configuration
MEMU_BASE_URL=https://api.tokenfactory.nebius.com/v1/
MEMU_CHAT_MODEL=Qwen/Qwen3-30B-A3B-Instruct-2507
MEMU_EMBED_MODEL=BAAI/bge-multilingual-gemma2
MEMU_DB_PATH=infra_memory.db

# =============================================================================
# GITHUB - Private Repos (Optional)
# =============================================================================
# Only needed if deploying from private repositories
GITHUB_TOKEN=
221 changes: 221 additions & 0 deletions networks/infra-genius/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
# 🚀 InfraGenius - AI DevOps Agent with Memory

> **OpenAgents PR Hackathon 2026 Submission**
>
> An AI infrastructure automation agent that remembers your deployments and learns over time.

[![OpenAgents](https://img.shields.io/badge/OpenAgents-v0.8.5-blue)](https://openagents.org)
[![MemU](https://img.shields.io/badge/MemU-Memory-green)](https://github.com/NevaMind-AI/memU)
[![E2B](https://img.shields.io/badge/E2B-Sandboxes-orange)](https://e2b.dev)

## 🎯 What is InfraGenius?

InfraGenius is an AI agent that automates infrastructure tasks through natural language. Unlike traditional DevOps tools, InfraGenius **remembers** your past deployments, configurations, and even errors — learning from experience to provide smarter assistance over time.

**Key Innovation:** Integration of [MemU](https://github.com/NevaMind-AI/memU) long-term memory with OpenAgents, enabling stateful DevOps automation.

## ✨ Features

| Feature | Description |
|---------|-------------|
| 🧠 **Long-term Memory** | Remembers deployments, configs, and learnings across sessions |
| 🔍 **Semantic Search** | Find past deployments by meaning, not just keywords |
| 📦 **E2B Sandboxes** | Provision cloud sandboxes for safe deployment testing |
| 💬 **Natural Language** | Deploy apps with simple commands like "deploy my-app" |
| 🔄 **Learning** | Stores error fixes and applies them to future deployments |

## 🏃 Quick Start

### Prerequisites

- Python 3.11+
- [Groq API Key](https://console.groq.com) (free tier available)
- [E2B API Key](https://e2b.dev) (optional, for sandbox deployments)
- [Nebius API Key](https://nebius.com) (for MemU memory)

### Installation

```bash
# Clone the repository
git clone https://github.com/Nsuccess/Infra-genius.git
cd Infra-genius

# Install dependencies
pip install openagents==0.8.5 e2b-code-interpreter requests memu-py>=1.1.0

# Configure environment
cp .env.example .env
# Edit .env with your API keys
```

### Configuration

Edit `.env` with your API keys:

```env
# Groq for agent reasoning (fast LLM)
GROQ_API_KEY=your-groq-key
CUSTOM_API_KEY=your-groq-key

# E2B for cloud sandboxes (optional)
E2B_API_KEY=your-e2b-key

# Nebius for MemU memory (chat + embeddings)
NEBIUS_API_KEY=your-nebius-key
MEMU_BASE_URL=https://api.tokenfactory.nebius.com/v1/
MEMU_CHAT_MODEL=Qwen/Qwen3-30B-A3B-Instruct-2507
MEMU_EMBED_MODEL=BAAI/bge-multilingual-gemma2
```

### Launch

**Terminal 1 - Start Network:**
```bash
openagents network start .
```

**Terminal 2 - Start Agent:**
```bash
# Windows PowerShell (load env vars first)
Get-Content .env | ForEach-Object { if ($_ -match '^([^#][^=]*)=(.*)$') { [Environment]::SetEnvironmentVariable($matches[1], $matches[2], 'Process') } }
openagents agent start ./agents/deployer.yaml

# Linux/Mac
export $(cat .env | xargs) && openagents agent start ./agents/deployer.yaml
```

**Open Studio:** http://localhost:8700/studio

## 💡 Example Conversations

### Basic Interaction
```
You: Hi!
InfraGenius: I can provision and list E2B cloud sandboxes, store/retrieve
info in memory. How can I help you?
```

### Memory Operations
```
You: Remember that I prefer deploying Node.js apps to E2B
InfraGenius: ✅ Stored in memory: [DEPLOYMENT] I prefer deploying Node.js apps to E2B

You: What do you remember about my preferences?
InfraGenius: Found 1 memory: You prefer deploying Node.js apps to E2B
```

### Sandbox Operations
```
You: Provision a sandbox called my-app
InfraGenius: ✅ Sandbox provisioned!
📦 Name: my-app
🆔 ID: sbx-abc123
🔗 URL: https://8000-sbx-abc123.e2b.app

You: List my sandboxes
InfraGenius: 📦 Active Sandboxes:
• my-app (ID: sbx-abc123)
```

## 📁 Project Structure

```
infra-genius/
├── agents/
│ └── deployer.yaml # Agent configuration
├── tools/
│ ├── infra.py # E2B sandbox tools
│ └── memory.py # MemU memory tools
├── network.yaml # OpenAgents network config
├── .env.example # Environment template
└── README.md # This file
```

## 🔧 Agent Tools

### Infrastructure Tools
| Tool | Description |
|------|-------------|
| `provision_sandbox` | Create a new E2B cloud sandbox |
| `list_sandboxes` | List all active sandboxes |
| `run_command` | Execute shell commands in sandbox |
| `deploy_app` | Full deployment pipeline |

### Memory Tools (MemU)
| Tool | Description |
|------|-------------|
| `remember` | Store information in long-term memory |
| `recall` | Search memory semantically |
| `list_memories` | Show stored memories |
| `remember_deployment` | Store structured deployment record |
| `find_deployments` | Search past deployments |

## 🏗️ Architecture

```
┌─────────────────────────────────────────────────────────┐
│ OpenAgents Studio │
│ http://localhost:8700 │
└─────────────────────────┬───────────────────────────────┘
┌─────────────────────────▼───────────────────────────────┐
│ OpenAgents Network │
│ (HTTP:8700 / gRPC:8600) │
└─────────────────────────┬───────────────────────────────┘
┌─────────────────────────▼───────────────────────────────┐
│ InfraGenius Agent │
│ (llama-3.3-70b via Groq) │
├─────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────┐ │
│ │ Infra Tools │ │ Memory Tools│ │ Messaging Tools │ │
│ │ (E2B) │ │ (MemU) │ │ (OpenAgents) │ │
│ └──────┬──────┘ └──────┬──────┘ └────────────────┘ │
└─────────┼────────────────┼──────────────────────────────┘
│ │
▼ ▼
┌──────────┐ ┌──────────────┐
│ E2B │ │ MemU │
│ Sandbox │ │ Memory │
│ Cloud │ │ (Nebius) │
└──────────┘ └──────────────┘
```

## 🎬 Demo Video

[Link to 3-minute demo video - Coming Soon]

The demo shows:
1. Network and agent startup
2. Memory operations (remember/recall)
3. Sandbox provisioning
4. Natural language infrastructure commands

## 🛠️ Tech Stack

| Component | Technology |
|-----------|------------|
| Agent Framework | [OpenAgents v0.8.5](https://github.com/openagents-org/openagents) |
| Long-term Memory | [MemU](https://github.com/NevaMind-AI/memU) |
| LLM (Agent) | Groq (llama-3.3-70b-versatile) |
| LLM (Memory) | Nebius (Qwen3-30B + BGE embeddings) |
| Sandboxes | [E2B](https://e2b.dev) |

## 🤝 Related Hackathon Submissions

This project is part of a multi-hackathon effort:

| Hackathon | Submission | Status |
|-----------|------------|--------|
| **OpenAgents** | InfraGenius (this repo) | ✅ Submitted |
| **MemU** | 8 PRs (adapters, memory types) | ✅ All passing CI |

## 📄 License

MIT

---

**Built for the OpenAgents PR Hackathon 2026** 🚀

*An AI DevOps agent that remembers your infrastructure and manages it over time.*
68 changes: 68 additions & 0 deletions networks/infra-genius/agents/deployer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# InfraGenius Deployer Agent
# Infrastructure automation agent with memory

type: "openagents.agents.collaborator_agent.CollaboratorAgent"
agent_id: "deployer"

config:
model_name: "llama-3.3-70b-versatile"
provider: "custom"
api_base: "https://api.groq.com/openai/v1"

instruction: |
You are InfraGenius, an infrastructure automation agent.

When you receive a message, respond to the sender using send_direct_message.
Be concise and helpful.

react_to_all_messages: true

tools:
- name: "provision_sandbox"
description: "Provision a new E2B cloud sandbox"
implementation: "tools.infra.provision_sandbox"
input_schema:
type: object
properties:
name:
type: string
description: "Name for the sandbox"
required: ["name"]

- name: "list_sandboxes"
description: "List all active E2B sandboxes"
implementation: "tools.infra.list_sandboxes"
input_schema:
type: object
properties: {}

- name: "remember"
description: "Store info in long-term memory"
implementation: "tools.memory.remember"
input_schema:
type: object
properties:
content:
type: string
description: "What to remember"
required: ["content"]

- name: "recall"
description: "Search memory for info"
implementation: "tools.memory.recall"
input_schema:
type: object
properties:
query:
type: string
description: "What to search for"
required: ["query"]

mods:
- name: "openagents.mods.workspace.messaging"
enabled: true

connection:
host: "localhost"
port: 8700
transport: "grpc"
Loading