Skip to main content

sayou-brain

PyPI version License Docs

Overview

The Central Nervous System (Orchestrator) of Sayou Fabric.

sayou-brain acts as the Control Tower for the entire Sayou ecosystem. It provides high-level Pipeline Facades that abstract away the complexity of connecting individual modules (connector, document, chunking, etc.).

Instead of manually wiring components, you simply invoke a Pipeline, and the Brain handles routing, configuration propagation, and error handling.


1. Architecture & Role

The Brain sits between the User and the low-level modules. It directs data flow based on the chosen Pipeline strategy.

graph LR
    User -->|Invoke| Brain[Sayou Brain]
    
    subgraph Pipelines
        SP[StandardPipeline]
        NP[NormalPipeline]
    end
    
    Brain --> SP & NP
    
    SP -->|Layout Preserving| Doc[Document Parser]
    NP -->|Logic/Time Based| Chunk[Context Chunker]
    
    Doc & Chunk --> Wrap[Wrapper]
    Wrap --> Assem[Assembler]
    Assem --> Load[Loader]

1.1. Core Features

  • Facade Pattern: Users only interact with Pipeline.process(). No need to import sub-modules directly.
  • Config Propagation: A single config dictionary is distributed to all sub-modules.
  • Smart Routing: Automatically selects the optimal Connector based on the input source string.

2. Available Pipelines

Sayou Brain provides two distinct pipelines optimized for different data types.

Pipeline Best For Description
StandardPipeline PDF, Office, HWP Uses sayou-document to preserve spatial layout, headers, and tables. Maintains visual hierarchy.
NormalPipeline Code, Video, Web Bypasses layout parsing. Focuses on semantic logic (AST for code, Timeline for video).

3. Installation

Installing sayou-brain automatically installs all core dependencies and sub-modules.

pip install sayou-brain

4. Usage

Case A: StandardPipeline (Document-Centric)

Use this for documents where visual layout matters (e.g., Financial Reports, Papers).

from sayou.brain import StandardPipeline

result = StandardPipeline.process(
    source="./reports/financial_q1.pdf",
    destination="./examples/output/financial_graph.json"
)

print(f"Processed Nodes: {len(result['nodes'])}")

Case B: NormalPipeline (Logic-Centric)

Use this for structured data, code, or multimedia streams.

from sayou.brain import NormalPipeline

result = NormalPipeline.process(
    source="github://sayouzone/sayou-fabric",
    destination="./examples/output/code_graph.json",
    token="GITHUB_TOKEN",
    path="packages/sayou-connector/src/sayou/connector",
)

nodes = result.get("nodes", [])
edges = result.get("edges", [])

print(f"Total Nodes: {len(nodes)}")
print(f"Total Edges: {len(edges)}")

5. Configuration Keys

The following keys can be used in the config dictionary passed to the Pipeline:

  • connector: User-Agent, Timeout settings, Proxy config.
  • refinery: PII masking rules, Unicode normalization, Regex filters.
  • chunking: Strategy selection (Token/Line/Semantic), Size limits, Overlap.
  • loader: Database credentials, Output paths, File modes.

6. License

Apache 2.0 License © 2026 Sayouzone

7. Plugin List

Plugin Example Description
Normal Pipeline ▶
Bypass Pipeline ▶
Transfer Pipeline ▶
Standard Pipeline ▶
Structure Pipeline ▶

Metadata

Release files for sayou-brain 0.5.2

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

Source distribution (sdist)

Source distribution for sayou-brain 0.5.2
File Size Uploaded Provenance
sayou_brain-0.5.2.tar.gz 33.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sayou-brain 0.5.2
File Interpreter ABI Platform
sayou_brain-0.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 54.7 kB

Release files / sayou_brain-0.5.2.tar.gz

Download URL sayou_brain-0.5.2.tar.gz
Size 33.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9e609b0a8724e717a1a4c3420366a1bed20607132c5bada89fd4b4ab12ef6c60
BLAKE2b-256 checksum
How to use checksums
0cd1f9296a4222284a7d3cbe029c50697c073758a029f9f1ff8a140733521b75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / sayou_brain-0.5.2-py3-none-any.whl

Download URL sayou_brain-0.5.2-py3-none-any.whl
Size 21.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d9bb9a9baad3cf43a3f96a3be17572ce5993378527e773718fcee0278b911451
BLAKE2b-256 checksum
How to use checksums
43e1a6f3746fc0a008fff8afbbd5f1fb2f37617122b8d48eef17f55411e71c40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Security for sayou-brain 0.5.2

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.5.2 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