Add MkDocs Material documentation site with 40 pages and auto-generated API reference

Sets up a complete documentation website with 7 navigable sections (Home, Getting
Started, User Guide, Architecture, API Reference, Deployment, Development), light/dark
mode, search, code copy, and Mermaid diagram support. API reference pages use
mkdocstrings to auto-generate docs from source docstrings. GitHub Actions workflow
deploys to GitHub Pages on push to main.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jon Saad-Falcon
2026-02-21 06:09:36 +00:00
co-authored by Claude Opus 4.6
parent 990d7d8a79
commit f75afefcfb
45 changed files with 10822 additions and 0 deletions
+150
View File
@@ -0,0 +1,150 @@
# Agents Module
The agents module implements the agentic logic pillar. All agents implement
the `BaseAgent` ABC with a `run()` method. Agents handle queries by
coordinating tool calls, memory retrieval, and inference engine interactions.
The module also includes the OpenClaw infrastructure for interoperating with
external agent frameworks via HTTP or subprocess transport.
## Abstract Base Class and Context
### BaseAgent
::: openjarvis.agents._stubs.BaseAgent
options:
show_source: true
members_order: source
### AgentContext
::: openjarvis.agents._stubs.AgentContext
options:
show_source: true
members_order: source
### AgentResult
::: openjarvis.agents._stubs.AgentResult
options:
show_source: true
members_order: source
---
## Agent Implementations
### SimpleAgent
::: openjarvis.agents.simple.SimpleAgent
options:
show_source: true
members_order: source
### OrchestratorAgent
::: openjarvis.agents.orchestrator.OrchestratorAgent
options:
show_source: true
members_order: source
### OpenClawAgent
::: openjarvis.agents.openclaw.OpenClawAgent
options:
show_source: true
members_order: source
### CustomAgent
::: openjarvis.agents.custom.CustomAgent
options:
show_source: true
members_order: source
---
## OpenClaw Protocol
JSON-line wire protocol for communication between OpenJarvis and external
OpenClaw agent processes.
### MessageType
::: openjarvis.agents.openclaw_protocol.MessageType
options:
show_source: true
members_order: source
### ProtocolMessage
::: openjarvis.agents.openclaw_protocol.ProtocolMessage
options:
show_source: true
members_order: source
### serialize
::: openjarvis.agents.openclaw_protocol.serialize
options:
show_source: true
### deserialize
::: openjarvis.agents.openclaw_protocol.deserialize
options:
show_source: true
---
## OpenClaw Transport
Transport abstraction for communicating with OpenClaw agent processes
via HTTP or subprocess stdin/stdout.
### OpenClawTransport
::: openjarvis.agents.openclaw_transport.OpenClawTransport
options:
show_source: true
members_order: source
### HttpTransport
::: openjarvis.agents.openclaw_transport.HttpTransport
options:
show_source: true
members_order: source
### SubprocessTransport
::: openjarvis.agents.openclaw_transport.SubprocessTransport
options:
show_source: true
members_order: source
---
## OpenClaw Plugin
Plugin layer that wraps OpenJarvis engine and memory as an OpenClaw-compatible
provider and search manager.
### ProviderPlugin
::: openjarvis.agents.openclaw_plugin.ProviderPlugin
options:
show_source: true
members_order: source
### MemorySearchManager
::: openjarvis.agents.openclaw_plugin.MemorySearchManager
options:
show_source: true
members_order: source
### register
::: openjarvis.agents.openclaw_plugin.register
options:
show_source: true
+48
View File
@@ -0,0 +1,48 @@
# Benchmarks Module
The benchmarks module provides a framework for measuring inference engine
performance. All benchmarks implement the `BaseBenchmark` ABC and are
registered via `BenchmarkRegistry`. The `BenchmarkSuite` runner executes
a collection of benchmarks and aggregates results into JSONL or summary
format.
## Abstract Base Class and Runner
### BaseBenchmark
::: openjarvis.bench._stubs.BaseBenchmark
options:
show_source: true
members_order: source
### BenchmarkResult
::: openjarvis.bench._stubs.BenchmarkResult
options:
show_source: true
members_order: source
### BenchmarkSuite
::: openjarvis.bench._stubs.BenchmarkSuite
options:
show_source: true
members_order: source
---
## Benchmark Implementations
### LatencyBenchmark
::: openjarvis.bench.latency.LatencyBenchmark
options:
show_source: true
members_order: source
### ThroughputBenchmark
::: openjarvis.bench.throughput.ThroughputBenchmark
options:
show_source: true
members_order: source
+290
View File
@@ -0,0 +1,290 @@
# Core Module
The core module contains the foundational abstractions shared across all
OpenJarvis pillars: the decorator-based registry system for runtime discovery,
canonical data types, configuration loading with hardware detection, and the
pub/sub event bus for inter-pillar communication.
## Registry System
The registry pattern is the primary extension mechanism. Each pillar has its
own typed registry subclass. New implementations are added by decorating a
class with `@XRegistry.register("name")`.
### RegistryBase
::: openjarvis.core.registry.RegistryBase
options:
show_source: true
members_order: source
### ModelRegistry
::: openjarvis.core.registry.ModelRegistry
options:
show_source: true
members_order: source
### EngineRegistry
::: openjarvis.core.registry.EngineRegistry
options:
show_source: true
members_order: source
### MemoryRegistry
::: openjarvis.core.registry.MemoryRegistry
options:
show_source: true
members_order: source
### AgentRegistry
::: openjarvis.core.registry.AgentRegistry
options:
show_source: true
members_order: source
### ToolRegistry
::: openjarvis.core.registry.ToolRegistry
options:
show_source: true
members_order: source
### RouterPolicyRegistry
::: openjarvis.core.registry.RouterPolicyRegistry
options:
show_source: true
members_order: source
### BenchmarkRegistry
::: openjarvis.core.registry.BenchmarkRegistry
options:
show_source: true
members_order: source
---
## Types
Canonical data types shared across all OpenJarvis pillars, including message
structures, model specifications, telemetry records, and trace objects.
### Role
::: openjarvis.core.types.Role
options:
show_source: true
members_order: source
### Quantization
::: openjarvis.core.types.Quantization
options:
show_source: true
members_order: source
### StepType
::: openjarvis.core.types.StepType
options:
show_source: true
members_order: source
### ToolCall
::: openjarvis.core.types.ToolCall
options:
show_source: true
members_order: source
### Message
::: openjarvis.core.types.Message
options:
show_source: true
members_order: source
### Conversation
::: openjarvis.core.types.Conversation
options:
show_source: true
members_order: source
### ModelSpec
::: openjarvis.core.types.ModelSpec
options:
show_source: true
members_order: source
### ToolResult
::: openjarvis.core.types.ToolResult
options:
show_source: true
members_order: source
### TelemetryRecord
::: openjarvis.core.types.TelemetryRecord
options:
show_source: true
members_order: source
### TraceStep
::: openjarvis.core.types.TraceStep
options:
show_source: true
members_order: source
### Trace
::: openjarvis.core.types.Trace
options:
show_source: true
members_order: source
---
## Configuration
Configuration loading, hardware detection, and engine recommendation. User
configuration lives at `~/.openjarvis/config.toml`. The `load_config()`
function detects hardware, fills sensible defaults, then overlays any user
overrides from the TOML file.
### JarvisConfig
::: openjarvis.core.config.JarvisConfig
options:
show_source: true
members_order: source
### EngineConfig
::: openjarvis.core.config.EngineConfig
options:
show_source: true
members_order: source
### IntelligenceConfig
::: openjarvis.core.config.IntelligenceConfig
options:
show_source: true
members_order: source
### LearningConfig
::: openjarvis.core.config.LearningConfig
options:
show_source: true
members_order: source
### MemoryConfig
::: openjarvis.core.config.MemoryConfig
options:
show_source: true
members_order: source
### AgentConfig
::: openjarvis.core.config.AgentConfig
options:
show_source: true
members_order: source
### ServerConfig
::: openjarvis.core.config.ServerConfig
options:
show_source: true
members_order: source
### TelemetryConfig
::: openjarvis.core.config.TelemetryConfig
options:
show_source: true
members_order: source
### HardwareInfo
::: openjarvis.core.config.HardwareInfo
options:
show_source: true
members_order: source
### GpuInfo
::: openjarvis.core.config.GpuInfo
options:
show_source: true
members_order: source
### detect_hardware
::: openjarvis.core.config.detect_hardware
options:
show_source: true
### load_config
::: openjarvis.core.config.load_config
options:
show_source: true
### recommend_engine
::: openjarvis.core.config.recommend_engine
options:
show_source: true
---
## Event Bus
Thread-safe pub/sub event bus for inter-pillar telemetry. Any pillar can emit
events (e.g. `INFERENCE_END`) and any other pillar can react without direct
coupling.
### EventType
::: openjarvis.core.events.EventType
options:
show_source: true
members_order: source
### Event
::: openjarvis.core.events.Event
options:
show_source: true
members_order: source
### EventBus
::: openjarvis.core.events.EventBus
options:
show_source: true
members_order: source
### get_event_bus
::: openjarvis.core.events.get_event_bus
options:
show_source: true
### reset_event_bus
::: openjarvis.core.events.reset_event_bus
options:
show_source: true
+98
View File
@@ -0,0 +1,98 @@
# Engine Module
The engine module implements the inference runtime pillar. All backends
implement the `InferenceEngine` ABC with `generate()`, `stream()`,
`list_models()`, and `health()` methods. The discovery subsystem probes
running engines and selects the best available backend based on
configuration and health checks.
## Abstract Base Class
### InferenceEngine
::: openjarvis.engine._stubs.InferenceEngine
options:
show_source: true
members_order: source
### EngineConnectionError
::: openjarvis.engine._base.EngineConnectionError
options:
show_source: true
### messages_to_dicts
::: openjarvis.engine._base.messages_to_dicts
options:
show_source: true
---
## Engine Implementations
### OllamaEngine
::: openjarvis.engine.ollama.OllamaEngine
options:
show_source: true
members_order: source
### VLLMEngine
::: openjarvis.engine.vllm.VLLMEngine
options:
show_source: true
members_order: source
### LlamaCppEngine
::: openjarvis.engine.llamacpp.LlamaCppEngine
options:
show_source: true
members_order: source
### SGLangEngine
::: openjarvis.engine.sglang.SGLangEngine
options:
show_source: true
members_order: source
### CloudEngine
::: openjarvis.engine.cloud.CloudEngine
options:
show_source: true
members_order: source
### estimate_cost
::: openjarvis.engine.cloud.estimate_cost
options:
show_source: true
---
## Engine Discovery
Functions for probing running engines, aggregating available models,
and selecting the best engine for a given configuration.
### get_engine
::: openjarvis.engine._discovery.get_engine
options:
show_source: true
### discover_engines
::: openjarvis.engine._discovery.discover_engines
options:
show_source: true
### discover_models
::: openjarvis.engine._discovery.discover_models
options:
show_source: true
+25
View File
@@ -0,0 +1,25 @@
# API Reference
This section contains the auto-generated API reference for the OpenJarvis Python
package. Documentation is extracted directly from the source code docstrings
using [mkdocstrings](https://mkdocstrings.github.io/).
Each page documents a major module of the framework, including abstract base
classes, concrete implementations, and utility functions.
## Modules
| Module | Description |
|--------|-------------|
| [SDK](sdk.md) | High-level `Jarvis` class and `MemoryHandle` proxy |
| [Core](core.md) | Registries, types, configuration, and event bus |
| [Engine](engine.md) | Inference engine ABC and backends (Ollama, vLLM, llama.cpp, SGLang, Cloud) |
| [Agents](agents.md) | Agent ABC and implementations (Simple, Orchestrator, OpenClaw, Custom) |
| [Memory](memory.md) | Memory backend ABC and implementations (SQLite, FAISS, ColBERT, BM25, Hybrid) |
| [Tools](tools.md) | Tool ABC, executor, and built-in tools (Calculator, Think, Retrieval, LLM, FileRead) |
| [Intelligence](intelligence.md) | Heuristic router and model catalog |
| [Learning](learning.md) | Router policies, reward functions, and trace-driven learning |
| [Traces](traces.md) | Trace storage, collection, and analysis |
| [Telemetry](telemetry.md) | Telemetry storage, aggregation, and instrumented wrappers |
| [Benchmarks](bench.md) | Benchmark ABC, suite runner, latency and throughput benchmarks |
| [Server](server.md) | FastAPI application, OpenAI-compatible routes, and Pydantic models |
+47
View File
@@ -0,0 +1,47 @@
# Intelligence Module
The intelligence module handles model management and query routing. It
provides the `HeuristicRouter` which selects models based on query
characteristics (code detection, math detection, query length, urgency),
and a model catalog of well-known local and cloud models with their
specifications.
## Heuristic Router
### HeuristicRouter
::: openjarvis.intelligence.router.HeuristicRouter
options:
show_source: true
members_order: source
### build_routing_context
::: openjarvis.intelligence.router.build_routing_context
options:
show_source: true
---
## Model Catalog
Built-in catalog of well-known model specifications, including local models
(Qwen, Llama, Mistral, DeepSeek) and cloud models (OpenAI, Anthropic, Google).
### BUILTIN_MODELS
::: openjarvis.intelligence.model_catalog.BUILTIN_MODELS
options:
show_source: true
### register_builtin_models
::: openjarvis.intelligence.model_catalog.register_builtin_models
options:
show_source: true
### merge_discovered_models
::: openjarvis.intelligence.model_catalog.merge_discovered_models
options:
show_source: true
+65
View File
@@ -0,0 +1,65 @@
# Learning Module
The learning module implements router policies that determine which model
handles a given query. Policies range from static heuristic rules to
trace-driven learning that improves routing decisions based on historical
interaction outcomes. The module also provides reward functions for scoring
inference results.
## Abstract Base Classes
### RouterPolicy
::: openjarvis.learning._stubs.RouterPolicy
options:
show_source: true
members_order: source
### RoutingContext
::: openjarvis.learning._stubs.RoutingContext
options:
show_source: true
members_order: source
### RewardFunction
::: openjarvis.learning._stubs.RewardFunction
options:
show_source: true
members_order: source
---
## Policy Implementations
### TraceDrivenPolicy
::: openjarvis.learning.trace_policy.TraceDrivenPolicy
options:
show_source: true
members_order: source
### classify_query
::: openjarvis.learning.trace_policy.classify_query
options:
show_source: true
### GRPORouterPolicy
::: openjarvis.learning.grpo_policy.GRPORouterPolicy
options:
show_source: true
members_order: source
---
## Reward Functions
### HeuristicRewardFunction
::: openjarvis.learning.heuristic_reward.HeuristicRewardFunction
options:
show_source: true
members_order: source
+179
View File
@@ -0,0 +1,179 @@
# Memory Module
The memory module implements persistent searchable storage for document
retrieval. All backends implement the `MemoryBackend` ABC with `store()`,
`retrieve()`, `delete()`, and `clear()` methods. The module also includes
a document ingestion pipeline (chunking, file reading) and context injection
for augmenting prompts with retrieved knowledge.
## Abstract Base Class
### MemoryBackend
::: openjarvis.memory._stubs.MemoryBackend
options:
show_source: true
members_order: source
### RetrievalResult
::: openjarvis.memory._stubs.RetrievalResult
options:
show_source: true
members_order: source
---
## Backend Implementations
### SQLiteMemory
::: openjarvis.memory.sqlite.SQLiteMemory
options:
show_source: true
members_order: source
### FAISSMemory
::: openjarvis.memory.faiss_backend.FAISSMemory
options:
show_source: true
members_order: source
### ColBERTMemory
::: openjarvis.memory.colbert_backend.ColBERTMemory
options:
show_source: true
members_order: source
### BM25Memory
::: openjarvis.memory.bm25.BM25Memory
options:
show_source: true
members_order: source
### HybridMemory
::: openjarvis.memory.hybrid.HybridMemory
options:
show_source: true
members_order: source
### reciprocal_rank_fusion
::: openjarvis.memory.hybrid.reciprocal_rank_fusion
options:
show_source: true
---
## Document Chunking
Splits text into fixed-size chunks with configurable overlap, respecting
paragraph boundaries.
### ChunkConfig
::: openjarvis.memory.chunking.ChunkConfig
options:
show_source: true
members_order: source
### Chunk
::: openjarvis.memory.chunking.Chunk
options:
show_source: true
members_order: source
### chunk_text
::: openjarvis.memory.chunking.chunk_text
options:
show_source: true
---
## Document Ingestion
File reading, type detection, and directory walking for the ingestion
pipeline.
### DocumentMeta
::: openjarvis.memory.ingest.DocumentMeta
options:
show_source: true
members_order: source
### detect_file_type
::: openjarvis.memory.ingest.detect_file_type
options:
show_source: true
### read_document
::: openjarvis.memory.ingest.read_document
options:
show_source: true
### ingest_path
::: openjarvis.memory.ingest.ingest_path
options:
show_source: true
---
## Context Injection
Retrieves relevant memory and injects it into prompts as system messages
with source attribution.
### ContextConfig
::: openjarvis.memory.context.ContextConfig
options:
show_source: true
members_order: source
### inject_context
::: openjarvis.memory.context.inject_context
options:
show_source: true
### format_context
::: openjarvis.memory.context.format_context
options:
show_source: true
### build_context_message
::: openjarvis.memory.context.build_context_message
options:
show_source: true
---
## Embeddings
Abstraction layer for text embedding models used by dense retrieval backends.
### Embedder
::: openjarvis.memory.embeddings.Embedder
options:
show_source: true
members_order: source
### SentenceTransformerEmbedder
::: openjarvis.memory.embeddings.SentenceTransformerEmbedder
options:
show_source: true
members_order: source
+20
View File
@@ -0,0 +1,20 @@
# SDK
The SDK module provides the high-level Python interface for OpenJarvis. The
`Jarvis` class wraps engine discovery, agent dispatch, memory operations, and
telemetry into a single convenient entry point. `MemoryHandle` acts as a lazy
proxy for memory backend operations.
## Jarvis
::: openjarvis.sdk.Jarvis
options:
show_source: true
members_order: source
## MemoryHandle
::: openjarvis.sdk.MemoryHandle
options:
show_source: true
members_order: source
+117
View File
@@ -0,0 +1,117 @@
# Server Module
The server module provides an OpenAI-compatible API server built on FastAPI
and uvicorn. It exposes `POST /v1/chat/completions` (with streaming via SSE),
`GET /v1/models`, and `GET /health` endpoints. Pydantic models ensure
request/response validation matching the OpenAI API format.
## Application Factory
### create_app
::: openjarvis.server.app.create_app
options:
show_source: true
---
## Route Handlers
### chat_completions
::: openjarvis.server.routes.chat_completions
options:
show_source: true
### list_models
::: openjarvis.server.routes.list_models
options:
show_source: true
### health
::: openjarvis.server.routes.health
options:
show_source: true
---
## Pydantic Request/Response Models
### ChatMessage
::: openjarvis.server.models.ChatMessage
options:
show_source: true
members_order: source
### ChatCompletionRequest
::: openjarvis.server.models.ChatCompletionRequest
options:
show_source: true
members_order: source
### ChatCompletionResponse
::: openjarvis.server.models.ChatCompletionResponse
options:
show_source: true
members_order: source
### Choice
::: openjarvis.server.models.Choice
options:
show_source: true
members_order: source
### ChoiceMessage
::: openjarvis.server.models.ChoiceMessage
options:
show_source: true
members_order: source
### UsageInfo
::: openjarvis.server.models.UsageInfo
options:
show_source: true
members_order: source
### ChatCompletionChunk
::: openjarvis.server.models.ChatCompletionChunk
options:
show_source: true
members_order: source
### DeltaMessage
::: openjarvis.server.models.DeltaMessage
options:
show_source: true
members_order: source
### StreamChoice
::: openjarvis.server.models.StreamChoice
options:
show_source: true
members_order: source
### ModelObject
::: openjarvis.server.models.ModelObject
options:
show_source: true
members_order: source
### ModelListResponse
::: openjarvis.server.models.ModelListResponse
options:
show_source: true
members_order: source
+53
View File
@@ -0,0 +1,53 @@
# Telemetry Module
The telemetry module provides append-only recording and read-only aggregation
of inference metrics. Every engine call records timing, token counts, energy
usage, and cost to SQLite via the event bus. The `TelemetryAggregator`
provides per-model and per-engine statistics with time-range filtering.
## TelemetryStore
::: openjarvis.telemetry.store.TelemetryStore
options:
show_source: true
members_order: source
---
## TelemetryAggregator
::: openjarvis.telemetry.aggregator.TelemetryAggregator
options:
show_source: true
members_order: source
### ModelStats
::: openjarvis.telemetry.aggregator.ModelStats
options:
show_source: true
members_order: source
### EngineStats
::: openjarvis.telemetry.aggregator.EngineStats
options:
show_source: true
members_order: source
### AggregatedStats
::: openjarvis.telemetry.aggregator.AggregatedStats
options:
show_source: true
members_order: source
---
## Instrumented Wrapper
### instrumented_generate
::: openjarvis.telemetry.wrapper.instrumented_generate
options:
show_source: true
+75
View File
@@ -0,0 +1,75 @@
# Tools Module
The tools module implements the tool system used by agents for executing
actions such as calculations, memory search, file reading, and sub-model
queries. Each tool implements the `BaseTool` ABC and is registered via
`@ToolRegistry.register("name")`. The `ToolExecutor` dispatches tool calls
with JSON argument parsing, latency tracking, and event bus integration.
## Abstract Base Class
### BaseTool
::: openjarvis.tools._stubs.BaseTool
options:
show_source: true
members_order: source
### ToolSpec
::: openjarvis.tools._stubs.ToolSpec
options:
show_source: true
members_order: source
### ToolExecutor
::: openjarvis.tools._stubs.ToolExecutor
options:
show_source: true
members_order: source
---
## Built-in Tools
### CalculatorTool
::: openjarvis.tools.calculator.CalculatorTool
options:
show_source: true
members_order: source
### safe_eval
::: openjarvis.tools.calculator.safe_eval
options:
show_source: true
### ThinkTool
::: openjarvis.tools.think.ThinkTool
options:
show_source: true
members_order: source
### RetrievalTool
::: openjarvis.tools.retrieval.RetrievalTool
options:
show_source: true
members_order: source
### LLMTool
::: openjarvis.tools.llm_tool.LLMTool
options:
show_source: true
members_order: source
### FileReadTool
::: openjarvis.tools.file_read.FileReadTool
options:
show_source: true
members_order: source
+53
View File
@@ -0,0 +1,53 @@
# Traces Module
The traces module provides full interaction-level recording for the learning
system. Every agent interaction can produce a `Trace` capturing the sequence
of steps (route, retrieve, generate, tool_call, respond) with timing, inputs,
outputs, and outcomes. The `TraceCollector` wraps any agent to record traces
automatically, while `TraceAnalyzer` provides aggregated statistics.
## TraceStore
::: openjarvis.traces.store.TraceStore
options:
show_source: true
members_order: source
---
## TraceCollector
::: openjarvis.traces.collector.TraceCollector
options:
show_source: true
members_order: source
---
## TraceAnalyzer
::: openjarvis.traces.analyzer.TraceAnalyzer
options:
show_source: true
members_order: source
### RouteStats
::: openjarvis.traces.analyzer.RouteStats
options:
show_source: true
members_order: source
### ToolStats
::: openjarvis.traces.analyzer.ToolStats
options:
show_source: true
members_order: source
### TraceSummary
::: openjarvis.traces.analyzer.TraceSummary
options:
show_source: true
members_order: source