Skip to content

Proposal: Introduce a compatible Graph Authoring API #131

@laipz8200

Description

@laipz8200

Summary

Introduce a typed Graph Authoring API for building Graphon workflow definitions in Python while continuing to emit the existing runtime graph_config format.

Goals

  • Provide a clearer, user-facing API for common graph construction flows.
  • Preserve compatibility with the current runtime graph schema and execution behavior.
  • Keep legacy compatibility code isolated so it can be removed after downstream migration.
  • Avoid exposing internal/runtime-only nodes as first-class authoring concepts.

Non-goals

  • This proposal does not change the runtime graph format.
  • This proposal does not cover the LLM protocol rename or standard Slim LLM runtime work, which is being handled separately.
  • This proposal does not attempt to expose every legacy node in the first stage.

Example

A basic three-node chat workflow should be expressible with straightforward Python authoring code:

graph = Graph()
start = graph.start("start", inputs={"query": "paragraph"})
reply = graph.llm(
    "reply",
    model=OpenAIChat("gpt-4.1-mini"),
    system="You are a helpful assistant.",
    user=Prompt("{{ query }}", query=start.output("query")),
    after=start,
)
graph.answer("answer", text=reply.output("text"), after=reply)

config = graph.to_config()

Rollout

The plan is to land the API incrementally with focused runtime validation tests and concise documentation. Compatibility aliases and migration-only code should be clearly marked and kept in dedicated compatibility boundaries.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions