Brain components for the Sayou Data Platform
Project description
sayou-brain
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
Connectorbased 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sayou_brain-0.5.1.tar.gz.
File metadata
- Download URL: sayou_brain-0.5.1.tar.gz
- Upload date:
- Size: 33.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
943038615bafe8386f9455a394d406d84fa90931fe56ca658718052c66ae90f3
|
|
| MD5 |
07b7ae706f8a99997548a60a82a31915
|
|
| BLAKE2b-256 |
3bc858d2e209362f699f259f994e1aa088ce1db9c166bad2fdad26095c19e7d7
|
File details
Details for the file sayou_brain-0.5.1-py3-none-any.whl.
File metadata
- Download URL: sayou_brain-0.5.1-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.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f716906798518128cf1bc0616ff7292ffe1342ce332f2795a45752635bacab7
|
|
| MD5 |
f16f105e2b728369014a96dcc03c0a7d
|
|
| BLAKE2b-256 |
dc36c857f46d61381b34fffc32080cd16dcd3aa752a1a3b56f90ee1de2465471
|