Promptbook

repository·main·Indexed 41 days ago

https://github.com/webgptorg/promptbook

A platform for creating persistent AI agents that transform scattered company knowledge into actionable tasks. Includes an Agents Server, a CLI (ptbk), and a suite of React components such as BookEditor and MermaidSocialGraph for social network visualization. Version 0.114.0-40.

Tokens
251.3K
Snippets
625
Records
999
Agent score
49%

What's inside Promptbook

  1. Overview of @promptbook/remote-server

    main

    The @promptbook/remote-server package enables distributed execution of promptbook pipelines across network boundaries. It allows you to centralize promptbook execution on powerful servers while clients access functionality remotely via REST API and WebSockets.

    Key Capabilities:

    • HTTP REST API: Endpoints for pipeline execution and management.
    • WebSocket Support: Real-time communication for streaming execution results.
    • OpenAI Compatibility: Use promptbooks as OpenAI-compatible models.
    • Authentication: Supports both AnonymousModeIdentification and ApplicationModeIdentification.
    • Pipeline Management: Remote access to collections and individual pipelines.
  2. Overview of the Promptbook Agents Server Specification

    main

    The Promptbook Agents Server is a web and API application designed to host, edit, and facilitate chat with AI agents written in the Book language.

    This specification serves as the single source of truth for the server's functionality. It is designed to allow developers to implement a compatible server and run agents without needing access to the original source code.

    Key Implementation Rules

    • RFC 2119 Compliance: The terms MUST, MUST NOT, SHOULD, and MAY are used strictly according to RFC 2119.
    • Observable Behavior: The specs focus on observable behavior and persisted state rather than internal code structure.
    • Database Naming: Database tables use a prefix_ placeholder (e.g., prefix_Agent), which is resolved per server instance based on multi-tenancy rules.
    • URL Parameters: Path parameters are denoted with a leading colon (e.g., /agents/:agentName/api/chat).
  3. Overview of @promptbook/markdown-utils

    main

    The @promptbook/markdown-utils package provides comprehensive markdown processing capabilities specifically designed for working with promptbooks and LLM-generated content.

    Key functional areas include:

    • Content Extraction: Pulling code blocks, lists, and sections from markdown.
    • Text Processing: Parsing and manipulating markdown sections.
    • AI Text Humanization: Transforming raw AI-generated text into human-readable formats (fixing quotes, ellipsis, etc.).
    • Markdown Manipulation: Adding, removing, or modifying formatting.
    • Table and Chart Creation: Generating markdown tables and charts.
    • Scraping Integration: Specialized markdown-specific content scraping.
  4. Overview of @promptbook/core functionality

    main

    The @promptbook/core package orchestrates the promptbook execution lifecycle through several key functional areas:

    • Pipeline Management: Parsing, validating, and compiling promptbook definitions.
    • Execution Engine: Managing pipeline executors with error handling.
    • LLM Integration: Providing a unified interface for multiple providers (OpenAI, Anthropic, Google, etc.).
    • Parameter Processing: Handling template parameter substitution and validation.
    • Knowledge Management: Scraping and processing knowledge from various sources.
    • Storage Abstraction: Supporting various backends (Memory, Filesystem, etc.) for caching and persistence.
    • Format Support: Parsing and validating JSON, CSV, XML, and text formats.
  5. Overview of the @promptbook/core package

    main
    The @promptbook/core package is the foundational layer of the Promptbook ecosystem. It provides the essential infrastructure for the entire lifecycle of a promptbook, including creation, parsing, validation, and execution. It is designed to abstract the complexities of different LLM providers and manage the intricate details of pipeline orchestration, parameter validation, and result processing.
  6. Overview of ptbk coder landing page

    main

    The ptbk coder landing page is the interface for the Promptbook orchestrator. This orchestrator drives various coding agents (such as Claude Code, OpenAI Codex, GitHub Copilot, Gemini CLI, Qwen Code, opencode, and Cline) by processing a queue of plain-markdown prompts.

    Key Characteristics:

    • Access URL: Runs on http://localhost:4025/
    • UI/UX: Dark mode only, English only, and responsive for both desktop and mobile.
    • Branding: Uses official Promptbook branding.
  7. Overview of Promptbook web applications

    main

    The Promptbook ecosystem includes several web applications built on Next.js, which is installed at the root of the monorepo. These applications provide different interfaces for hosting agents, showcasing components, and experimenting with utilities.

    Available applications:

    • Agents Server: The primary application for hosting and running Promptbook agents, featuring chat and book capabilities. (Default: http://localhost:4020/)
    • Book Components: A showcase for all Promptbook components, providing live editing and usage examples. (Default: http://localhost:4022/)
    • Playground: An environment for experimenting with Promptbook app components and utilities. (Default: http://localhost:4023/)
    • Utils: A utility application for various LLM-related tasks. (Default: http://localhost:4024/)
    • Coder Landing: The landing page for ptbk coder, which serves as the orchestrator for AI coding agents. (Default: http://localhost:4025/)
  8. Identify fonts used in Promptbook components

    main

    The Promptbook ecosystem utilizes the following font sources for its web and mobile components:

    • Google Fonts: Open-source fonts for general typography.
    • Openmoji: Used for emojis and symbols.
    • Fontsee: A tool used to preview .woff2 font files.

    When building custom components or extending the book-components package, ensure compatibility with these font families to maintain visual consistency.

  9. Understand the technical terms of Promptbook

    main

    To work effectively with Promptbook, you should understand its core technical abstractions and underlying technologies. The project revolves around the following concepts:

    • LLM (Large Language Model): The core intelligence engine.
    • Prompt: The text input provided to the LLM.
    • Model: The specific AI implementation being used (e.g., GPT-4, Claude 3.5).
    • Executor: The engine responsible for running Pipelines or Agents.
    • Scraping: The mechanism for extracting data from web sources.
    • Script: Custom Javascript or Python code that can be executed within a Pipeline.
    • Postprocessing: The stage where LLM outputs are cleaned or transformed.
    • Usage: The system for tracking and measuring resource consumption.
  10. Understand the Promptbook Dictionary categories

    main

    The Promptbook Dictionary is organized into several key categories that define the ecosystem's terminology and architecture. Use these categories to navigate the project's core components:

    • Commitments: Definitions for specific behaviors, capabilities, or rules assigned to AI agents.
    • Agents: High-level AI entities characterized by personality, knowledge, and rules.
    • Pipelines (Legacy): Sequential workflows designed for multi-step LLM operations.
    • Structure: The fundamental building blocks used to construct Promptbook files.
    • Execution: The mechanisms for processing, running, and monitoring Promptbooks.
    • Concepts: The abstract ideas and underlying principles of the Promptbook project.
  11. Explore fundamental Promptbook concepts

    main

    The Promptbook ecosystem is governed by several core principles that help structure AI workflows. Key concepts include:

    • Expectations: Defining and validating the structure and content of AI outputs.
    • Separation of Concerns: Decoupling prompt logic from the main application code.
    • Words not Tokens: A human-centric approach to measuring and controlling text generation.
    • Postprocessing: Refining and transforming AI outputs after generation.
    • Knowledge (RAG): Mechanisms for agents to retrieve and utilize external information.
    • Metaprompting: Creating prompts designed to generate or improve other prompts.
    • Anomaly Detection: Identifying hallucinations or invalid responses.
    • Formfactors: The different UI/UX modes for AI presentation (e.g., Chatbot, Sheet, Generator).
  12. Understand the ptbk coder landing page specification structure

    main

    The specs/ directory in apps/coder-landing serves as the single source of truth for the ptbk coder landing page. It is used for development, testing, and 1:1 replication of the page's functionality and content.

    Specs are organized by abstraction level:

    • Root specs: High-level, abstract definitions (product story, page structure, design, metadata, non-functional requirements).
    • Subfolder specs: Concrete implementations for content, reusable components, and specific page sections.

    Each markdown file represents a single spec with a single responsibility. Specs are interlinked using relative markdown hyperlinks.