graphbit 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. graphbit-0.6.0/LICENSE.md +92 -0
  2. graphbit-0.6.0/PKG-INFO +177 -0
  3. graphbit-0.6.0/README.md +137 -0
  4. graphbit-0.6.0/core/Cargo.toml +61 -0
  5. graphbit-0.6.0/core/README.md +550 -0
  6. graphbit-0.6.0/core/src/agents.rs +331 -0
  7. graphbit-0.6.0/core/src/document_loader.rs +797 -0
  8. graphbit-0.6.0/core/src/embeddings/python_bridge.rs +221 -0
  9. graphbit-0.6.0/core/src/embeddings.rs +766 -0
  10. graphbit-0.6.0/core/src/errors.rs +271 -0
  11. graphbit-0.6.0/core/src/graph.rs +741 -0
  12. graphbit-0.6.0/core/src/lib.rs +53 -0
  13. graphbit-0.6.0/core/src/llm/ai21.rs +363 -0
  14. graphbit-0.6.0/core/src/llm/anthropic.rs +268 -0
  15. graphbit-0.6.0/core/src/llm/azure_openai.rs +419 -0
  16. graphbit-0.6.0/core/src/llm/bytedance.rs +501 -0
  17. graphbit-0.6.0/core/src/llm/deepseek.rs +326 -0
  18. graphbit-0.6.0/core/src/llm/fireworks.rs +361 -0
  19. graphbit-0.6.0/core/src/llm/huggingface.rs +232 -0
  20. graphbit-0.6.0/core/src/llm/mistralai.rs +401 -0
  21. graphbit-0.6.0/core/src/llm/mod.rs +483 -0
  22. graphbit-0.6.0/core/src/llm/ollama.rs +422 -0
  23. graphbit-0.6.0/core/src/llm/openai.rs +383 -0
  24. graphbit-0.6.0/core/src/llm/openrouter.rs +401 -0
  25. graphbit-0.6.0/core/src/llm/perplexity.rs +334 -0
  26. graphbit-0.6.0/core/src/llm/providers.rs +567 -0
  27. graphbit-0.6.0/core/src/llm/python_bridge.rs +435 -0
  28. graphbit-0.6.0/core/src/llm/replicate.rs +491 -0
  29. graphbit-0.6.0/core/src/llm/response.rs +202 -0
  30. graphbit-0.6.0/core/src/llm/togetherai.rs +358 -0
  31. graphbit-0.6.0/core/src/llm/xai.rs +352 -0
  32. graphbit-0.6.0/core/src/text_splitter.rs +945 -0
  33. graphbit-0.6.0/core/src/types.rs +1221 -0
  34. graphbit-0.6.0/core/src/validation.rs +423 -0
  35. graphbit-0.6.0/core/src/workflow.rs +1648 -0
  36. graphbit-0.6.0/pyproject.toml +60 -0
  37. graphbit-0.6.0/python/Cargo.lock +2548 -0
  38. graphbit-0.6.0/python/Cargo.toml +69 -0
  39. graphbit-0.6.0/python/LICENSE.md +92 -0
  40. graphbit-0.6.0/python/README.md +137 -0
  41. graphbit-0.6.0/python/assets/Ecosystem.png +0 -0
  42. graphbit-0.6.0/python/assets/architecture.svg +62 -0
  43. graphbit-0.6.0/python/assets/logo(circle).png +0 -0
  44. graphbit-0.6.0/python/python-src/graphbit/__init__.py +141 -0
  45. graphbit-0.6.0/python/python-src/graphbit/providers/__init__.py +3 -0
  46. graphbit-0.6.0/python/python-src/graphbit/providers/huggingface/__init__.py +3 -0
  47. graphbit-0.6.0/python/python-src/graphbit/providers/huggingface/client.py +14 -0
  48. graphbit-0.6.0/python/python-src/graphbit/providers/huggingface/embeddings.py +28 -0
  49. graphbit-0.6.0/python/python-src/graphbit/providers/huggingface/inference.py +8 -0
  50. graphbit-0.6.0/python/python-src/graphbit/providers/huggingface/llm.py +14 -0
  51. graphbit-0.6.0/python/src/document_loader.rs +412 -0
  52. graphbit-0.6.0/python/src/embeddings/client.rs +200 -0
  53. graphbit-0.6.0/python/src/embeddings/config.rs +78 -0
  54. graphbit-0.6.0/python/src/embeddings/mod.rs +7 -0
  55. graphbit-0.6.0/python/src/errors.rs +231 -0
  56. graphbit-0.6.0/python/src/lib.rs +433 -0
  57. graphbit-0.6.0/python/src/llm/client.rs +1031 -0
  58. graphbit-0.6.0/python/src/llm/config.rs +289 -0
  59. graphbit-0.6.0/python/src/llm/mod.rs +9 -0
  60. graphbit-0.6.0/python/src/llm/response.rs +492 -0
  61. graphbit-0.6.0/python/src/runtime.rs +205 -0
  62. graphbit-0.6.0/python/src/text_splitter/config.rs +346 -0
  63. graphbit-0.6.0/python/src/text_splitter/mod.rs +9 -0
  64. graphbit-0.6.0/python/src/text_splitter/splitter.rs +450 -0
  65. graphbit-0.6.0/python/src/tools/decorator.rs +274 -0
  66. graphbit-0.6.0/python/src/tools/executor.rs +724 -0
  67. graphbit-0.6.0/python/src/tools/mod.rs +19 -0
  68. graphbit-0.6.0/python/src/tools/registry.rs +464 -0
  69. graphbit-0.6.0/python/src/tools/result.rs +287 -0
  70. graphbit-0.6.0/python/src/validation.rs +29 -0
  71. graphbit-0.6.0/python/src/workflow/context.rs +165 -0
  72. graphbit-0.6.0/python/src/workflow/executor.rs +816 -0
  73. graphbit-0.6.0/python/src/workflow/mod.rs +13 -0
  74. graphbit-0.6.0/python/src/workflow/node.rs +1038 -0
  75. graphbit-0.6.0/python/src/workflow/result.rs +187 -0
  76. graphbit-0.6.0/python/src/workflow/workflow.rs +86 -0
  77. graphbit-0.6.0/python-src/graphbit/__init__.py +141 -0
  78. graphbit-0.6.0/python-src/graphbit/providers/__init__.py +3 -0
  79. graphbit-0.6.0/python-src/graphbit/providers/huggingface/__init__.py +3 -0
  80. graphbit-0.6.0/python-src/graphbit/providers/huggingface/client.py +14 -0
  81. graphbit-0.6.0/python-src/graphbit/providers/huggingface/embeddings.py +28 -0
  82. graphbit-0.6.0/python-src/graphbit/providers/huggingface/inference.py +8 -0
  83. graphbit-0.6.0/python-src/graphbit/providers/huggingface/llm.py +14 -0
@@ -0,0 +1,92 @@
1
+ # GRAPHBIT FRAMEWORK LICENSE
2
+
3
+ Copyright © 2023–2025 InfinitiBit GmbH. All rights reserved.
4
+
5
+ By downloading, installing, or using the GraphBit framework (the “framework”), you agree to this License.
6
+
7
+ ## 1. Parties
8
+
9
+ Licensor: **InfinitiBit GmbH**, Heiglhofstr. 90, 81377 Munich, Germany.
10
+ Licensee: The individual or legal entity using the framework.
11
+
12
+ ## 2. Definitions
13
+
14
+ * **framework**: The complete source code and related materials provided by Licensor, including the Rust core, Python wrapper, scripts, libraries, and configuration described in the GraphBit documentation.
15
+ * **Outputs**: Results, data, and artifacts generated by the framework.
16
+ * **Enterprise Use**: Any use not expressly permitted under Model A or Model B, including but not limited to: (i) use by organizations with more than ten (10) employees or more than ten (10) active users, (ii) embedding in commercial products/services, or (iii) offering the framework or derivative works as a hosted service (e.g., API, SaaS, managed platform).
17
+ * **Active Users**: All persons using the framework, including employees, contractors, and/or end users accessing a product or service built on the framework.
18
+
19
+ ## 3. License Models
20
+
21
+ Any use not covered by Model A or Model B requires **Model C (Enterprise)** and a separate, executed license.
22
+
23
+ ### Model A — Free Use
24
+
25
+ **Eligibility:** Natural persons, academic/research institutions, and companies/startups with up to ten (10) employees **and** up to ten (10) Active Users.
26
+ **Grant:** Non-exclusive, revocable, non-transferable right to install and use the framework.
27
+ **Restrictions:** Redistribution (modified or unmodified) is **prohibited**.
28
+
29
+ ### Model B — Free Trial (Evaluation Only)
30
+
31
+ **Eligibility:** Legal entities/companies.
32
+ **Grant:** Non-exclusive, revocable, non-transferable right to install and use the framework **solely for internal evaluation** for up to thirty (30) consecutive days.
33
+ **Restrictions:** Redistribution and any commercial or production use are **prohibited**.
34
+
35
+ ### Model C — Enterprise License (Paid)
36
+
37
+ **Eligibility:** Anyone not covered by Model A or B.
38
+ **Grant:** Rights for commercial/production use are available **only** under a separately executed Enterprise License with agreed fees and terms.
39
+ **Restrictions:** **No** redistribution rights are granted by this public License. **Any** redistribution or sublicensing (modified or unmodified) must be expressly permitted in the separate Enterprise License.
40
+
41
+ ## 4. Ownership of Outputs
42
+
43
+ You own your **Outputs**. However, Outputs, logs, artifacts, or derived model weights may **not** be used to train, fine-tune, or distill any **competing large language model** without an Enterprise License.
44
+
45
+ ## 5. Responsible Use (Prohibited Uses)
46
+
47
+ You shall not use the framework or Outputs for:
48
+
49
+ * illegal activities;
50
+ * surveillance without lawful authority;
51
+ * military or autonomous weapon systems;
52
+ * disinformation;
53
+ * life-critical systems (including medical devices, aviation, nuclear) **without** an Enterprise License;
54
+ * any use reasonably expected to cause material harm to individuals, society, or the environment.
55
+
56
+ ## 6. Additional Restrictions
57
+
58
+ Except as expressly permitted above, you shall **not**:
59
+
60
+ * copy, distribute, publish, sublicense, rent, lease, or otherwise make the framework available to third parties;
61
+ * modify, adapt, or create derivative works **for any form of distribution**;
62
+ * remove or alter any copyright, attribution, or proprietary notices.
63
+
64
+ ## 7. Attribution & Trademarks
65
+
66
+ If you publicly reference or showcase the framework (e.g., in documentation, UI credits, research papers, product pages) where such use is **permitted under this License or a separate Enterprise License**, include the attribution:
67
+
68
+ > “Based on GraphBit by InfinitiBit GmbH https://graphbit.ai
69
+
70
+ No rights are granted to use the Licensor’s names, logos, or trademarks beyond the attribution above. **This clause does not grant any right to distribute the framework.**
71
+
72
+ ## 8. Termination
73
+
74
+ Licensor may terminate this License with one month’s notice to the end of the following month. Either party may terminate for cause without notice if the other party materially breaches this License and fails to cure within a reasonable period after written notice, or upon the Licensee’s insolvency, or in case of actions likely to cause significant reputational damage to Licensor.
75
+ Upon termination, you must immediately stop using the framework and destroy all copies. Unauthorized Enterprise Use obligates Licensee to pay retroactive license fees and damages.
76
+
77
+ ## 9. Warranty Disclaimer
78
+
79
+ THE FRAMEWORK IS PROVIDED “AS IS,” as described in the GraphBit documentation, **without** warranties of any kind, express or implied, including merchantability, fitness for a particular purpose, or non-infringement.
80
+
81
+ ## 10. Limitation of Liability
82
+
83
+ Licensor is liable only for defects and damages caused by intentional or grossly negligent conduct, and for damages resulting from injury to life, limb, or health, in accordance with applicable law.
84
+
85
+ ## 11. Governing Law & Jurisdiction
86
+
87
+ This License is governed by the laws of the Federal Republic of Germany. Exclusive jurisdiction lies with the competent courts of Munich, Germany.
88
+
89
+ ## 12. Contact
90
+
91
+ For Enterprise Licensing or commercial inquiries:
92
+ [contact@infinitibit.com](mailto:contact@infinitibit.com) — [https://graphbit.ai](https://graphbit.ai)
@@ -0,0 +1,177 @@
1
+ Metadata-Version: 2.4
2
+ Name: graphbit
3
+ Version: 0.6.0
4
+ Classifier: Development Status :: 4 - Beta
5
+ Classifier: License :: Other/Proprietary License
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: Operating System :: OS Independent
8
+ Classifier: Programming Language :: Python :: 3.9
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3.10
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Programming Language :: Rust
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
18
+ Requires-Dist: aiofiles>=23.0.0
19
+ Requires-Dist: aiohttp>=3.12.15
20
+ Requires-Dist: python-dotenv>=1.0.0
21
+ Requires-Dist: rich>=13.0.0
22
+ Requires-Dist: typer>=0.9.0
23
+ Requires-Dist: huggingface-hub>=0.33.4
24
+ Requires-Dist: numpy>=1.24.0
25
+ License-File: LICENSE.md
26
+ Summary: GraphBit - Advanced workflow automation and AI agent orchestration library
27
+ Keywords: ai,agents,workflow,automation,rust,python,llm,orchestration
28
+ Home-Page: https://graphbit.ai
29
+ Author-email: InfinitiBit Team <contact@infinitibit.ai>
30
+ Maintainer-email: InfinitiBit Team <contact@infinitibit.ai>
31
+ Requires-Python: >=3.9, <3.15
32
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
33
+ Project-URL: Bug Tracker, https://github.com/InfinitiBit/graphbit/issues
34
+ Project-URL: Changelog, https://github.com/InfinitiBit/graphbit/blob/main/CHANGELOG.md
35
+ Project-URL: Discord, https://discord.com/invite/huVJwkyu
36
+ Project-URL: Documentation, https://docs.graphbit.ai
37
+ Project-URL: Homepage, https://github.com/InfinitiBit/graphbit
38
+ Project-URL: Repository, https://github.com/InfinitiBit/graphbit
39
+
40
+ <div align="center">
41
+
42
+ # GraphBit - High Performance Agentic Framework
43
+
44
+ <p align="center">
45
+ <img src="../assets/GraphBit_Final_GB_Github_GIF.gif" style="max-width: 100%; height: auto;" alt="Logo" />
46
+ </p>
47
+
48
+ <!-- Added placeholders for links, fill it up when the corresponding links are available. -->
49
+ <p align="center">
50
+ <a href="https://graphbit.ai/">Website</a> |
51
+ <a href="https://docs.graphbit.ai/">Docs</a> |
52
+ <a href="https://discord.com/invite/huVJwkyu">Discord</a>
53
+ <br /><br />
54
+ </p>
55
+
56
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/InfinitiBit/graphbit/update-docs.yml?branch=main)](https://github.com/InfinitiBit/graphbit/actions/workflows/update-docs.yml)
57
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/InfinitiBit/graphbit/blob/main/CONTRIBUTING.md)
58
+ [![Rust Version](https://img.shields.io/badge/rust-1.70+-blue.svg)](https://www.rust-lang.org)
59
+ [![Python Version](https://img.shields.io/badge/python-3.10--3.13-blue.svg)](https://www.python.org)
60
+
61
+ **Type-Safe AI Agent Workflows with Rust Performance**
62
+
63
+ </div>
64
+
65
+ Graphbit is an **industry-grade agentic AI framework** built for developers and AI teams that demand stability, scalability, and low resource usage.
66
+
67
+ Written in **Rust** for maximum performance and safety, it delivers up to **68× lower CPU usage** and **140× lower memory** footprint than certain leading alternatives while consistently using far fewer resources than the rest, all while maintaining comparable throughput and execution speed. See [benchmarks](benchmarks/report/framework-benchmark-report.md) for more details.
68
+
69
+ Designed to run **multi-agent workflows in parallel**, Graphbit persists memory across steps, recovers from failures, and ensures **100% task success** under load. Its lightweight, resource-efficient architecture enables deployment in both **high-scale enterprise environments** and **low-resource edge scenarios**. With built-in observability and concurrency support, Graphbit eliminates the bottlenecks that slow decision-making and erode ROI.
70
+
71
+ ## Key Features
72
+
73
+ - **Tool Selection** - LLMs intelligently select tools based on descriptions
74
+ - **Type Safety** - Strong typing throughout the execution pipeline
75
+ - **Reliability** - Circuit breakers, retry policies, and error handling
76
+ - **Multi-LLM Support** - OpenAI, Azure OpenAI, Anthropic, OpenRouter, DeepSeek, Replicate, Ollama, TogetherAI
77
+ - **Resource Management** - Concurrency controls and memory optimization
78
+ - **Observability** - Built-in metrics and execution tracing
79
+
80
+ ## Quick Start
81
+
82
+ ### Installation
83
+
84
+ Recommended to use virtual environment.
85
+
86
+ ```bash
87
+ pip install graphbit
88
+ ```
89
+
90
+ ### Environment Setup
91
+ Set up API keys you want to use in your project:
92
+ ```bash
93
+ # OpenAI (optional – required if using OpenAI models)
94
+ export OPENAI_API_KEY=your_openai_api_key_here
95
+
96
+ # Anthropic (optional – required if using Anthropic models)
97
+ export ANTHROPIC_API_KEY=your_anthropic_api_key_here
98
+ ```
99
+
100
+ > **Security Note**: Never commit API keys to version control. Always use environment variables or secure secret management.
101
+
102
+ ### Basic Usage
103
+ ```python
104
+ import os
105
+
106
+ from graphbit import LlmConfig, Executor, Workflow, Node, tool
107
+
108
+ # Initialize and configure
109
+ config = LlmConfig.openai(os.getenv("OPENAI_API_KEY"), "gpt-4o-mini")
110
+
111
+ # Create executor
112
+ executor = Executor(config)
113
+
114
+ # Create tools with clear descriptions for LLM selection
115
+ @tool(_description="Get current weather information for any city")
116
+ def get_weather(location: str) -> dict:
117
+ return {"location": location, "temperature": 22, "condition": "sunny"}
118
+
119
+ @tool(_description="Perform mathematical calculations and return results")
120
+ def calculate(expression: str) -> str:
121
+ return f"Result: {eval(expression)}"
122
+
123
+ # Build workflow
124
+ workflow = Workflow("Analysis Pipeline")
125
+
126
+ # Create agent nodes
127
+ smart_agent = Node.agent(
128
+ name="Smart Agent",
129
+ prompt="What's the weather in Paris and calculate 15 + 27?",
130
+ system_prompt="You are an assistant skilled in weather lookup and math calculations. Use tools to answer queries accurately.",
131
+ tools=[get_weather, calculate]
132
+ )
133
+
134
+ processor = Node.agent(
135
+ name="Data Processor",
136
+ prompt="Process the results obtained from Smart Agent.",
137
+ system_prompt="""You process and organize results from other agents.
138
+
139
+ - Summarize and clarify key points
140
+ - Structure your output for easy reading
141
+ - Focus on actionable insights
142
+ """
143
+ )
144
+
145
+ # Connect and execute
146
+ id1 = workflow.add_node(smart_agent)
147
+ id2 = workflow.add_node(processor)
148
+ workflow.connect(id1, id2)
149
+
150
+ result = executor.execute(workflow)
151
+ print(f"Workflow completed: {result.is_success()}")
152
+ print("\nSmart Agent Output: \n", result.get_node_output("Smart Agent"))
153
+ print("\nData Processor Output: \n", result.get_node_output("Data Processor"))
154
+ ```
155
+
156
+ ## High-Level Architecture
157
+
158
+ <p align="center">
159
+ <img src="assets/architecture.svg" height="250" alt="GraphBit Architecture">
160
+ </p>
161
+
162
+ Three-tier design for reliability and performance:
163
+ - **Rust Core** - Workflow engine, agents, and LLM providers
164
+ - **Orchestration Layer** - Project management and execution
165
+ - **Python API** - PyO3 bindings with async support
166
+
167
+ ## Python API Integrations
168
+
169
+ GraphBit provides a rich Python API for building and integrating agentic workflows, including executors, nodes, LLM clients, and embeddings. For the complete list of classes, methods, and usage examples, see the [Python API Reference](docs/api-reference/python-api.md).
170
+
171
+ ## Contributing to GraphBit
172
+
173
+ We welcome contributions. To get started, please see the [Contributing](CONTRIBUTING.md) file for development setup and guidelines.
174
+
175
+ GraphBit is built by a wonderful community of researchers and engineers.
176
+
177
+
@@ -0,0 +1,137 @@
1
+ <div align="center">
2
+
3
+ # GraphBit - High Performance Agentic Framework
4
+
5
+ <p align="center">
6
+ <img src="../assets/GraphBit_Final_GB_Github_GIF.gif" style="max-width: 100%; height: auto;" alt="Logo" />
7
+ </p>
8
+
9
+ <!-- Added placeholders for links, fill it up when the corresponding links are available. -->
10
+ <p align="center">
11
+ <a href="https://graphbit.ai/">Website</a> |
12
+ <a href="https://docs.graphbit.ai/">Docs</a> |
13
+ <a href="https://discord.com/invite/huVJwkyu">Discord</a>
14
+ <br /><br />
15
+ </p>
16
+
17
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/InfinitiBit/graphbit/update-docs.yml?branch=main)](https://github.com/InfinitiBit/graphbit/actions/workflows/update-docs.yml)
18
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/InfinitiBit/graphbit/blob/main/CONTRIBUTING.md)
19
+ [![Rust Version](https://img.shields.io/badge/rust-1.70+-blue.svg)](https://www.rust-lang.org)
20
+ [![Python Version](https://img.shields.io/badge/python-3.10--3.13-blue.svg)](https://www.python.org)
21
+
22
+ **Type-Safe AI Agent Workflows with Rust Performance**
23
+
24
+ </div>
25
+
26
+ Graphbit is an **industry-grade agentic AI framework** built for developers and AI teams that demand stability, scalability, and low resource usage.
27
+
28
+ Written in **Rust** for maximum performance and safety, it delivers up to **68× lower CPU usage** and **140× lower memory** footprint than certain leading alternatives while consistently using far fewer resources than the rest, all while maintaining comparable throughput and execution speed. See [benchmarks](benchmarks/report/framework-benchmark-report.md) for more details.
29
+
30
+ Designed to run **multi-agent workflows in parallel**, Graphbit persists memory across steps, recovers from failures, and ensures **100% task success** under load. Its lightweight, resource-efficient architecture enables deployment in both **high-scale enterprise environments** and **low-resource edge scenarios**. With built-in observability and concurrency support, Graphbit eliminates the bottlenecks that slow decision-making and erode ROI.
31
+
32
+ ## Key Features
33
+
34
+ - **Tool Selection** - LLMs intelligently select tools based on descriptions
35
+ - **Type Safety** - Strong typing throughout the execution pipeline
36
+ - **Reliability** - Circuit breakers, retry policies, and error handling
37
+ - **Multi-LLM Support** - OpenAI, Azure OpenAI, Anthropic, OpenRouter, DeepSeek, Replicate, Ollama, TogetherAI
38
+ - **Resource Management** - Concurrency controls and memory optimization
39
+ - **Observability** - Built-in metrics and execution tracing
40
+
41
+ ## Quick Start
42
+
43
+ ### Installation
44
+
45
+ Recommended to use virtual environment.
46
+
47
+ ```bash
48
+ pip install graphbit
49
+ ```
50
+
51
+ ### Environment Setup
52
+ Set up API keys you want to use in your project:
53
+ ```bash
54
+ # OpenAI (optional – required if using OpenAI models)
55
+ export OPENAI_API_KEY=your_openai_api_key_here
56
+
57
+ # Anthropic (optional – required if using Anthropic models)
58
+ export ANTHROPIC_API_KEY=your_anthropic_api_key_here
59
+ ```
60
+
61
+ > **Security Note**: Never commit API keys to version control. Always use environment variables or secure secret management.
62
+
63
+ ### Basic Usage
64
+ ```python
65
+ import os
66
+
67
+ from graphbit import LlmConfig, Executor, Workflow, Node, tool
68
+
69
+ # Initialize and configure
70
+ config = LlmConfig.openai(os.getenv("OPENAI_API_KEY"), "gpt-4o-mini")
71
+
72
+ # Create executor
73
+ executor = Executor(config)
74
+
75
+ # Create tools with clear descriptions for LLM selection
76
+ @tool(_description="Get current weather information for any city")
77
+ def get_weather(location: str) -> dict:
78
+ return {"location": location, "temperature": 22, "condition": "sunny"}
79
+
80
+ @tool(_description="Perform mathematical calculations and return results")
81
+ def calculate(expression: str) -> str:
82
+ return f"Result: {eval(expression)}"
83
+
84
+ # Build workflow
85
+ workflow = Workflow("Analysis Pipeline")
86
+
87
+ # Create agent nodes
88
+ smart_agent = Node.agent(
89
+ name="Smart Agent",
90
+ prompt="What's the weather in Paris and calculate 15 + 27?",
91
+ system_prompt="You are an assistant skilled in weather lookup and math calculations. Use tools to answer queries accurately.",
92
+ tools=[get_weather, calculate]
93
+ )
94
+
95
+ processor = Node.agent(
96
+ name="Data Processor",
97
+ prompt="Process the results obtained from Smart Agent.",
98
+ system_prompt="""You process and organize results from other agents.
99
+
100
+ - Summarize and clarify key points
101
+ - Structure your output for easy reading
102
+ - Focus on actionable insights
103
+ """
104
+ )
105
+
106
+ # Connect and execute
107
+ id1 = workflow.add_node(smart_agent)
108
+ id2 = workflow.add_node(processor)
109
+ workflow.connect(id1, id2)
110
+
111
+ result = executor.execute(workflow)
112
+ print(f"Workflow completed: {result.is_success()}")
113
+ print("\nSmart Agent Output: \n", result.get_node_output("Smart Agent"))
114
+ print("\nData Processor Output: \n", result.get_node_output("Data Processor"))
115
+ ```
116
+
117
+ ## High-Level Architecture
118
+
119
+ <p align="center">
120
+ <img src="assets/architecture.svg" height="250" alt="GraphBit Architecture">
121
+ </p>
122
+
123
+ Three-tier design for reliability and performance:
124
+ - **Rust Core** - Workflow engine, agents, and LLM providers
125
+ - **Orchestration Layer** - Project management and execution
126
+ - **Python API** - PyO3 bindings with async support
127
+
128
+ ## Python API Integrations
129
+
130
+ GraphBit provides a rich Python API for building and integrating agentic workflows, including executors, nodes, LLM clients, and embeddings. For the complete list of classes, methods, and usage examples, see the [Python API Reference](docs/api-reference/python-api.md).
131
+
132
+ ## Contributing to GraphBit
133
+
134
+ We welcome contributions. To get started, please see the [Contributing](CONTRIBUTING.md) file for development setup and guidelines.
135
+
136
+ GraphBit is built by a wonderful community of researchers and engineers.
137
+
@@ -0,0 +1,61 @@
1
+ [dependencies]
2
+ pyo3 = {workspace = true, optional = true}
3
+ anyhow.workspace = true
4
+ async-trait.workspace = true
5
+ chrono.workspace = true
6
+ csv.workspace = true
7
+ docx-rs.workspace = true
8
+ futures.workspace = true
9
+ lazy_static.workspace = true
10
+ lopdf.workspace = true
11
+ pdf-extract.workspace = true
12
+ petgraph.workspace = true
13
+ quick-xml.workspace = true
14
+ rand.workspace = true
15
+ regex.workspace = true
16
+ reqwest.workspace = true
17
+ scraper.workspace = true
18
+ serde.workspace = true
19
+ serde_json.workspace = true
20
+ thiserror.workspace = true
21
+ tokio.workspace = true
22
+ tracing.workspace = true
23
+ tracing-subscriber.workspace = true
24
+ uuid.workspace = true
25
+
26
+ [features]
27
+ default = []
28
+ python = ["pyo3"]
29
+
30
+ [lints]
31
+ workspace = true
32
+
33
+ [package]
34
+ description = "Core engine for GraphBit agentic workflow automation"
35
+ name = "graphbit-core"
36
+ authors.workspace = true
37
+ categories.workspace = true
38
+ documentation.workspace = true
39
+ edition.workspace = true
40
+ homepage.workspace = true
41
+ keywords.workspace = true
42
+ license-file.workspace = true
43
+ repository.workspace = true
44
+ rust-version.workspace = true
45
+ version.workspace = true
46
+ readme = "README.md"
47
+
48
+ # Enable vendored OpenSSL for aarch64 cross-compilation
49
+ # Cross-compilation containers lack aarch64-specific OpenSSL dev packages
50
+ [target.aarch64-unknown-linux-gnu]
51
+
52
+ [target.aarch64-unknown-linux-gnu.dependencies]
53
+ openssl = {version = "0.10", features = ["vendored"]}
54
+
55
+ # Enable vendored OpenSSL for musl targets (Alpine Linux)
56
+ # musl containers don't have OpenSSL dev packages, so we compile from source
57
+ [target.'cfg(target_env = "musl")'.dependencies]
58
+ openssl = {version = "0.10", features = ["vendored"]}
59
+
60
+ [target.'cfg(unix)'.dependencies]
61
+ jemallocator.workspace = true