Install
GenXAI is a Python framework. Install from PyPI:
pip install genxai-framework
See the dedicated Installation page for more options.
Optional extras:
pip install "genxai-framework[llm,tools,api]"
Set your API key
export OPENAI_API_KEY="sk-your-key"
Create a minimal graph workflow
This is a simplified version of the example shown in the repository README.
import os
from genxai import Agent, AgentConfig, AgentRegistry, Graph
os.environ["OPENAI_API_KEY"] = "sk-..."
classifier = Agent(
id="classifier",
config=AgentConfig(
role="Classifier",
goal="Categorize customer requests",
llm_model="gpt-4",
),
)
support = Agent(
id="support",
config=AgentConfig(
role="Support Agent",
goal="Resolve customer issues",
llm_model="claude-3-opus",
enable_memory=True,
),
)
AgentRegistry.register(classifier)
AgentRegistry.register(support)
graph = Graph()
# Add nodes + edges, then run
result = await graph.run(input_data="My app crashed")
print(result)
Next steps
- Read about the system design in Architecture
- Learn coordination patterns in Flows
- Explore runnable samples on the Examples page