跳转至

Quick Start Guide

5 minutes to get LingFlow running.

Install

pip install lingflow

Or from source:

git clone https://github.com/guangda88/LingFlow.git
cd LingFlow
pip install -e .

Verify:

lingflow --version
# lingflow, version 3.8.0

Initialize a Project

lingflow init

This creates a .lingflow/ directory with default configuration.

Core API

Run a Skill

from lingflow import LingFlow

lf = LingFlow()

result = lf.run_skill("brainstorming", {"topic": "new feature"})
print(result)

Run a Workflow

Create workflow.yaml:

name: "Code Review Pipeline"
tasks:
  - name: "Review code"
    agent_type: "reviewer"
    skill: "code_review"
    params:
      file_path: "src/main.py"
      dimensions:
        - code_quality
        - security
        - performance

  - name: "Run tests"
    agent_type: "tester"
    skill: "test_runner"
    depends_on: ["Review code"]
    params:
      target: "tests/"

  - name: "Verify fixes"
    agent_type: "implementation"
    skill: "verification"
    depends_on: ["Run tests"]

Execute:

result = lf.run_workflow_file("workflow.yaml")

Smart Compression

LingFlow automatically manages context window usage:

from lingflow.compression import compress_messages

messages = [
    {"role": "system", "content": "You are a coding assistant."},
    {"role": "user", "content": "Fix the bug in auth.py"},
    # ... long conversation history
]

compressed = compress_messages(messages, target_tokens=4000)
# Returns compressed messages preserving critical content

Monitoring

from lingflow.monitoring import OperationsMonitor

monitor = OperationsMonitor()

monitor.register_health_check("database", lambda: HealthCheckResult(
    component="database",
    healthy=True,
    message="Connection OK",
))

results = monitor.run_health_checks()
status = monitor.get_overall_health()

Built-in Skills (32)

Layer Skills Loading
L1 Core workflow-executor, task-runner, conditional-branch, loop-iterator, error-handler Always loaded
L2 Professional brainstorming, code-review, code-refactor, test-driven-development, systematic-debugging, verification Always loaded
L3 Extension writing-plans, api-doc-generator, ui-mockup-generator, ci-cd-orchestrator, deployment-automation, ... Loaded on demand

List available skills:

from lingflow import LingFlow
lf = LingFlow()
skills = lf.list_skills()
for s in skills:
    print(f"  {s['name']}: {s['description']}")

Configuration

Default config in config.yaml. Override via environment variables with LINGFLOW_ prefix:

export LINGFLOW_LOG_LEVEL=DEBUG
export LINGFLOW_MAX_PARALLEL=4

Next Steps