Skip to content

SDK Overview

DuraGraph provides official SDKs for Python and Go, enabling you to build AI agents in your preferred language.

The Python SDK is ideal for rapid prototyping, data science workflows, and teams already using Python for AI/ML.

Terminal window
pip install duragraph-python

Key Features:

  • Decorator-based graph definition (@Graph, @llm_node, etc.)
  • Built-in vector store integrations (Chroma, Pinecone, Qdrant, etc.)
  • Embedding providers (OpenAI, Cohere, Ollama)
  • CLI for local development
from duragraph import Graph, llm_node, entrypoint
@Graph(id="my_agent")
class MyAgent:
@entrypoint
@llm_node(model="gpt-4o-mini")
def think(self, state):
return state
# Run locally
agent = MyAgent()
result = agent.run({"message": "Hello"})
# Or connect to control plane
agent.serve("http://localhost:8081")

The Go SDK is designed for high-performance, production-grade deployments with strong typing and low latency.

Terminal window
go get github.com/duragraph/duragraph-go

Key Features:

  • Generic graph definition with compile-time type safety
  • Interface-based node and provider design
  • High-performance worker runtime
  • Idiomatic Go patterns
package main
import (
"context"
"github.com/duragraph/duragraph-go/graph"
"github.com/duragraph/duragraph-go/worker"
)
type ChatState struct {
Messages []string `json:"messages"`
Result string `json:"result"`
}
type ThinkNode struct{}
func (n *ThinkNode) Execute(ctx context.Context, state *ChatState) (*ChatState, error) {
state.Result = "Hello from Go!"
return state, nil
}
func main() {
g := graph.New[*ChatState]("my_agent")
g.AddNode("think", &ThinkNode{})
g.SetEntrypoint("think")
// Run locally
result, _ := g.Run(context.Background(), &ChatState{})
// Or connect to control plane
w := worker.New(g, worker.WithControlPlane("http://localhost:8081"))
w.Start(context.Background())
}
Use CaseRecommended SDK
Rapid prototypingPython
Data science / ML pipelinesPython
High-performance productionGo
Existing Go codebaseGo
RAG applicationsPython (more integrations)
Low-latency requirementsGo

See the Feature Matrix for a detailed comparison of features available in each SDK.