Metadata-Version: 2.4
Name: olav
Version: 0.11.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.11.4
Requires-Dist: deepagents<1.0,>=0.5.0
Requires-Dist: duckdb-engine>=0.17.0
Requires-Dist: duckdb>=0.8.0
Requires-Dist: duckduckgo-search>=3.0.0
Requires-Dist: fastapi>=0.109.0
Requires-Dist: httpx>=0.24.0
Requires-Dist: lancedb>=0.29.2
Requires-Dist: langchain-community>=0.4.1
Requires-Dist: langchain-core>=0.1.0
Requires-Dist: langchain-ollama>=0.1.0
Requires-Dist: langchain-openai>=0.0.1
Requires-Dist: langchain>=0.1.0
Requires-Dist: langgraph-checkpoint-sqlite>=3.0.0
Requires-Dist: langgraph>=1.0.8
Requires-Dist: markdownify>=0.13.0
Requires-Dist: ncclient>=0.7.1
Requires-Dist: nest-asyncio>=1.5.0
Requires-Dist: netutils>=1.17.1
Requires-Dist: networkx>=3.6.1
Requires-Dist: ntc-templates>=9.0.0
Requires-Dist: numpy>=2.4.1
Requires-Dist: pandas>=3.0.1
Requires-Dist: pdfplumber>=0.11.9
Requires-Dist: prompt-toolkit>=3.0.0
Requires-Dist: pyang>=2.7.1
Requires-Dist: pydantic-settings>=2.0
Requires-Dist: pydantic>=2.0
Requires-Dist: pygnmi>=0.8.15
Requires-Dist: pyjwt>=2.12.1
Requires-Dist: pypdf2>=3.0.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: ruptures>=1.1.10
Requires-Dist: scikit-learn>=1.8.0
Requires-Dist: scipy>=1.17.1
Requires-Dist: sentence-transformers>=5.2.3
Requires-Dist: sqlalchemy>=2.0
Requires-Dist: tavily-python>=0.3.0
Requires-Dist: tenacity>=8.0
Requires-Dist: textfsm>=1.1.3
Requires-Dist: typer>=0.9.0
Requires-Dist: uvicorn[standard]>=0.27.0
Requires-Dist: xmltodict>=1.0.4
Requires-Dist: yangson>=1.6.7
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: enterprise
Requires-Dist: pyjwt>=2.8.0; extra == 'enterprise'
Requires-Dist: tink>=1.14.1; extra == 'enterprise'
Provides-Extra: gnmi
Requires-Dist: pygnmi>=0.8.0; extra == 'gnmi'
Provides-Extra: ldap
Requires-Dist: ldap3>=2.9; extra == 'ldap'
Provides-Extra: netops
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="">
    <img src="https://img.shields.io/badge/version-v0.10.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 API, deploy specialized AI agents, orchestrate operational workflows — without writing SQL or memorizing CLI flags.

```bash
olav "how many devices are online?"
olav "which BGP neighbors are down?"
olav --agent core "run a health check on all endpoints"
```

[Quick Start](#quick-start) | [中文](src/README_ZH.md)

---

## Why OLAV?

### API-as-Tool — Any API Becomes an Agent Tool in One Command

No code, no MCP servers. Register an OpenAPI service once, query it in natural language forever:

```bash
olav registry register http://netbox.example.com/api/schema/
olav "how many devices are in rack A1?"   # works immediately
```

The Creator Agent can also generate editable Python `@tool` functions from any OpenAPI schema for deep customization.

### Agent Harness — Four-Layer Execution Governance

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 dangerous-command interception + memory injection
Layer 2: Sandbox    Pre-scan → DuckDB read-only enforcement → network namespace isolation
Layer 3: Output     Credential auto-redaction + SSE JSON encoding + HttpOnly cookies
```

Hard constraints (DuckDB read-only) cannot be bypassed. Soft constraints (injection scanning, network isolation) are configurable.

### Self-Improving Loop — Agents Get Better Over Time

```
Use OLAV → audit log captures every tool call and error
    → /trace-review extracts failure constraints → writes to LanceDB memory
    → future runs recall constraints before acting → known pitfalls avoided
```

Data-driven improvement, not manual prompt tuning.

### Multi-Layer Cache — Measured 2000x+ Speedup

```
Tier-0: SemanticCache (LanceDB vector similarity, ~10ms)
Tier-1: LLM SQLiteCache (exact prompt match, <1ms, 0 tokens)
Tier-2: LLM API call (real network request)
```

Per-user isolation. Anthropic models automatically use prompt caching (system prompt billed once).

### Federated Specialist Agents

Not one omniscient Agent — **multiple specialists collaborating**:

- Semantic router dispatches queries to the best-fit Agent based on `route_keywords`
- Each Agent holds only its own tools (least privilege)
- Per-Agent model assignment: cheap models for frequent queries, powerful models for complex analysis — 40-70% token cost reduction
- Hot-swappable Skills: `olav skill install` extends capabilities instantly

### AAA — Authentication, Authorization, Audit

- **Auth**: none / token / LDAP / AD / OIDC; tokens stored as salted SHA256 hashes
- **RBAC**: 3 roles (admin/user/readonly) × 5 actions, fine-grained per Agent/Skill
- **Audit**: Every operation recorded to DuckDB (4 tables), SHA256 tamper-proofing (NIST AU-9), credentials auto-redacted

### Full-Stack Observability — Audit as Data Asset

Audit logs are not just compliance — they're a **continuously growing data asset**:

- Query any dimension with DuckDB SQL (token usage, cache hit rate, tool call frequency, error patterns)
- Multi-user concurrent-safe (DuckDB atomic writes, each record tagged with `user_id`)

---

## Quick Start

=== "pip install (recommended)"
    ```bash
    # 1. Install
    pip install olav

    # 2. Initialize project
    olav init                                   # creates .olav/ with config skeleton

    # 3. Configure API key (edit the generated file)
    #    Set shared.api_key in .olav/config/api.json
    #    Or use environment variables:
    export OLAV_LLM_API_KEY="sk-..."           # your LLM provider API key

    # 4. Connect a service and start querying
    olav registry register http://netbox.example.com/api/schema/
    olav "how many devices are in rack A1?"

    # Or install a community skill
    olav skill install https://github.com/olav-ai/skill-netbox
    olav "list all sites in Europe"
    ```

=== "From source (development)"
    ```bash
    # 1. Clone and install
    git clone https://github.com/olav-ai/olav.git && cd olav
    uv sync

    # 2. Initialize and configure
    uv run olav init                           # creates .olav/ with config skeleton
    # Edit .olav/config/api.json → set shared.api_key
    # Or: export OLAV_LLM_API_KEY="sk-..."
    uv run olav registry register http://netbox.example.com/api/schema/
    uv run olav "how many devices are in rack A1?"
    ```

### Other ways to use

```bash
olav                            # interactive TUI (multi-turn conversations)
olav service web start          # web UI at http://localhost:2280
olav --agent core "run: df -h"  # execute shell commands via Core Agent
```

---

## Three Interfaces

| Interface | Command | Best For |
|-----------|---------|----------|
| **CLI** | `olav "your query"` | Scripting, one-off queries, CI/CD |
| **TUI** | `olav` | Multi-turn conversations, exploration |
| **Web UI** | `olav service web start` | Team sharing, browser access |

---

## Architecture

```
User Query
    ↓
Semantic Router → selects best Agent (or --agent override)
    ↓
Agent Harness → AAA → Middleware → Sandbox
    ↓
LLM + Tool Loop (calls tools, gets results, synthesizes response)
    ↓
Response + Audit Log (automatic, every run)
```

**Tech Stack**: LangChain + LangGraph + DeepAgents + DuckDB + LanceDB + FastAPI

---

## Repository Structure

```
src/olav/          ← OLAV core platform (this repo)
src/README_ZH.md   ← 中文文档
src/olav_logo.png  ← Logo
.olav/workspace/   ← Platform agent definitions (config/ + core/)
.olav/config/      ← Runtime config (gitignored — contains API keys)
.olav/databases/   ← Runtime data (gitignored — audit logs, domain data)
```

---

## Documentation

Documentation: **[docs.olavai.com](https://docs.olavai.com)**

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

---

## License

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