libro

repository·main·Indexed 19 days ago

https://github.com/apt-oss/libro

A JavaScript and Python hybrid monorepo providing a customizable Notebook product solution for AI-native workflows. It features deep kernel-level extensibility, built-in LLM interactions via libro-prompt-cell, and a hierarchical cell abstraction system. The library includes tools for managing autocompletion, snippets, and bracket closing through libro-codemirror, as well as core services for view management, custom cell and output extensions, and Jupyter-like output modules (Stream, Error, and DisplayData).

Tokens
139.5K
Snippets
388
Records
641
Agent score
65%

What's inside libro

  1. What is libro?

    main

    libro is an open-source notebook product solution designed for high integration and customization. Unlike standard Jupyter, it offers:

    • Advanced AI Integration: Built-in AI capabilities for intelligent programming and assistance.
    • Kernel-level Extensions: Support for custom execution environments beyond standard Jupyter, such as SQL (e.g., ODPS) or multi-node debugging for privacy computing.
    • Flexible Embedding: Can be used as a standalone document editor, a report generator, or embedded into various application scenarios.
    • Rich UI/UX: Features like cell-level code version Diff, intelligent code suggestions (completion, formatting, definition jump), and interactive controls for dynamic reports.
  2. Overview of the Libro Editor

    main
    The Libro Editor is an enhanced notebook environment designed to improve state monitoring of traditional notebook operations and provide various interactive features. It serves as a specialized interface for notebook-style workflows, offering enhanced visibility into the execution state and interactive capabilities compared to traditional notebooks.
  3. Overview of libro-prompt-cell

    main

    The libro-prompt-cell package provides built-in OpenAI interaction capabilities designed for notebook-like environments. It allows users to create interactive prompt cells with the following features:

    • Built-in OpenAI Integration: Native support for interacting with OpenAI models.
    • Context Variables in Templates: Use context variables within your prompt templates to inject dynamic data.
    • Output to Context: Save the output of a prompt execution back into context variables for use in subsequent cells.
    • Multi-turn Conversations: Supports multi-turn dialogue/chat flows within the cell.
  4. Overview of libro-rendermime

    main

    The libro-rendermime package provides the LibroRenderMimeModule, which is responsible for identifying different data formats and ensuring they are correctly parsed and rendered. It uses MIME types and priority levels to provide flexible output display options across different environments.

    Built-in support includes renderers for:

    • Text
    • Images
    • Markdown
    • HTML
    • SVG

    The package is designed to be extensible, allowing developers to add custom MIME type renderers.

  5. Overview of Quant Export capabilities

    main

    Quant Export is an AI agent designed to assist quantitative financial engineering researchers. It integrates AI into the quantitative investment research workflow to improve efficiency and intelligence. Its core capabilities include:

    • Information Extraction: Multimodal extraction from research reports, tables, and images, and the construction of quantitative information from simple descriptions.
    • Code Generation: Specialized generation for proprietary quantitative tool APIs, framework-guided generation for expert requirements (including code quality inspection and testing), and generic Python programming assistance.
    • Customization: Support for custom uploading and expansion of data, API packages, intentions, and code frameworks.
    • Report Generation: Automated generation of quantitative reports based on factor backtest results and universal retrieval of real-time data or research inspirations.
  6. Key features of libro

    main

    libro is an out-of-the-box solution that allows users to freely combine native modules. Key capabilities include:

    Customization

    • UI and Kernel Extensibility: Supports custom UI and execution kernels at all levels.
    • Multiple Formats: Supports various cell types such as SQL and Prompt cells. It can be used as a pure document editor, a report generator, or a demo platform.
    • Kernel Flexibility: Can support native Jupyter execution or specialized environments like SQL-oriented ODPS or multi-node debugging environments for privacy computing.

    Rich Functionality

    • AI Integration: Built-in intelligent assistant and AI chat features.
    • Enhanced Python Experience: Superior code suggestions, autocompletion, formatting, and 'go to definition' functionality.
    • Version Control: Cell-level code version Diff capabilities.
    • Lightweight Apps: Ability to generate dynamic reports using interactive controls.
  7. Understand the Libro Editor Interface

    main

    The Libro editor is an enhanced Notebook interface designed for state monitoring and interactive operations. The interface is divided into four main modules:

    1. Top Toolbar: Contains the kernel status area, operation controls, and keyboard shortcuts.
    2. Cell Operation Bar: Provides quick actions for individual cells (run, move, add, delete).
    3. Cell Editing Area: The workspace containing cell connection areas, output areas, and the bottom cell area.
    4. Cell Functionality: Supports different modes (Command mode and Edit mode) with specific keyboard shortcuts.
  8. What is a Sql Cell?

    main
    A Sql Cell provides interactive capabilities for executing SQL code directly within the notebook. By connecting to a SQL database, you can write and run SQL queries within a cell to interact with your data.
  9. What is a Prompt Cell?

    main

    A Prompt Cell is a specialized notebook cell that allows users to execute reasoning tasks using Large Language Models (LLMs) via natural language instructions. It reduces the need for writing complex code and integrates seamlessly into existing workflows.

    Key features include:

    • Built-in Models: Supports chatgpt, gpt4, and dalle-3 out of the box.
    • Model Extensibility:
      • Define LLMs, agents, or other conversational objects using Langchain and use them directly in Prompt Cells.
      • Extend models using libro-ai.
    • Chat Contexts: Supports selecting a Chat Identifier (聊天标识), which ensures all Prompt Cells sharing that identifier operate within the same conversation context.
    • Variable Output: Prompt Cells can be saved as a variable, which results in a Langchain AIMessage object.