Metadata-Version: 2.4
Name: olav
Version: 0.21.0
Summary: OLAV — AI-native platform for autonomous operations with domain-aware agents, API-as-Tool, and Agent Harness
Project-URL: Homepage, https://github.com/olav-ai/olav
Project-URL: Repository, https://github.com/olav-ai/olav
Author: OLAV Team
License: BSL-1.1
License-File: LICENSE
Keywords: agent,agentic-platform,aiops,api-as-tool,deepagents,langgraph
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: System :: Networking :: Monitoring
Requires-Python: >=3.11
Requires-Dist: ddgs>=9.0
Requires-Dist: deepagents-code>=0.1.8
Requires-Dist: duckdb-engine>=0.17.0
Requires-Dist: duckdb>=0.8.0
Requires-Dist: fastapi>=0.109.0
Requires-Dist: google-genai>=1.70.0
Requires-Dist: httpx>=0.24.0
Requires-Dist: keyring>=24
Requires-Dist: lancedb[pylance]>=0.29.2
Requires-Dist: langchain-community>=0.4.1
Requires-Dist: langchain-core<2.0,>=1.4.0
Requires-Dist: langchain-huggingface>=0.1.0
Requires-Dist: langchain-ollama>=0.1.0
Requires-Dist: langchain-openai>=0.0.1
Requires-Dist: langchain<1.4,>=1.3.0
Requires-Dist: langgraph-api>=0.7.100
Requires-Dist: langgraph-checkpoint-sqlite>=3.0.0
Requires-Dist: langgraph-runtime-inmem>=0.27.3
Requires-Dist: langgraph<1.3,>=1.2.0
Requires-Dist: nest-asyncio>=1.5.0
Requires-Dist: ntc-templates>=9.1.0
Requires-Dist: numpy>=2.4.1
Requires-Dist: pandas>=3.0.1
Requires-Dist: prompt-toolkit>=3.0.0
Requires-Dist: pydantic-settings>=2.0
Requires-Dist: pydantic>=2.0
Requires-Dist: python-crontab>=3.0.0
Requires-Dist: python-dateutil>=2.8.0
Requires-Dist: python-frontmatter>=1.1.0
Requires-Dist: pytz>=2024.1
Requires-Dist: pyyaml>=6.0
Requires-Dist: requests>=2.31.0
Requires-Dist: rich>=13.0
Requires-Dist: sentence-transformers>=5.2.3
Requires-Dist: sqlalchemy>=2.0
Requires-Dist: tenacity>=8.0
Requires-Dist: textfsm>=2.1.0
Requires-Dist: typer>=0.9.0
Requires-Dist: uvicorn[standard]>=0.27.0
Provides-Extra: dev
Requires-Dist: black>=23.0; extra == 'dev'
Requires-Dist: mypy>=1.5.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest-timeout>=2.4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Provides-Extra: graph
Requires-Dist: networkx>=3.6.1; extra == 'graph'
Provides-Extra: ldap
Requires-Dist: ldap3>=2.9; extra == 'ldap'
Provides-Extra: redaction
Requires-Dist: netconan>=0.13; extra == 'redaction'
Provides-Extra: tui
Requires-Dist: pyjwt>=2.12.1; extra == 'tui'
Description-Content-Type: text/markdown

<p align="center">
  <img src="src/olav_logo.png" alt="OLAV Logo" width="200">
</p>

<h1 align="center">OLAV 🐺</h1>

<p align="center">
  <strong>Online Analytical Vertex for Agentic Operations</strong><br>
  AI-native platform for autonomous infrastructure operations.
</p>

<p align="center">
  <a href="https://pypi.org/project/olav/">
    <img src="https://img.shields.io/badge/version-v0.18.0-blue" alt="Version">
  </a>
  <a href="">
    <img src="https://img.shields.io/badge/license-BSL--1.1-green" alt="License">
  </a>
  <a href="">
    <img src="https://img.shields.io/badge/python-3.11+-yellow" alt="Python">
  </a>
  <a href="https://docs.olavai.com">
    <img src="https://img.shields.io/badge/docs-docs.olavai.com-blue" alt="Docs">
  </a>
  <a href="https://olavai.com">
    <img src="https://img.shields.io/badge/website-olavai.com-blueviolet" alt="Website">
  </a>
</p>

<p align="center">
  <a href="src/README_ZH.md">中文文档</a>
</p>

> Control your infrastructure with natural language. Connect any REST API in one command, query it instantly, generate environment-aware automation scripts — no MCP servers, no code generation, no runtime complexity.

```bash
pip install olav
olav registry register http://netbox:8000        # connect any API
olav "how many devices are in NetBox?"            # query immediately
olav --agent netops "write a backup script"          # generate real scripts
```

[Quick Start](#quick-start) | [Docs](https://docs.olavai.com) | [中文](src/README_ZH.md)

---

## Why OLAV?

### API-as-Service — Beyond MCP

MCP requires a server process per service, stdio/HTTP transport, and framework-specific adapters. OLAV takes a different approach:

```
MCP:   Service → MCP server process → stdio/HTTP → adapter → agent
OLAV:  Service → olav registry register → reference markdown → api_request → done
```

One command. No server processes. No generated code. No runtime overhead.

```bash
# Register once
olav registry register http://netbox:8000

# Query from any agent, forever
olav "how many devices are in NetBox?"
olav --agent netops "compare OLAV database vs NetBox — are they in sync?"
```

The `api_request` tool is **schema-aware** — it reads API reference docs generated at registration time, handles pagination (DRF/NetBox style), and manages auth (JWT/Bearer/API-key) automatically.

### Three Agents — Strict Tool Isolation

```
olav "list all devices"                  → Core Agent (database + knowledge base)
olav --agent netops "simulate link failure" → Ops Agent (network operations + SSH)
olav --agent audit "run health check"    → Audit Agent (compliance + learning)
```

Core agent uses a **subagent architecture** — the orchestrator sees only 5 tools:

```
core orchestrator (5 tools: execute_sql, olav_recall_memory, web_search, format_and_export, olav_delegate)
  ├── db_query    — database queries, knowledge base, web search, export
  ├── api_query   — API requests, health checks, web search, export
  ├── remote      — SSH to servers, local shell commands
  └── admin       — platform management, deployment, cron
```

Each subagent has **only the tools it needs**. `execute_sql` and `api_request` are in different subagents — the LLM cannot confuse them. Principle of least authority, enforced by the harness.

### 7-Layer Write Security

AI agents that can write to production need more than HITL approval:

| Layer | Defense | Bypassable? |
|-------|---------|:-----------:|
| `--enable-api-write` | Write mode locked by default | No |
| `services.yaml readonly_only` | Per-service read/write control | Config only |
| Dry-run simulation | Must pass before approval offered | No |
| HITL approval | User sees diff, then confirms | **Not skippable** |
| `sandbox_guard hard_block` | HTTP writes in isolated sandbox | **Not skippable** |
| `unshare --net` | Kernel-level network isolation | **Not skippable** |
| Audit trail | Every api_request logged | — |

`--dangerously-skip-permissions` bypasses tool approval for testing — but **cannot** bypass API write approval. Network devices are always read-only.

### Agent Harness — The OS for AI Agents

Every agent decision passes through a mandatory execution control layer:

```
Layer 0: AAA        Token/LDAP/OIDC auth → RBAC → full audit trail
Layer 1: Middleware  HITL interception + memory injection
Layer 2: Sandbox    Pre-scan → DuckDB read-only → network namespace isolation
Layer 3: Output     Credential redaction + SSE encoding
```

### Self-Improving Loop

```
Use OLAV → audit log captures every tool call
    → failure patterns extracted → written to LanceDB memory
    → future runs recall constraints before acting
```

Export as SFT/trajectory training data: `olav log export sft`.

---

## Quick Start

```bash
# 1. Install
pip install olav

# 2. Initialize
olav init

# 3. Configure LLM
nano .olav/config/api.json   # set shared.api_key + llm.model

# 4. Connect a service
olav registry register http://netbox:8000

# 5. Query
olav "how many devices are in NetBox?"
```

### Network Operations (optional)

```bash
olav agent install /path/to/olav-netops/          # adds netops + devops workspaces
                                                   # (legacy alias: `olav skill install`)

olav --agent netops "/netops_init"                 # collect device data via SSH
olav --agent netops "simulate R2 link failure"     # What-If analysis
olav --agent netops "deploy digital twin"          # ContainerLab validation
```

### Other Interfaces

```bash
olav                            # interactive TUI
olav service start --all        # web UI at localhost:2280
olav --agent core "run: df -h"  # shell commands via Core Agent
```

---

## Architecture

```
olav v0.18.0 (pip install olav)
├── core orchestrator (5 tools)
│   ├── db_query    — execute_sql, olav_recall_memory, web_search, format_and_export
│   ├── api_query   — api_request, service_health, web_search, format_and_export
│   ├── remote      — remote_execute (SSH), run_shell
│   └── admin       — workspace_health, bulk_ingest, deploy/stop_service, cron, ...
│
olav-netops v0.19.0 (olav agent install olav-netops/)
├── netops orchestrator
│   ├── probe    — Parallel SSH with command whitelist (Nornir)
│   ├── analysis — Dijkstra + ECMP simulation (networkx)
│   ├── diff     — Cross-snapshot drift detection
│   └── lab      — ContainerLab digital twin + commit-validate
├── audit
│   ├── design   — Compliance profiles + health reports
│   └── learn    — TextFSM template learning
└── netops.*     — DuckDB tables + TextFSM collection pipeline
```

**Tech Stack**: LangChain · LangGraph · DeepAgents · DuckDB · LanceDB · FastAPI · NetworkX

---

## Documentation

**Docs**: [docs.olavai.com](https://docs.olavai.com) · **Website**: [olavai.com](https://olavai.com)

---

## License

[BSL-1.1](LICENSE) — Business Source License 1.1
