Skip to main content

Assembler components for the Sayou Data Platform

Project description

sayou-assembler

PyPI version License Docs

The Knowledge Builder for Sayou Fabric.

sayou-assembler is the construction site of the data pipeline. It takes the standardized SayouNode objects produced by the Wrapper and assembles them into target-specific formats ready for loading into databases.

It bridges the gap between the abstract data model and concrete storage technologies (Graph DBs, Vector DBs).

💡 Core Philosophy

"Build Once, Deploy Anywhere."

The Assembler decouples the structure of knowledge from the syntax of the database.

  • Graph Builder: Constructs a topology of Nodes and Edges (including automatic reverse linking).
  • Vector Builder: Transforms nodes into embeddings and metadata payloads.
  • Query Builder: Generates specific query languages like Cypher or SQL.

📦 Installation

pip install sayou-assembler

⚡ Quick Start

The AssemblerPipeline converts standardized data into database payloads.

from sayou.assembler.pipeline import AssemblerPipeline

def run_demo():
    # 1. Initialize (Inject embedding function for Vector Builder)
    pipeline = AssemblerPipeline()
    pipeline.initialize(embedding_fn=my_embedding_func)

    # 2. Input Data (from sayou-wrapper)
    wrapper_output = {
        "nodes": [
            {"node_id": "doc_1", "node_class": "sayou:Document", "attributes": {"text": "..."}},
            # ...
        ]
    }

    # 3. Build for Graph DB (Nodes + Edges)
    graph_data = pipeline.run(wrapper_output, strategy="graph")
    print(f"Edges created: {len(graph_data['edges'])}")
    
    # 4. Build for Vector DB (Embeddings)
    vector_data = pipeline.run(wrapper_output, strategy="vector")
    print(f"Vectors created: {len(vector_data)}")

if __name__ == "__main__":
    def my_embedding_func(text): return [0.1, 0.2, 0.3] # Dummy
    run_demo()

🔑 Key Components

Builders

  • GraphBuilder: Converts nodes into a generic graph structure (Dictionary). Automatically creates reverse edges (e.g., hasChild from hasParent) to ensure bi-directional traversability.
  • VectorBuilder: Extracts text from nodes, computes embeddings, and formats payloads for Vector DBs.

Plugins

  • CypherBuilder: Generates Neo4j MERGE queries to insert nodes and relationships idempotently.

🤝 Contributing

We welcome builders for other targets (e.g., SqlBuilder, GremlinBuilder).

📜 License

Apache 2.0 License © 2025 Sayouzone

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_assembler-0.3.1.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

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

sayou_assembler-0.3.1-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file sayou_assembler-0.3.1.tar.gz.

File metadata

  • Download URL: sayou_assembler-0.3.1.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sayou_assembler-0.3.1.tar.gz
Algorithm Hash digest
SHA256 59ce9e034508e4ad1b0cab8bb3c347b7313f6e4c39c3cc33b10cdc631fb3d8fa
MD5 a4bca4b581e678467618368d22e50209
BLAKE2b-256 0fedb9dcf9eefc6da5fb12e2022d28c0945aa51af01de2d63e219c2dbc614a4e

See more details on using hashes here.

File details

Details for the file sayou_assembler-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sayou_assembler-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a5b333bfd27eacf2b5d1da9c959df869df1f043bc22616e0e895b32975bdfec
MD5 ee38b5a6dc07cb15728995fc1727d1d6
BLAKE2b-256 b1ec7274727290cbb42889ffad7ecc60bed20b3cf5acef531f37b8dd25081f9a

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