RouteKitAI 0.1.0__tar.gz → 0.2.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 (117) hide show
  1. {routekitai-0.1.0/src/RouteKitAI.egg-info → routekitai-0.2.0}/PKG-INFO +29 -26
  2. {routekitai-0.1.0 → routekitai-0.2.0}/README.md +28 -25
  3. routekitai-0.2.0/docs/api-reference.md +135 -0
  4. {routekitai-0.1.0 → routekitai-0.2.0}/docs/architecture.md +7 -6
  5. routekitai-0.2.0/docs/getting-started.md +117 -0
  6. routekitai-0.2.0/docs/guides/cli-reference.md +134 -0
  7. routekitai-0.2.0/docs/guides/creating-tools.md +122 -0
  8. routekitai-0.2.0/docs/guides/graph-workflows.md +110 -0
  9. routekitai-0.2.0/docs/guides/providers.md +113 -0
  10. routekitai-0.2.0/docs/guides/running-agents.md +111 -0
  11. routekitai-0.2.0/docs/guides/tracing-and-replay.md +106 -0
  12. routekitai-0.2.0/docs/index.md +56 -0
  13. {routekitai-0.1.0 → routekitai-0.2.0}/docs/security-and-governance.md +3 -17
  14. routekitai-0.2.0/examples/basic.py +30 -0
  15. {routekitai-0.1.0 → routekitai-0.2.0}/examples/eval_regression.py +10 -5
  16. {routekitai-0.1.0 → routekitai-0.2.0}/examples/function_calling_policy.py +3 -3
  17. routekitai-0.2.0/examples/graph_policy.py +119 -0
  18. routekitai-0.2.0/examples/plan_execute_policy.py +91 -0
  19. {routekitai-0.1.0 → routekitai-0.2.0}/examples/react_policy.py +5 -5
  20. {routekitai-0.1.0 → routekitai-0.2.0}/examples/supervisor_agent.py +18 -3
  21. {routekitai-0.1.0 → routekitai-0.2.0}/examples/supervisor_policy.py +30 -8
  22. {routekitai-0.1.0 → routekitai-0.2.0/src/RouteKitAI.egg-info}/PKG-INFO +29 -26
  23. {routekitai-0.1.0 → routekitai-0.2.0}/src/RouteKitAI.egg-info/SOURCES.txt +9 -1
  24. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/__init__.py +1 -1
  25. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/core/message.py +2 -2
  26. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/core/policies.py +18 -13
  27. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/core/policy.py +3 -0
  28. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/core/policy_adapter.py +17 -2
  29. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/core/runtime.py +49 -11
  30. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/core/tool.py +2 -2
  31. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/graphs/graph.py +2 -2
  32. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/message.py +2 -2
  33. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/sandbox/permissions.py +2 -2
  34. routekitai-0.1.0/docs/oidc-publishing.md +0 -146
  35. routekitai-0.1.0/examples/basic.py +0 -54
  36. routekitai-0.1.0/examples/graph_policy.py +0 -49
  37. routekitai-0.1.0/examples/plan_execute_policy.py +0 -55
  38. {routekitai-0.1.0 → routekitai-0.2.0}/CHANGELOG.md +0 -0
  39. {routekitai-0.1.0 → routekitai-0.2.0}/LICENSE +0 -0
  40. {routekitai-0.1.0 → routekitai-0.2.0}/MANIFEST.in +0 -0
  41. {routekitai-0.1.0 → routekitai-0.2.0}/examples/__init__.py +0 -0
  42. {routekitai-0.1.0 → routekitai-0.2.0}/examples/graph_agent.py +0 -0
  43. {routekitai-0.1.0 → routekitai-0.2.0}/examples/graph_agent_real.py +0 -0
  44. {routekitai-0.1.0 → routekitai-0.2.0}/examples/hello_routekit.py +0 -0
  45. {routekitai-0.1.0 → routekitai-0.2.0}/pyproject.toml +0 -0
  46. {routekitai-0.1.0 → routekitai-0.2.0}/setup.cfg +0 -0
  47. {routekitai-0.1.0 → routekitai-0.2.0}/src/RouteKitAI.egg-info/dependency_links.txt +0 -0
  48. {routekitai-0.1.0 → routekitai-0.2.0}/src/RouteKitAI.egg-info/entry_points.txt +0 -0
  49. {routekitai-0.1.0 → routekitai-0.2.0}/src/RouteKitAI.egg-info/requires.txt +0 -0
  50. {routekitai-0.1.0 → routekitai-0.2.0}/src/RouteKitAI.egg-info/top_level.txt +0 -0
  51. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/cli/__init__.py +0 -0
  52. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/cli/main.py +0 -0
  53. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/cli/replay.py +0 -0
  54. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/cli/run.py +0 -0
  55. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/cli/serve.py +0 -0
  56. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/cli/test_agent.py +0 -0
  57. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/cli/trace.py +0 -0
  58. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/cli/trace_analyze.py +0 -0
  59. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/cli/trace_search.py +0 -0
  60. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/core/__init__.py +0 -0
  61. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/core/agent.py +0 -0
  62. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/core/errors.py +0 -0
  63. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/core/hooks.py +0 -0
  64. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/core/memory.py +0 -0
  65. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/core/model.py +0 -0
  66. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/core/tools.py +0 -0
  67. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/evals/__init__.py +0 -0
  68. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/evals/dataset.py +0 -0
  69. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/evals/metrics.py +0 -0
  70. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/evals/runner.py +0 -0
  71. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/graphs/__init__.py +0 -0
  72. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/graphs/executors.py +0 -0
  73. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/memory/__init__.py +0 -0
  74. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/memory/episodic.py +0 -0
  75. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/memory/kv.py +0 -0
  76. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/memory/retrieval.py +0 -0
  77. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/memory/vector.py +0 -0
  78. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/memory/working.py +0 -0
  79. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/model.py +0 -0
  80. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/observability/__init__.py +0 -0
  81. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/observability/analyzer.py +0 -0
  82. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/observability/exporters/__init__.py +0 -0
  83. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/observability/exporters/base.py +0 -0
  84. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/observability/exporters/jsonl.py +0 -0
  85. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/observability/exporters/otel.py +0 -0
  86. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/observability/spans.py +0 -0
  87. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/observability/streaming.py +0 -0
  88. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/observability/trace.py +0 -0
  89. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/providers/__init__.py +0 -0
  90. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/providers/anthropic.py +0 -0
  91. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/providers/azure_openai.py +0 -0
  92. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/providers/local.py +0 -0
  93. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/providers/openai.py +0 -0
  94. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/py.typed +0 -0
  95. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/sandbox/__init__.py +0 -0
  96. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/sandbox/filesystem.py +0 -0
  97. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/sandbox/network.py +0 -0
  98. {routekitai-0.1.0 → routekitai-0.2.0}/src/routekitai/tool.py +0 -0
  99. {routekitai-0.1.0 → routekitai-0.2.0}/tests/test_evals.py +0 -0
  100. {routekitai-0.1.0 → routekitai-0.2.0}/tests/test_graphs.py +0 -0
  101. {routekitai-0.1.0 → routekitai-0.2.0}/tests/test_graphs_subgraph.py +0 -0
  102. {routekitai-0.1.0 → routekitai-0.2.0}/tests/test_hooks.py +0 -0
  103. {routekitai-0.1.0 → routekitai-0.2.0}/tests/test_integration.py +0 -0
  104. {routekitai-0.1.0 → routekitai-0.2.0}/tests/test_memory.py +0 -0
  105. {routekitai-0.1.0 → routekitai-0.2.0}/tests/test_memory_kv.py +0 -0
  106. {routekitai-0.1.0 → routekitai-0.2.0}/tests/test_memory_vector.py +0 -0
  107. {routekitai-0.1.0 → routekitai-0.2.0}/tests/test_message.py +0 -0
  108. {routekitai-0.1.0 → routekitai-0.2.0}/tests/test_otel_exporter.py +0 -0
  109. {routekitai-0.1.0 → routekitai-0.2.0}/tests/test_runtime.py +0 -0
  110. {routekitai-0.1.0 → routekitai-0.2.0}/tests/test_sandbox_filesystem.py +0 -0
  111. {routekitai-0.1.0 → routekitai-0.2.0}/tests/test_sandbox_network.py +0 -0
  112. {routekitai-0.1.0 → routekitai-0.2.0}/tests/test_streaming.py +0 -0
  113. {routekitai-0.1.0 → routekitai-0.2.0}/tests/test_streaming_serve.py +0 -0
  114. {routekitai-0.1.0 → routekitai-0.2.0}/tests/test_tool.py +0 -0
  115. {routekitai-0.1.0 → routekitai-0.2.0}/tests/test_tools.py +0 -0
  116. {routekitai-0.1.0 → routekitai-0.2.0}/tests/test_trace_analyzer.py +0 -0
  117. {routekitai-0.1.0 → routekitai-0.2.0}/tests/test_trace_analyzer_integration.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: RouteKitAI
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: An agent development + orchestration framework
5
5
  Author: Mohamed Ghassen Brahim
6
6
  License: MIT
@@ -195,50 +195,53 @@ asyncio.run(main())
195
195
 
196
196
  - **[Architecture Guide](docs/architecture.md)**: Deep dive into RouteKitAI's design
197
197
  - **[Security & Governance](docs/security-and-governance.md)**: Security features and best practices
198
- - **[API Reference](https://RouteKitAI.readthedocs.io)**: Complete API documentation (coming soon)
198
+ - **[Full documentation](https://routekitai.readthedocs.io)**: Architecture, security, and guides (Read the Docs)
199
199
 
200
200
  ## 🎓 Examples
201
201
 
202
202
  Check out the [`examples/`](examples/) directory for complete examples:
203
203
 
204
- - **[Basic Agent](examples/hello_RouteKitAI.py)**: Simple agent with tools
205
- - **[Graph Orchestration](examples/graph_agent.py)**: Multi-agent workflow
206
- - **[Supervisor Pattern](examples/supervisor_agent.py)**: Supervisor delegating to sub-agents
204
+ - **[Basic Agent](examples/basic.py)** / **[Hello RouteKit](examples/hello_routekit.py)**: Simple agent with tools
205
+ - **[Graph Orchestration](examples/graph_agent.py)** / **[Graph Policy](examples/graph_policy.py)**: Multi-agent workflows
206
+ - **[Supervisor Pattern](examples/supervisor_agent.py)** / **[Supervisor Policy](examples/supervisor_policy.py)**: Supervisor delegating to sub-agents
207
+ - **[ReAct / Plan–Execute / Function Calling](examples/react_policy.py)**, **[Plan–Execute](examples/plan_execute_policy.py)**, **[Function Calling](examples/function_calling_policy.py)**: Policy examples
207
208
  - **[Evaluation Harness](examples/eval_regression.py)**: Testing agents with datasets
208
209
 
210
+ Run all examples: `./scripts/run_examples.sh` (or `bash scripts/run_examples.sh`).
211
+
209
212
  ## 🛠️ CLI Commands
210
213
 
211
- RouteKitAI provides a CLI for common operations:
214
+ RouteKitAI provides a CLI (`routekitai`) for common operations:
212
215
 
213
216
  ```bash
214
217
  # Run an agent script
215
- RouteKitAI run agent_script.py
218
+ routekitai run agent_script.py
216
219
 
217
220
  # View a trace (multiple formats available)
218
- RouteKitAI trace <trace_id> # Table view (default)
219
- RouteKitAI trace <trace_id> --format timeline # Timeline visualization
220
- RouteKitAI trace <trace_id> --format steps # Step-by-step execution
221
- RouteKitAI trace <trace_id> --format json # JSON output
222
- RouteKitAI trace <trace_id> --format raw # Raw JSONL
221
+ routekitai trace <trace_id> # Table view (default)
222
+ routekitai trace <trace_id> --format timeline # Timeline visualization
223
+ routekitai trace <trace_id> --format steps # Step-by-step execution
224
+ routekitai trace <trace_id> --format json # JSON output
225
+ routekitai trace <trace_id> --format raw # Raw JSONL
223
226
 
224
227
  # Analyze trace metrics
225
- RouteKitAI trace-analyze <trace_id> # Performance metrics, token usage, costs
228
+ routekitai trace-analyze <trace_id> # Performance metrics, token usage, costs
226
229
 
227
230
  # Search traces
228
- RouteKitAI trace-search "error" # Search all traces for "error"
229
- RouteKitAI trace-search "model" --trace-id abc # Search specific trace
230
- RouteKitAI trace-search "tool" --event-type tool_called # Filter by event type
231
+ routekitai trace-search "error" # Search all traces for "error"
232
+ routekitai trace-search "model" --trace-id abc # Search specific trace
233
+ routekitai trace-search "tool" --event-type tool_called # Filter by event type
231
234
 
232
235
  # Replay a trace
233
- RouteKitAI replay <trace_id> --agent my_agent
236
+ routekitai replay <trace_id> --agent my_agent
234
237
 
235
238
  # Start web UI for trace visualization
236
- RouteKitAI serve # Start on default port 8080
237
- RouteKitAI serve --port 3000 # Custom port
238
- RouteKitAI serve --host 0.0.0.0 # Make accessible from network
239
+ routekitai serve # Start on default port 8080
240
+ routekitai serve --port 3000 # Custom port
241
+ routekitai serve --host 0.0.0.0 # Make accessible from network
239
242
 
240
243
  # Run sanity checks
241
- RouteKitAI test-agent
244
+ routekitai test-agent
242
245
  ```
243
246
 
244
247
  ## 🏗️ Core Primitives
@@ -271,7 +274,7 @@ pip install -e ".[dev]"
271
274
  pytest
272
275
 
273
276
  # Run with coverage
274
- pytest --cov=RouteKitAI --cov-report=html
277
+ pytest --cov=routekitai --cov-report=html
275
278
 
276
279
  # Run specific test file
277
280
  pytest tests/test_runtime.py
@@ -284,15 +287,15 @@ pytest tests/test_runtime.py
284
287
  mypy src/
285
288
 
286
289
  # Linting
287
- ruff check src/
290
+ ruff check src/ tests/ examples/
288
291
 
289
292
  # Format code
290
- ruff format src/
293
+ ruff format src/ tests/ examples/
291
294
  ```
292
295
 
293
296
  ## 🤝 Contributing
294
297
 
295
- Contributions are welcome! Please read our contributing guidelines (coming soon) and:
298
+ Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) and:
296
299
 
297
300
  1. Fork the repository
298
301
  2. Create a feature branch (`git checkout -b feature/amazing-feature`)
@@ -316,7 +319,7 @@ RouteKitAI is inspired by the need for testable, observable AI agent frameworks.
316
319
  ## 🔗 Links
317
320
 
318
321
  - **GitHub**: [https://github.com/MedGhassen/RouteKitAI](https://github.com/MedGhassen/RouteKitAI)
319
- - **Documentation**: [https://RouteKitAI.readthedocs.io](https://RouteKitAI.readthedocs.io) (coming soon)
322
+ - **Documentation**: [https://routekitai.readthedocs.io](https://routekitai.readthedocs.io)
320
323
  - **Issues**: [https://github.com/MedGhassen/RouteKitAI/issues](https://github.com/MedGhassen/RouteKitAI/issues)
321
324
 
322
325
  ---
@@ -150,50 +150,53 @@ asyncio.run(main())
150
150
 
151
151
  - **[Architecture Guide](docs/architecture.md)**: Deep dive into RouteKitAI's design
152
152
  - **[Security & Governance](docs/security-and-governance.md)**: Security features and best practices
153
- - **[API Reference](https://RouteKitAI.readthedocs.io)**: Complete API documentation (coming soon)
153
+ - **[Full documentation](https://routekitai.readthedocs.io)**: Architecture, security, and guides (Read the Docs)
154
154
 
155
155
  ## 🎓 Examples
156
156
 
157
157
  Check out the [`examples/`](examples/) directory for complete examples:
158
158
 
159
- - **[Basic Agent](examples/hello_RouteKitAI.py)**: Simple agent with tools
160
- - **[Graph Orchestration](examples/graph_agent.py)**: Multi-agent workflow
161
- - **[Supervisor Pattern](examples/supervisor_agent.py)**: Supervisor delegating to sub-agents
159
+ - **[Basic Agent](examples/basic.py)** / **[Hello RouteKit](examples/hello_routekit.py)**: Simple agent with tools
160
+ - **[Graph Orchestration](examples/graph_agent.py)** / **[Graph Policy](examples/graph_policy.py)**: Multi-agent workflows
161
+ - **[Supervisor Pattern](examples/supervisor_agent.py)** / **[Supervisor Policy](examples/supervisor_policy.py)**: Supervisor delegating to sub-agents
162
+ - **[ReAct / Plan–Execute / Function Calling](examples/react_policy.py)**, **[Plan–Execute](examples/plan_execute_policy.py)**, **[Function Calling](examples/function_calling_policy.py)**: Policy examples
162
163
  - **[Evaluation Harness](examples/eval_regression.py)**: Testing agents with datasets
163
164
 
165
+ Run all examples: `./scripts/run_examples.sh` (or `bash scripts/run_examples.sh`).
166
+
164
167
  ## 🛠️ CLI Commands
165
168
 
166
- RouteKitAI provides a CLI for common operations:
169
+ RouteKitAI provides a CLI (`routekitai`) for common operations:
167
170
 
168
171
  ```bash
169
172
  # Run an agent script
170
- RouteKitAI run agent_script.py
173
+ routekitai run agent_script.py
171
174
 
172
175
  # View a trace (multiple formats available)
173
- RouteKitAI trace <trace_id> # Table view (default)
174
- RouteKitAI trace <trace_id> --format timeline # Timeline visualization
175
- RouteKitAI trace <trace_id> --format steps # Step-by-step execution
176
- RouteKitAI trace <trace_id> --format json # JSON output
177
- RouteKitAI trace <trace_id> --format raw # Raw JSONL
176
+ routekitai trace <trace_id> # Table view (default)
177
+ routekitai trace <trace_id> --format timeline # Timeline visualization
178
+ routekitai trace <trace_id> --format steps # Step-by-step execution
179
+ routekitai trace <trace_id> --format json # JSON output
180
+ routekitai trace <trace_id> --format raw # Raw JSONL
178
181
 
179
182
  # Analyze trace metrics
180
- RouteKitAI trace-analyze <trace_id> # Performance metrics, token usage, costs
183
+ routekitai trace-analyze <trace_id> # Performance metrics, token usage, costs
181
184
 
182
185
  # Search traces
183
- RouteKitAI trace-search "error" # Search all traces for "error"
184
- RouteKitAI trace-search "model" --trace-id abc # Search specific trace
185
- RouteKitAI trace-search "tool" --event-type tool_called # Filter by event type
186
+ routekitai trace-search "error" # Search all traces for "error"
187
+ routekitai trace-search "model" --trace-id abc # Search specific trace
188
+ routekitai trace-search "tool" --event-type tool_called # Filter by event type
186
189
 
187
190
  # Replay a trace
188
- RouteKitAI replay <trace_id> --agent my_agent
191
+ routekitai replay <trace_id> --agent my_agent
189
192
 
190
193
  # Start web UI for trace visualization
191
- RouteKitAI serve # Start on default port 8080
192
- RouteKitAI serve --port 3000 # Custom port
193
- RouteKitAI serve --host 0.0.0.0 # Make accessible from network
194
+ routekitai serve # Start on default port 8080
195
+ routekitai serve --port 3000 # Custom port
196
+ routekitai serve --host 0.0.0.0 # Make accessible from network
194
197
 
195
198
  # Run sanity checks
196
- RouteKitAI test-agent
199
+ routekitai test-agent
197
200
  ```
198
201
 
199
202
  ## 🏗️ Core Primitives
@@ -226,7 +229,7 @@ pip install -e ".[dev]"
226
229
  pytest
227
230
 
228
231
  # Run with coverage
229
- pytest --cov=RouteKitAI --cov-report=html
232
+ pytest --cov=routekitai --cov-report=html
230
233
 
231
234
  # Run specific test file
232
235
  pytest tests/test_runtime.py
@@ -239,15 +242,15 @@ pytest tests/test_runtime.py
239
242
  mypy src/
240
243
 
241
244
  # Linting
242
- ruff check src/
245
+ ruff check src/ tests/ examples/
243
246
 
244
247
  # Format code
245
- ruff format src/
248
+ ruff format src/ tests/ examples/
246
249
  ```
247
250
 
248
251
  ## 🤝 Contributing
249
252
 
250
- Contributions are welcome! Please read our contributing guidelines (coming soon) and:
253
+ Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) and:
251
254
 
252
255
  1. Fork the repository
253
256
  2. Create a feature branch (`git checkout -b feature/amazing-feature`)
@@ -271,7 +274,7 @@ RouteKitAI is inspired by the need for testable, observable AI agent frameworks.
271
274
  ## 🔗 Links
272
275
 
273
276
  - **GitHub**: [https://github.com/MedGhassen/RouteKitAI](https://github.com/MedGhassen/RouteKitAI)
274
- - **Documentation**: [https://RouteKitAI.readthedocs.io](https://RouteKitAI.readthedocs.io) (coming soon)
277
+ - **Documentation**: [https://routekitai.readthedocs.io](https://routekitai.readthedocs.io)
275
278
  - **Issues**: [https://github.com/MedGhassen/RouteKitAI/issues](https://github.com/MedGhassen/RouteKitAI/issues)
276
279
 
277
280
  ---
@@ -0,0 +1,135 @@
1
+ # API reference
2
+
3
+ Overview of the main public APIs in RouteKitAI. For full signatures and docstrings, use the in-editor help or the source under `src/routekitai/`.
4
+
5
+ ---
6
+
7
+ ## Core: `routekitai` (top-level)
8
+
9
+ | Symbol | Description |
10
+ |--------|-------------|
11
+ | **Agent** | Agent with model, tools, optional policy and memory. Use `agent.run(prompt)` or `agent.run_stream(prompt)`. |
12
+ | **RunResult** | Result of a run: `output` (Message), `trace_id`, `messages`, `final_state`. |
13
+ | **Runtime** | Orchestrator: register agents, run with optional policy, replay traces. |
14
+ | **Message** | Single message: `role`, `content`, `tool_calls`, `tool_result`, `metadata`. |
15
+ | **MessageRole** | Enum: SYSTEM, USER, ASSISTANT, TOOL. |
16
+ | **Model** | Abstract LLM interface: `chat(messages, tools=..., stream=...)`. |
17
+ | **ModelResponse** | `content`, `tool_calls`, `usage`, `metadata`. |
18
+ | **StreamEvent** | Streaming event: `type`, `content`, `tool_calls`, `usage`, `metadata`. |
19
+ | **Tool** | Abstract base for tools: `name`, `description`, `input_model`, `output_model`, `run(input)`. |
20
+ | **ToolCall** | Model-requested tool call: `id`, `name`, `arguments`. |
21
+ | **ToolFilter** | Allow/deny list for tools (agent or runtime hooks). |
22
+ | **Usage** | Token/cost info: `prompt_tokens`, `completion_tokens`, `total_tokens`, `cost`. |
23
+ | **RouteKitError**, **ModelError**, **ToolError**, **PolicyError**, **RouteKitRuntimeError** | Error types. |
24
+
25
+ ---
26
+
27
+ ## Core: `routekitai.core`
28
+
29
+ ### Agent and runtime
30
+
31
+ - **Agent** — Same as top-level. Fields: `name`, `model`, `tools`, `policy`, `memory`, `tool_filter`, `trace_dir`.
32
+ - **RunResult** — Same as top-level.
33
+ - **Runtime** — `agents`, `trace_dir`, `timeout`, `max_concurrency`, `policy_hooks`, etc. Methods: `register_agent()`, `run()`, `replay()`.
34
+
35
+ ### Messages and model
36
+
37
+ - **Message**, **MessageRole** — As above.
38
+ - **Model**, **ModelResponse**, **StreamEvent**, **ToolCall**, **Usage** — As above.
39
+
40
+ ### Tools
41
+
42
+ - **Tool** — Base class. Subclass and implement `run(input) -> output`. Optional: `input_model`, `output_model`, `permissions`, `timeout`, `redact_fields`.
43
+ - **ToolPermission** — Enum: NETWORK, FILESYSTEM, DATABASE, NONE.
44
+ - **EchoTool**, **HttpGetTool**, **FileReadTool** — Built-in tools in `routekitai.core.tools`.
45
+
46
+ ### Policies
47
+
48
+ - **Policy** — Abstract: `plan(state) -> list[Action]`, `reflect(state, observation) -> state`.
49
+ - **Action** — Base for model/tool/parallel/final actions.
50
+ - **ModelAction**, **ToolAction**, **Parallel**, **Final** — Action types.
51
+ - **ReActPolicy** — Reasoning + acting loop (default). Config: `max_iterations`.
52
+ - **FunctionCallingPolicy** — Strict function-calling.
53
+ - **GraphPolicy** — Runs a `Graph`; requires a Runtime with registered agents.
54
+ - **SupervisorPolicy** — Delegates to other agents.
55
+ - **PlanExecutePolicy** — Plan then execute.
56
+ - **PolicyAdapter** — Adapts policy interface for the runtime.
57
+
58
+ ### Hooks (security and governance)
59
+
60
+ - **PolicyHooks** — Container: `pii_redaction`, `tool_filter`, `approval_gate`.
61
+ - **PIIRedactionHook** — Redact emails, phones, custom patterns.
62
+ - **ToolFilter** — `allowed_tools` / `denied_tools`.
63
+ - **ApprovalGate** — Require approval for certain permissions; `approval_callback(tool_name, tool_args) -> bool`.
64
+
65
+ ---
66
+
67
+ ## Graphs: `routekitai.graphs`
68
+
69
+ | Symbol | Description |
70
+ |--------|-------------|
71
+ | **Graph** | Workflow: `name`, `nodes`, `edges`, `entry_node`, `exit_node`, `state_schema`, `config`. |
72
+ | **GraphNode** | Node: `id`, `type` (NodeType), `agent_name` / `tool_name` / `subgraph_name` / `condition`, `input_mapping`, `output_mapping`. |
73
+ | **GraphEdge** | Edge: `source`, `target`, optional `condition`. |
74
+ | **NodeType** | Enum: MODEL, TOOL, SUBGRAPH, CONDITION. |
75
+ | **GraphExecutor** | Executes a graph (used internally by GraphPolicy). |
76
+
77
+ ---
78
+
79
+ ## Memory: `routekitai.memory`
80
+
81
+ | Symbol | Description |
82
+ |--------|-------------|
83
+ | **Memory** | Abstract interface (from `routekitai.core.memory`). |
84
+ | **WorkingMemory** | In-memory context for a single run. |
85
+ | **EpisodicMemory** | SQLite-backed episode storage. |
86
+ | **RetrievalMemory** | TF-IDF or substring search. |
87
+ | **VectorMemory** | Vector similarity search (in `routekitai.memory.vector`). |
88
+ | **KVMemory** | Key-value store (in `routekitai.memory.kv`). |
89
+
90
+ ---
91
+
92
+ ## Evaluations: `routekitai.evals`
93
+
94
+ | Symbol | Description |
95
+ |--------|-------------|
96
+ | **Dataset** | Evaluation dataset (inputs and expected outputs). |
97
+ | **EvalRunner** | Runs an agent over a dataset and computes metrics. |
98
+ | **ExactMatchMetric**, **ContainsMetric**, **RegexMetric** | Built-in metrics. |
99
+
100
+ ---
101
+
102
+ ## Providers: `routekitai.providers`
103
+
104
+ | Symbol | Description |
105
+ |--------|-------------|
106
+ | **FakeModel** | Local model with preloaded responses (no API key). |
107
+ | **OpenAIChatModel** | OpenAI chat API. |
108
+ | **AnthropicChatModel** | Anthropic API (if installed). |
109
+ | **AzureOpenAIChatModel** | Azure OpenAI (if installed). |
110
+
111
+ ---
112
+
113
+ ## Observability: `routekitai.observability`
114
+
115
+ - **Trace**, **TraceEvent** — Trace representation.
116
+ - **JSONLExporter** — Writes traces to `.routekit/traces/<trace_id>.jsonl`.
117
+ - **Analyzer** — Trace analysis (used by CLI `trace-analyze`).
118
+ - **OtelExporter** — OpenTelemetry export (optional).
119
+
120
+ ---
121
+
122
+ ## Sandbox: `routekitai.sandbox`
123
+
124
+ - **FilesystemSandbox** — Restrict filesystem access.
125
+ - **NetworkSandbox** — Restrict network access.
126
+ - **PermissionManager** — Manages tool permissions (used by runtime).
127
+
128
+ ---
129
+
130
+ ## Version
131
+
132
+ ```python
133
+ import routekitai
134
+ print(routekitai.__version__)
135
+ ```
@@ -237,8 +237,9 @@ RouteKitAI supports multiple memory backends:
237
237
 
238
238
  - **EpisodicMemory**: SQLite-backed episode storage
239
239
  - **RetrievalMemory**: TF-IDF or substring search
240
- - **VectorMemory**: Vector similarity search (planned)
241
- - **KVMemory**: Key-value storage (planned)
240
+ - **VectorMemory**: Vector similarity search
241
+ - **KVMemory**: Key-value storage
242
+ - **WorkingMemory**: In-memory context for a single run
242
243
 
243
244
  Memory is accessed through the `Memory` abstract interface, allowing agents to retain context across runs.
244
245
 
@@ -273,16 +274,16 @@ Sandboxing provides isolation for tool execution:
273
274
  - Memory backends: Episodic and retrieval memory
274
275
  - Security hooks: PII redaction, tool filtering, approval gates
275
276
  - CLI tools: Run, trace, replay, test commands
277
+ - Trace analysis: Metrics (`trace-analyze`), search (`trace-search`), timeline/step views, web UI (`serve`)
276
278
 
277
279
  ### Excluded (Post-MVP)
278
280
 
279
281
  - Distributed execution: Multi-machine orchestration
280
282
  - Streaming traces: Real-time trace streaming/aggregation
281
- - Trace analysis: Advanced querying, visualization, metrics
282
- - Production observability: Integration with monitoring systems
283
+ - Production observability: Integration with external monitoring (e.g. OpenTelemetry exporters exist; full integration TBD)
283
284
  - Advanced graph features: Dynamic graphs, conditional branching beyond basics
284
285
  - Model providers: Built-in integrations (use adapters)
285
- - UI/dashboards: Trace visualization tools
286
+ - UI/dashboards: Additional trace visualization (basic serve UI included)
286
287
 
287
288
  ## Design Principles
288
289
 
@@ -309,7 +310,7 @@ Performance optimizations can be added later without breaking the core design.
309
310
 
310
311
  - **Distributed execution**: Scale across multiple machines
311
312
  - **Advanced graph features**: Dynamic graphs, parallel node execution
312
- - **Trace analysis**: Query, visualize, and analyze traces
313
+ - **Trace analysis**: Further tooling and integrations (basic analysis and serve UI included)
313
314
  - **Production observability**: Integrate with monitoring systems
314
315
  - **Model provider integrations**: Built-in support for major LLM providers
315
316
  - **UI/dashboards**: Visual trace inspection and graph editing
@@ -0,0 +1,117 @@
1
+ # Getting Started
2
+
3
+ This guide gets you from zero to running your first agent and first graph in RouteKitAI.
4
+
5
+ ## Installation
6
+
7
+ Install the package from PyPI:
8
+
9
+ ```bash
10
+ pip install RouteKitAI
11
+ ```
12
+
13
+ For development (CLI, tests, type checking):
14
+
15
+ ```bash
16
+ pip install "RouteKitAI[dev]"
17
+ ```
18
+
19
+ Optional extras:
20
+
21
+ - **`[ui]`** — Web UI for traces (`routekitai serve`): FastAPI, Uvicorn
22
+ - **`[optional]`** — Vector memory, OpenAI/Anthropic adapters: sentence-transformers, faiss, openai, etc.
23
+
24
+ ```bash
25
+ pip install "RouteKitAI[dev,ui,optional]"
26
+ ```
27
+
28
+ **Requirements:** Python 3.11+, Pydantic 2.x.
29
+
30
+ ## Your first agent
31
+
32
+ A minimal agent needs a **model** and optionally **tools**. RouteKitAI uses a provider-agnostic `Model` interface, so you can start with a fake model (no API key) and later switch to OpenAI, Anthropic, or your own backend.
33
+
34
+ ```python
35
+ import asyncio
36
+ from routekitai import Agent
37
+ from routekitai.core.tools import EchoTool
38
+ from routekitai.providers.local import FakeModel
39
+
40
+ async def main():
41
+ # Local fake model (no API key)
42
+ model = FakeModel(name="basic")
43
+ model.add_response("Hello! I used the echo tool.")
44
+
45
+ agent = Agent(
46
+ name="assistant",
47
+ model=model,
48
+ tools=[EchoTool()],
49
+ )
50
+
51
+ result = await agent.run("Say hello and echo 'RouteKit works!'")
52
+ print(result.output.content)
53
+ print("Trace ID:", result.trace_id)
54
+
55
+ asyncio.run(main())
56
+ ```
57
+
58
+ - **`agent.run(prompt)`** — Runs the agent and returns a `RunResult` with `output`, `trace_id`, `messages`, and `final_state`.
59
+ - Every run is **traced** by default; traces are written under `.routekit/traces/` unless you set `trace_dir` on the agent.
60
+
61
+ ## Your first graph
62
+
63
+ Graphs define **explicit workflows** as nodes (model, tool, subgraph, condition) and edges. Use `GraphPolicy` with a `Runtime` and registered agents.
64
+
65
+ ```python
66
+ import asyncio
67
+ from pathlib import Path
68
+ from routekitai import Agent
69
+ from routekitai.core.policies import GraphPolicy
70
+ from routekitai.core.runtime import Runtime
71
+ from routekitai.core.tools import EchoTool
72
+ from routekitai.graphs import Graph, GraphNode, GraphEdge, NodeType
73
+ from routekitai.providers.local import FakeModel
74
+
75
+ async def main():
76
+ model = FakeModel(name="m1")
77
+ model.add_response("Processing...")
78
+ agent = Agent(name="worker", model=model, tools=[EchoTool()])
79
+
80
+ graph = Graph(
81
+ name="example",
82
+ entry_node="start",
83
+ exit_node="end",
84
+ nodes=[
85
+ GraphNode(id="start", type=NodeType.MODEL, agent_name="worker",
86
+ output_mapping={"output": "result"}),
87
+ GraphNode(id="end", type=NodeType.MODEL, agent_name="worker",
88
+ input_mapping={"result": "input"}, output_mapping={"output": "final"}),
89
+ ],
90
+ edges=[
91
+ GraphEdge(source="start", target="end"),
92
+ ],
93
+ )
94
+
95
+ runtime = Runtime(trace_dir=Path(".routekit/traces"))
96
+ runtime.register_agent(agent)
97
+ policy = GraphPolicy(graph=graph)
98
+
99
+ result = await runtime.run("worker", "Hello", policy=policy)
100
+ print(result.output.content)
101
+ print("Trace ID:", result.trace_id)
102
+
103
+ asyncio.run(main())
104
+ ```
105
+
106
+ In practice you’ll often build the graph and policy once, then call `runtime.run(...)` with the appropriate agent and policy. See [Graph workflows](guides/graph-workflows.md) for full details.
107
+
108
+ ## Next steps
109
+
110
+ - **[Running agents](guides/running-agents.md)** — `run` vs `run_stream`, using `Runtime` directly, trace directory.
111
+ - **[Creating tools](guides/creating-tools.md)** — Define tools with Pydantic input/output, permissions, redaction.
112
+ - **[Graph workflows](guides/graph-workflows.md)** — Nodes, edges, state mapping, `GraphPolicy`, subgraphs.
113
+ - **[Tracing and replay](guides/tracing-and-replay.md)** — Trace IDs, CLI (`trace`, `trace-analyze`, `replay`), replay for tests.
114
+ - **[CLI reference](guides/cli-reference.md)** — All `routekitai` commands and options.
115
+ - **[Providers](guides/providers.md)** — FakeModel, OpenAI, environment variables.
116
+
117
+ For design and concepts, see [Architecture](architecture.md). For security (PII redaction, tool filtering, approval gates), see [Security & Governance](security-and-governance.md).
@@ -0,0 +1,134 @@
1
+ # CLI reference
2
+
3
+ The RouteKitAI CLI is invoked as **`routekitai`**. Install with `pip install RouteKitAI` or `pip install "RouteKitAI[dev]"` for full CLI support.
4
+
5
+ Default trace directory: **`.routekit/traces`** (overridable per command where noted).
6
+
7
+ ---
8
+
9
+ ## `routekitai run <script>`
10
+
11
+ Runs a Python script that uses RouteKitAI (e.g. defines agents and calls `agent.run()` or `runtime.run()`).
12
+
13
+ ```bash
14
+ routekitai run path/to/agent_script.py
15
+ ```
16
+
17
+ - The script is executed in a way that allows async entrypoints; typically the script uses `asyncio.run(main())` or similar.
18
+ - Traces from the run are written to the default trace dir (or the dir set by the script’s runtime/agent).
19
+
20
+ ---
21
+
22
+ ## `routekitai trace <trace_id>`
23
+
24
+ Prints a trace by ID.
25
+
26
+ ```bash
27
+ routekitai trace <trace_id> [OPTIONS]
28
+ ```
29
+
30
+ | Option | Description |
31
+ |--------|-------------|
32
+ | `--format`, `-f` | Output format: `table` (default), `timeline`, `steps`, `json`, `raw` |
33
+ | `--trace-dir`, `-t` | Trace directory (default: `.routekit/traces`) |
34
+
35
+ ---
36
+
37
+ ## `routekitai trace-analyze <trace_id>`
38
+
39
+ Prints metrics for a trace: timing, token usage, cost (when available).
40
+
41
+ ```bash
42
+ routekitai trace-analyze <trace_id> [--trace-dir PATH]
43
+ ```
44
+
45
+ ---
46
+
47
+ ## `routekitai trace-search [query]`
48
+
49
+ Searches trace contents.
50
+
51
+ ```bash
52
+ routekitai trace-search "query" [OPTIONS]
53
+ ```
54
+
55
+ | Option | Description |
56
+ |--------|-------------|
57
+ | `--trace-id` | Limit search to one trace |
58
+ | `--event-type` | Filter by event type (e.g. `tool_called`, `model_called`) |
59
+ | `--trace-dir` | Trace directory |
60
+
61
+ ---
62
+
63
+ ## `routekitai replay <trace_id>`
64
+
65
+ Replays a trace with stubbed model and tool responses.
66
+
67
+ ```bash
68
+ routekitai replay <trace_id> --agent <agent_name> [OPTIONS]
69
+ ```
70
+
71
+ | Option | Description |
72
+ |--------|-------------|
73
+ | `--agent` | Agent name to use for replay (required) |
74
+ | `--trace-dir` | Trace directory |
75
+
76
+ ---
77
+
78
+ ## `routekitai serve`
79
+
80
+ Starts the web UI for browsing and viewing traces.
81
+
82
+ ```bash
83
+ routekitai serve [OPTIONS]
84
+ ```
85
+
86
+ | Option | Description |
87
+ |--------|-------------|
88
+ | `--port`, `-p` | Port (default: 8080) |
89
+ | `--host` | Bind address (e.g. `0.0.0.0` for network access) |
90
+ | `--trace-dir`, `-t` | Trace directory (default: `.routekit/traces`) |
91
+
92
+ Requires the **`[ui]`** extra: `pip install "RouteKitAI[ui]"`.
93
+
94
+ ---
95
+
96
+ ## `routekitai test-agent`
97
+
98
+ Runs sanity checks (e.g. that the package and a minimal agent run correctly).
99
+
100
+ ```bash
101
+ routekitai test-agent
102
+ ```
103
+
104
+ Useful in CI or after install to verify the environment.
105
+
106
+ ---
107
+
108
+ ## Environment
109
+
110
+ - **`ROUTEKIT_TRACE_DIR`** — Used by `serve` (and possibly other commands) as the trace directory when `--trace-dir` is not set. Example: `export ROUTEKIT_TRACE_DIR=/var/traces`.
111
+
112
+ ---
113
+
114
+ ## Examples
115
+
116
+ ```bash
117
+ # Run an agent script
118
+ routekitai run examples/basic.py
119
+
120
+ # View last run’s trace (use the trace_id printed by the script)
121
+ routekitai trace f98eb1b6-6eec-42df-b42a-021dc704620b --format timeline
122
+
123
+ # Analyze it
124
+ routekitai trace-analyze f98eb1b6-6eec-42df-b42a-021dc704620b
125
+
126
+ # Search all traces for "error"
127
+ routekitai trace-search "error"
128
+
129
+ # Replay
130
+ routekitai replay f98eb1b6-6eec-42df-b42a-021dc704620b --agent assistant
131
+
132
+ # Start trace UI
133
+ routekitai serve --port 3000
134
+ ```