Skip to main content

LadyOl

    ## Project overview
    
    Object-based prompt injection system for AI agents.
    
    ## Features
    
    - **Context Injection** - Inject past experiences and project context into messages
    - **Context Closure** - Store task outcomes for continuous learning
    - **Identity Management** - Persistent agent identity documents in Glain
    - **Memory System** - Two-layer memory (MEMORY.md + Glain)
    - **Skills Loading** - Load and manage agent skills
    - **Prompt Scaling** - Automatically adjust prompt complexity based on model capability
    
    ## Installation
    
    ```bash
    pip install ladyol
    ```
    
    ## Usage
    
    ```bash
    # Run LadyOL
    ladyol run
    
    # Check status
    ladyol status
    ```
    
    ### Options
    
    | Argument | Type | Required | Default | Description |
    |----------|------|----------|---------|-------------|
    | `--verbose` / `-v` | flag | No | false | Enable verbose output |
    | `--config` / `-c` | path | No | None | Path to configuration file |
    
    ### Commands
    
    #### `run`
    Run the main operation.
    
    ```bash
    ladyol run
    ```
    
    #### `status`
    Check project status.
    
    ```bash
    ladyol status
    ```
    
    ## Quick Start
    
    ## Development
    
    See [`CONTRIBUTING.md`](./CONTRIBUTING.md) for setup instructions, testing, and contribution guidelines.
    
    ```python
    from pathlib import Path
    from ladyol import LadyOlPromptEngine, LadyOlConfig
    
    # Initialize the engine
    config = LadyOlConfig()
    engine = LadyOlPromptEngine(
        workspace=Path("./workspace"),
        config=config,
    )
    
    # Inject context into messages
    messages = [{"role": "user", "content": "What was I working on?"}]
    updated_messages = await engine.inject_context(messages)
    
    # Get memory context
    memory_context = engine.get_memory_context()
    
    # Get skills summary
    skills = engine.get_skills_summary()
    ```
    
    ## Sophia gateway provider (2026-08-23)
    
    LadyOl routes LLM traffic through the sophia LAN gateway when the accts
    file enables it:
    
    ```yaml
    # <agent_path>/<agent>_accts.yaml
    provider_accts:
      "sophia-000.000.000":
        enabled: True
        provider: sophia
        name: "sophia-000.000.000"
    ```
    
    - Bearer key resolution: `SOPHIA_REQUESTOR_KEY` env var, then
      `<agent_path>/sophia.env` (KEY=VALUE line; chmod 600).
    - `sophia-auto` model entry → gateway picks the upstream model.
    - All other providers can be disabled per-account (`enabled: False`) —
      they never enter the pool; rotation stays upstream in sophia.
    
    ## Tool-call wire format (T-NEW-119, 2026-08-27)
    
    LadyOl preserves structured OpenAI `tool_calls` on the wire — both
    the upstream's wire format and the message history passed through
    the chat layer. This is the upstream half of the `hermes→sophia→m3`
    tool-call fix.
    
    ### `ProviderPool.chat()`
    
    ```python
    # New (T-NEW-119) — accepts a full messages history + tools:
    content, tool_calls, usage = await provider_pool.chat(
        messages=messages,           # full OpenAI-style history
        tools=tools,                 # OpenAI tool definitions
        temperature=0.7,
        strategy="best_available",
        model=None,                  # or a concrete model id
    )
    
    # Legacy — 2-message [system, user] shortcut still works:
    content, tool_calls, usage = await provider_pool.chat(
        prompt="latest user turn",
        sprompt="system prompt",
        tools=tools,
    )
    ```
    
    - Returns `(content, tool_calls, usage)`. The third slot
      (`tool_calls`) is the upstream's structured
      `choices[0].message.tool_calls` array verbatim, or `[]` when
      the model produced no tool calls. The fourth slot (`usage`) is
      the upstream's `usage` mapping (`prompt_tokens`,
      `completion_tokens`, `total_tokens`).
    - When `messages` is supplied, the wrapper routes through the
      streaming client internally so the full history + tools reach
      the upstream. When only `prompt`/`sprompt` is supplied, the
      legacy 2-message `[system, user]` path is used.
    - `tools` is forwarded so the upstream sees the available tool
      surface (the caller passes an OpenAI tool-definition array).
    
    ### `ProviderPool.stream()`
    
    Yields one of the following per event:
    
    - `{"type": "token", "content": <str>}` — content delta from the upstream.
    - `{"type": "tool_call", "tool_calls": [<OpenAI streaming delta>]}`
      — when the upstream carries `delta.tool_calls` in the SSE.
      Each entry has `index`, `id`, `function.name`,
      `function.arguments` (a JSON string per OpenAI spec).
    - `{"type": "usage", "tokens": {…}}` — token accounting.
    - `{"type": "done"}` — end-of-stream sentinel.
    
    Note: an upstream that emits **only** tool calls (no prose)
    produces zero `token` events. Consumers MUST inspect both
    `token` AND `tool_call` events.
    
    ### Migration notes
    
    The previous return shape `await provider_pool.chat(...) → str` is
    no longer the contract. Callers that destructure as a single
    string must update. The internal callers (`ladyol.py:_progress_report`,
    `ladyol.py:_run_loop` non-streaming path,
    `sandstone/summarizer.py`) were updated in T-NEW-119; downstream
    consumers (sophia + senbai) were updated as companion commits.
    
    ## Architecture
    
    ```
    ladyol/
    ├── agent/           # Core agent components
    │   ├── context_closure.py
    │   ├── context_injector.py
    │   ├── identity.py
    │   ├── memory.py
    │   ├── prompt_scaler.py
    │   └── skills.py
    ├── config/          # Configuration schemas
    ├── prompt/          # Prompt engine
    └── utils/          # Utilities
    ```
    
    ## License
    
    MIT

Metadata

Release files for ladyol 0.0.1.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ladyol 0.0.1.post1
File Size Uploaded Provenance Actions
ladyol-0.0.1.post1.tar.gz 174.9 kB Without provenance Details for ladyol-0.0.1.post1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ladyol 0.0.1.post1
File Interpreter ABI Platform Actions
ladyol-0.0.1.post1-cp312-cp312-manylinux_2_39_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.39+ x86-64 Details for ladyol-0.0.1.post1-cp312-cp312-manylinux_2_39_x86_64.whl

Total release size: 373.1 kB

Release files / ladyol-0.0.1.post1.tar.gz

Download URL ladyol-0.0.1.post1.tar.gz
Size 174.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4199d346a052ed4ae03bc7db0a0e51441d788fe39f3fc24df63486d6f2c43c71
BLAKE2b-256 checksum
How to use checksums
9fc282f83f8dbf0f42d446cfad4e6b048c1c0eed8f3e8a9df8255ab7243cf7f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / ladyol-0.0.1.post1-cp312-cp312-manylinux_2_39_x86_64.whl

Download URL ladyol-0.0.1.post1-cp312-cp312-manylinux_2_39_x86_64.whl
Size 198.2 kB
Tags CPython 3.12 Linux glibc 2.39+ x86-64
SHA-256 checksum
How to use checksums
b65bdf4d0779036ea028aa2691d155fa6afd6f558af8be50b513e755e4a34bfa
BLAKE2b-256 checksum
How to use checksums
714f65f95250f5999fbd26441ccff68986b0e7c1f1837c1c599a1b1a003ee7db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for ladyol 0.0.1.post1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1.post1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page