Skip to main content

sayou-assembler

PyPI version License Docs

Overview

The Knowledge Builder for Sayou Fabric.

sayou-assembler acts as the structural engineer of the pipeline. It accepts flat lists of SayouNode objects produced by the Wrapper and constructs meaningful relationships (Edges), embeddings, or specific query payloads.

While the Wrapper focuses on what the data is (Schema), the Assembler focuses on how the data connects (Topology).


1. Architecture & Role

The Assembler takes standardized Nodes and applies a Building Strategy to generate a connected graph structure or vector payloads ready for loading.

graph LR
    Nodes[Flat SayouNodes] --> Pipeline[Assembler Pipeline]
    
    subgraph Builders
        Graph[General Graph]
        Code[Python AST]
        Time[Timeline]
        Vector[Embeddings]
        Cypher[Cypher Query]
    end
    
    Pipeline -->|Config Routing| Builders
    Builders --> Payload[Connected Payload]

1.1. Core Features

  • Topology Construction: Automatically links nodes (e.g., Parent-Child, Function-Class) based on metadata.
  • Domain Specificity: Dedicated builders for Python code analysis and Video timelines.
  • Bi-directional Linking: Automatically generates reverse edges (e.g., contains <-> belongsTo) to ensure graph traversability.

2. Available Strategies

sayou-assembler provides specialized builders for different data domains.

Strategy Key Builder Class Description
graph GraphBuilder [Default] Generic builder. Links nodes based on parent_id and generic relationships.
code CodeGraphBuilder [Code] Parses Python AST metadata to link Imports, Classes, and Methods.
timeline TimelineBuilder [Media] Sequences video segments or logs chronologically (NEXT, PREV).
vector VectorBuilder [Search] Converts node content into vector embeddings.
cypher CypherBuilder [DB] Generates Neo4j MERGE statements for idempotent inserts.

3. Installation

pip install sayou-assembler

4. Usage

The AssemblerPipeline is the entry point. It transforms SayouOutput (from Wrapper) into a dictionary containing nodes and edges.

Case A: General Graph Construction

The default strategy for general documents (PDF, Markdown).

from sayou.assembler import AssemblerPipeline

wrapper_output = {
    "nodes": [
        {"node_id": "doc:1", "node_class": "sayou:Document", "attributes": {...}},
        {"node_id": "doc:1:header", "attributes": {"meta:parent_id": "doc:1"}, ...}
    ]
}

graph_data = AssemblerPipeline.process(data=wrapper_output)

print(f"Nodes: {len(graph_data['nodes'])}, Edges: {len(graph_data['edges'])}")

Case B: Python Code Graph

Links functions to classes and resolves import dependencies.

from sayou.assembler import AssemblerPipeline

wrapper_output = {
    "nodes": [
        {"node_id": "doc:1", "node_class": "sayou:Document", "attributes": {...}},
        {"node_id": "doc:1:header", "attributes": {"meta:parent_id": "doc:1"}, ...}
    ]
}

code_graph = AssemblerPipeline.process(data=wrapper_output)

print(f"Dependency Edges: {len(code_graph['edges'])}")

Case C: Multimedia Timeline

Sequences video segments by time.

from sayou.assembler import AssemblerPipeline

wrapper_output = {
    "nodes": [
        {"node_id": "doc:1", "node_class": "sayou:Document", "attributes": {...}},
        {"node_id": "doc:1:header", "attributes": {"meta:parent_id": "doc:1"}, ...}
    ]
}

timeline_graph = AssemblerPipeline.process(data=wrapper_output)
print(f"Timeline Sequence Created.")

5. Configuration Keys

You can customize the building process via the config dictionary.

  • graph: create_reverse_edges (bool), default_edge_label.
  • python: resolve_imports (bool), include_external_libs (bool).
  • timeline: interval_threshold (float).
  • vector: embedding_model (e.g., openai, huggingface), batch_size.
  • cypher: merge_mode (bool), batch_size.

6. License

Apache 2.0 License © 2026 Sayouzone

7. Plugin List

Plugin Example Description
Code Graph Assembler ▶
Timeline Assembler ▶

Metadata

Release files for sayou-assembler 0.5.0

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-assembler 0.5.0
File Size Uploaded Provenance
sayou_assembler-0.5.0.tar.gz 42.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sayou-assembler 0.5.0
File Interpreter ABI Platform
sayou_assembler-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 65.2 kB

Release files / sayou_assembler-0.5.0.tar.gz

Download URL sayou_assembler-0.5.0.tar.gz
Size 42.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ae0a29f0be3eb29a97fc3a1cb761b09d245e0d0dbddcdceb0a30568736474cf6
BLAKE2b-256 checksum
How to use checksums
ed6b6019a89641038831a6f82f7df3118208ba0176dd31d8fbe9a39d8b589ac8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / sayou_assembler-0.5.0-py3-none-any.whl

Download URL sayou_assembler-0.5.0-py3-none-any.whl
Size 22.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
652b386a88685c508d158fc6949b3faf2b912cc5b584151f3d48109379c718da
BLAKE2b-256 checksum
How to use checksums
893a94b121895d3aa1e670b8f5e533b4de2e2cd69e228692a3f1025985fc29c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for sayou-assembler 0.5.0

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.

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