Skip to main content

Brain components for the Sayou Data Platform

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sayou_brain-0.5.2.tar.gz (33.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sayou_brain-0.5.2-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file sayou_brain-0.5.2.tar.gz.

File metadata

  • Download URL: sayou_brain-0.5.2.tar.gz
  • Upload date:
  • Size: 33.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sayou_brain-0.5.2.tar.gz
Algorithm Hash digest
SHA256 9e609b0a8724e717a1a4c3420366a1bed20607132c5bada89fd4b4ab12ef6c60
MD5 25f5c608d0e0fc1d8d8e8a38afa33d13
BLAKE2b-256 0cd1f9296a4222284a7d3cbe029c50697c073758a029f9f1ff8a140733521b75

See more details on using hashes here.

File details

Details for the file sayou_brain-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: sayou_brain-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 21.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sayou_brain-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d9bb9a9baad3cf43a3f96a3be17572ce5993378527e773718fcee0278b911451
MD5 98f7e037bc0ffa67f417f1568106c07e
BLAKE2b-256 43e1a6f3746fc0a008fff8afbbd5f1fb2f37617122b8d48eef17f55411e71c40

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page