Skip to content
Closed
13 changes: 13 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ name: Deploy GitHub Pages
on:
push:
branches: ["main"]
paths:
- "docs/**"
- "mkdocs.yml"
- "src/microbots/MicroBot.py"
- "src/microbots/bot/**"
- "src/microbots/llm/**"
- "src/microbots/environment/**"
- "src/microbots/tools/**"
workflow_dispatch:

permissions:
Expand All @@ -29,6 +37,11 @@ jobs:
- name: Install Zensical
run: pip install zensical

- name: Install mkdocstrings and project
Comment thread
shivashanmugam marked this conversation as resolved.
run: |
pip install "mkdocstrings[python]"
pip install -e .

- name: Build site
run: zensical build --clean

Expand Down
17 changes: 17 additions & 0 deletions docs/api-docs/bots/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Bots

This section covers the different types of bots that can be built with Microbots, along with detailed guides and examples for each type.

All bots extend the core [`MicroBot`](../components/bot.md) class with specialized system prompts, permissions, and tools.

| Bot | Purpose | Access Level |
|-----|---------|-------------|
| [LogAnalysisBot](log-analysis-bot.md) | Analyze log files and identify root causes | Read-only |
| ReadingBot | Code comprehension and analysis | Read-only |
| WritingBot | Controlled file edits | Read-write (restricted commands) |
| BrowsingBot | Web search and browsing | N/A |
| AgentBoss | Task decomposition and delegation | Read-write |
| CopilotBot | GitHub Copilot SDK wrapper | Configurable |

!!! note "Auto-generated API references"
The API references on these pages are **auto-generated from source code docstrings**. When the source code changes, the documentation updates automatically on the next build.
29 changes: 29 additions & 0 deletions docs/api-docs/bots/log-analysis-bot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# LogAnalysisBot

The `LogAnalysisBot` analyzes log files and identifies root causes of failures. It mounts a code directory as read-only context and copies the target log file into the container for analysis.

## Quick Example

```python
from microbots import LogAnalysisBot

bot = LogAnalysisBot(
model="azure-openai/gpt-4.1",
folder_to_mount="/path/to/source/code",
)

result = bot.run(file_name="/path/to/error.log")
print(result.status, result.result)
```

## How It Works

1. The source code directory is mounted **read-only** at the sandbox path for context.
2. The log file is **copied** into `/var/log/` inside the container.
3. The bot analyzes the log, cross-references with the source code, and identifies the root cause.

## API Reference

<!-- Auto-generated from source code -->

::: microbots.bot.LogAnalysisBot.LogAnalysisBot
59 changes: 59 additions & 0 deletions docs/api-docs/components/bot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Bot

The `MicroBot` class is the core autonomous agent. All specialized bots (`ReadingBot`, `WritingBot`, etc.) extend this class.

You can use `MicroBot` directly for custom bots or subclass it for specialized behavior.

## Quick Example

```python
from microbots import MicroBot
from microbots.extras.mount import Mount, MountType, PermissionLabels

bot = MicroBot(
model="azure-openai/gpt-5-swe-agent",
system_prompt="You are a helpful coding assistant.",
folder_to_mount=Mount(
host_path="code",
sandbox_path="/home/user/code",
mount_type=MountType.MOUNT,
permission=PermissionLabels.READ_ONLY,
),
)

result = bot.run(task="Analyze the project structure")
print(result.status, result.result)
```

## API Reference

<!-- Auto-generated from source code -->

!!! info "Parameters vs Attributes"
**Parameters** are the arguments you pass when creating an instance of a class (e.g., `MicroBot(model=..., system_prompt=...)`).
**Attributes** are the internal variables available on the instance after creation, used by the class during its operation.

::: microbots.MicroBot.MicroBot
options:
show_source: false


::: microbots.MicroBot.BotRunResult
options:
show_source: false

::: microbots.constants.ModelProvider
options:
show_source: false

::: microbots.extras.mount.MountType
options:
show_source: false

::: microbots.extras.mount.Mount
options:
show_source: false

::: microbots.constants.PermissionLabels
options:
show_source: false
10 changes: 10 additions & 0 deletions docs/api-docs/components/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Components

This section covers the core components of Microbots, providing in-depth explanations and API references for each.

Microbots is built around these below foundational components:

- **[Bot](bot.md)** — The core `MicroBot` class that powers all autonomous agents. Every specialized bot extends this base class.

!!! note "Auto-generated API references"
The API references on these pages are **auto-generated from source code docstrings** using [mkdocstrings](https://mkdocstrings.github.io/). When the source code changes, the documentation updates automatically on the next build.
15 changes: 15 additions & 0 deletions docs/api-docs/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# API Documentation

This section provides comprehensive API references for Microbots, auto-generated from source code docstrings. When the source code changes, the documentation updates automatically on the next build.

## Components

The foundational building blocks of Microbots.

- **[Bot](components/bot.md)** — The core `MicroBot` class that powers all autonomous agents. Covers the base class, `BotRunResult`, `BotType`, and the agent execution loop.

## Bots

Specialized bot implementations, each tailored for a specific use case.

- **[LogAnalysisBot](bots/log-analysis-bot.md)** — Analyzes log files inside a sandboxed container and identifies root causes by cross-referencing with source code.
37 changes: 35 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,38 @@ theme:
icon: material/brightness-4
name: Switch to light mode
features:
- navigation.instant
- navigation.sections
- navigation.indexes
Comment thread
shivashanmugam marked this conversation as resolved.
- navigation.top
- navigation.tabs
- content.code.copy

plugins:
- search
- mkdocstrings:
handlers:
python:
paths: [src]
options:
docstring_style: numpy
show_source: true
show_root_heading: true
show_symbol_type_heading: true
show_symbol_type_toc: true
heading_level: 2
members_order: source
show_signature_annotations: true
separate_signature: true
merge_init_into_class: true
show_labels: true
show_if_no_docstring: true
group_by_category: false
filters:
- "!^_"

markdown_extensions:
- toc:
permalink: true
toc_depth: 4
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.superfences
Expand All @@ -42,6 +67,14 @@ markdown_extensions:
nav:
- Getting Started:
- Home: index.md
- API Documentation:
- Overview: api-docs/overview.md
- Components:
- api-docs/components/index.md
- Bot: api-docs/components/bot.md
- Bots:
- api-docs/bots/index.md
- LogAnalysisBot: api-docs/bots/log-analysis-bot.md
- Guides:
- CopilotBot: copilot-bot.md
- Authentication: authentication.md
Expand Down
Loading
Loading