sibyld 1.0.0rc1__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 (334) hide show
  1. sibyld-1.0.0rc1/.gitignore +97 -0
  2. sibyld-1.0.0rc1/PKG-INFO +218 -0
  3. sibyld-1.0.0rc1/README.md +165 -0
  4. sibyld-1.0.0rc1/pyproject.toml +318 -0
  5. sibyld-1.0.0rc1/src/sibyl/__init__.py +32 -0
  6. sibyld-1.0.0rc1/src/sibyl/ai/__init__.py +1 -0
  7. sibyld-1.0.0rc1/src/sibyl/ai/llm/__init__.py +11 -0
  8. sibyld-1.0.0rc1/src/sibyl/ai/llm/budget.py +219 -0
  9. sibyld-1.0.0rc1/src/sibyl/ai/llm/config_source.py +191 -0
  10. sibyld-1.0.0rc1/src/sibyl/ai/llm/routes.py +349 -0
  11. sibyld-1.0.0rc1/src/sibyl/ai/llm/service.py +26 -0
  12. sibyld-1.0.0rc1/src/sibyl/api/__init__.py +31 -0
  13. sibyld-1.0.0rc1/src/sibyl/api/app.py +443 -0
  14. sibyld-1.0.0rc1/src/sibyl/api/context_audit.py +321 -0
  15. sibyld-1.0.0rc1/src/sibyl/api/decorators.py +293 -0
  16. sibyld-1.0.0rc1/src/sibyl/api/dependencies.py +153 -0
  17. sibyld-1.0.0rc1/src/sibyl/api/errors.py +662 -0
  18. sibyld-1.0.0rc1/src/sibyl/api/event_types.py +31 -0
  19. sibyld-1.0.0rc1/src/sibyl/api/idempotency.py +108 -0
  20. sibyld-1.0.0rc1/src/sibyl/api/pubsub.py +31 -0
  21. sibyld-1.0.0rc1/src/sibyl/api/rate_limit.py +54 -0
  22. sibyld-1.0.0rc1/src/sibyl/api/routes/__init__.py +60 -0
  23. sibyld-1.0.0rc1/src/sibyl/api/routes/admin.py +932 -0
  24. sibyld-1.0.0rc1/src/sibyl/api/routes/auth.py +1715 -0
  25. sibyld-1.0.0rc1/src/sibyl/api/routes/backups.py +438 -0
  26. sibyld-1.0.0rc1/src/sibyl/api/routes/context.py +332 -0
  27. sibyld-1.0.0rc1/src/sibyl/api/routes/crawler.py +1145 -0
  28. sibyld-1.0.0rc1/src/sibyl/api/routes/entities.py +1840 -0
  29. sibyld-1.0.0rc1/src/sibyl/api/routes/epics.py +357 -0
  30. sibyld-1.0.0rc1/src/sibyl/api/routes/graph.py +699 -0
  31. sibyld-1.0.0rc1/src/sibyl/api/routes/jobs.py +341 -0
  32. sibyld-1.0.0rc1/src/sibyl/api/routes/logs.py +139 -0
  33. sibyld-1.0.0rc1/src/sibyl/api/routes/memory.py +2475 -0
  34. sibyld-1.0.0rc1/src/sibyl/api/routes/metrics.py +691 -0
  35. sibyld-1.0.0rc1/src/sibyl/api/routes/org_invitations.py +156 -0
  36. sibyld-1.0.0rc1/src/sibyl/api/routes/org_members.py +121 -0
  37. sibyld-1.0.0rc1/src/sibyl/api/routes/orgs.py +181 -0
  38. sibyld-1.0.0rc1/src/sibyl/api/routes/project_members.py +161 -0
  39. sibyld-1.0.0rc1/src/sibyl/api/routes/rag.py +745 -0
  40. sibyld-1.0.0rc1/src/sibyl/api/routes/resolve.py +292 -0
  41. sibyld-1.0.0rc1/src/sibyl/api/routes/search.py +330 -0
  42. sibyld-1.0.0rc1/src/sibyl/api/routes/session.py +279 -0
  43. sibyld-1.0.0rc1/src/sibyl/api/routes/settings.py +345 -0
  44. sibyld-1.0.0rc1/src/sibyl/api/routes/setup.py +402 -0
  45. sibyld-1.0.0rc1/src/sibyl/api/routes/synthesis.py +213 -0
  46. sibyld-1.0.0rc1/src/sibyl/api/routes/tasks.py +1098 -0
  47. sibyld-1.0.0rc1/src/sibyl/api/routes/telemetry.py +62 -0
  48. sibyld-1.0.0rc1/src/sibyl/api/routes/users.py +407 -0
  49. sibyld-1.0.0rc1/src/sibyl/api/schemas.py +2107 -0
  50. sibyld-1.0.0rc1/src/sibyl/api/websocket.py +390 -0
  51. sibyld-1.0.0rc1/src/sibyl/auth/__init__.py +56 -0
  52. sibyld-1.0.0rc1/src/sibyl/auth/api_key_common.py +103 -0
  53. sibyld-1.0.0rc1/src/sibyl/auth/authorization.py +307 -0
  54. sibyld-1.0.0rc1/src/sibyl/auth/context.py +5 -0
  55. sibyld-1.0.0rc1/src/sibyl/auth/dependencies.py +271 -0
  56. sibyld-1.0.0rc1/src/sibyl/auth/errors.py +175 -0
  57. sibyld-1.0.0rc1/src/sibyl/auth/http.py +23 -0
  58. sibyld-1.0.0rc1/src/sibyl/auth/jit.py +48 -0
  59. sibyld-1.0.0rc1/src/sibyl/auth/jwt.py +19 -0
  60. sibyld-1.0.0rc1/src/sibyl/auth/locks.py +36 -0
  61. sibyld-1.0.0rc1/src/sibyl/auth/mcp_auth.py +81 -0
  62. sibyld-1.0.0rc1/src/sibyl/auth/mcp_oauth.py +741 -0
  63. sibyld-1.0.0rc1/src/sibyl/auth/middleware.py +35 -0
  64. sibyld-1.0.0rc1/src/sibyl/auth/oauth_state.py +81 -0
  65. sibyld-1.0.0rc1/src/sibyl/auth/oidc.py +295 -0
  66. sibyld-1.0.0rc1/src/sibyl/auth/passwords.py +10 -0
  67. sibyld-1.0.0rc1/src/sibyl/auth/primitives.py +51 -0
  68. sibyld-1.0.0rc1/src/sibyl/auth/rls.py +66 -0
  69. sibyld-1.0.0rc1/src/sibyl/auth/session_cache.py +105 -0
  70. sibyld-1.0.0rc1/src/sibyl/auth/silent_refresh.py +32 -0
  71. sibyld-1.0.0rc1/src/sibyl/auth/tenancy.py +30 -0
  72. sibyld-1.0.0rc1/src/sibyl/backup_ids.py +10 -0
  73. sibyld-1.0.0rc1/src/sibyl/banner.py +50 -0
  74. sibyld-1.0.0rc1/src/sibyl/cache.py +496 -0
  75. sibyld-1.0.0rc1/src/sibyl/cli/__init__.py +20 -0
  76. sibyld-1.0.0rc1/src/sibyl/cli/auth_flow.py +837 -0
  77. sibyld-1.0.0rc1/src/sibyl/cli/bootstrap.py +301 -0
  78. sibyld-1.0.0rc1/src/sibyl/cli/common.py +222 -0
  79. sibyld-1.0.0rc1/src/sibyl/cli/db.py +1012 -0
  80. sibyld-1.0.0rc1/src/sibyl/cli/export.py +307 -0
  81. sibyld-1.0.0rc1/src/sibyl/cli/generate.py +502 -0
  82. sibyld-1.0.0rc1/src/sibyl/cli/main.py +456 -0
  83. sibyld-1.0.0rc1/src/sibyl/cli/migrate.py +2097 -0
  84. sibyld-1.0.0rc1/src/sibyl/cli/up_cmd.py +369 -0
  85. sibyld-1.0.0rc1/src/sibyl/config.py +717 -0
  86. sibyld-1.0.0rc1/src/sibyl/coordination/__init__.py +59 -0
  87. sibyld-1.0.0rc1/src/sibyl/coordination/_local/__init__.py +1 -0
  88. sibyld-1.0.0rc1/src/sibyl/coordination/_local/broker.py +645 -0
  89. sibyld-1.0.0rc1/src/sibyl/coordination/_local/events.py +45 -0
  90. sibyld-1.0.0rc1/src/sibyl/coordination/_local/locks.py +93 -0
  91. sibyld-1.0.0rc1/src/sibyl/coordination/_local/pending.py +115 -0
  92. sibyld-1.0.0rc1/src/sibyl/coordination/_local/scheduler.py +129 -0
  93. sibyld-1.0.0rc1/src/sibyl/coordination/_redis/__init__.py +1 -0
  94. sibyld-1.0.0rc1/src/sibyl/coordination/_redis/broker.py +719 -0
  95. sibyld-1.0.0rc1/src/sibyl/coordination/_redis/events.py +139 -0
  96. sibyld-1.0.0rc1/src/sibyl/coordination/_redis/locks.py +193 -0
  97. sibyld-1.0.0rc1/src/sibyl/coordination/_redis/pending.py +117 -0
  98. sibyld-1.0.0rc1/src/sibyl/coordination/_redis/scheduler.py +16 -0
  99. sibyld-1.0.0rc1/src/sibyl/coordination/broker.py +249 -0
  100. sibyld-1.0.0rc1/src/sibyl/coordination/events.py +49 -0
  101. sibyld-1.0.0rc1/src/sibyl/coordination/locks.py +78 -0
  102. sibyld-1.0.0rc1/src/sibyl/coordination/pending.py +65 -0
  103. sibyld-1.0.0rc1/src/sibyl/coordination/scheduler.py +42 -0
  104. sibyld-1.0.0rc1/src/sibyl/crawler/__init__.py +106 -0
  105. sibyld-1.0.0rc1/src/sibyl/crawler/chunker.py +589 -0
  106. sibyld-1.0.0rc1/src/sibyl/crawler/discovery.py +305 -0
  107. sibyld-1.0.0rc1/src/sibyl/crawler/embedder.py +296 -0
  108. sibyld-1.0.0rc1/src/sibyl/crawler/graph_integration.py +915 -0
  109. sibyld-1.0.0rc1/src/sibyl/crawler/llms_parser.py +228 -0
  110. sibyld-1.0.0rc1/src/sibyl/crawler/local.py +202 -0
  111. sibyld-1.0.0rc1/src/sibyl/crawler/pipeline.py +609 -0
  112. sibyld-1.0.0rc1/src/sibyl/crawler/service.py +922 -0
  113. sibyld-1.0.0rc1/src/sibyl/crawler/tagger.py +179 -0
  114. sibyld-1.0.0rc1/src/sibyl/crypto.py +164 -0
  115. sibyld-1.0.0rc1/src/sibyl/db/__init__.py +7 -0
  116. sibyld-1.0.0rc1/src/sibyl/email/__init__.py +20 -0
  117. sibyld-1.0.0rc1/src/sibyl/email/client.py +152 -0
  118. sibyld-1.0.0rc1/src/sibyl/email/templates.py +248 -0
  119. sibyld-1.0.0rc1/src/sibyl/embedded.py +127 -0
  120. sibyld-1.0.0rc1/src/sibyl/generator/__init__.py +31 -0
  121. sibyld-1.0.0rc1/src/sibyl/generator/base.py +107 -0
  122. sibyld-1.0.0rc1/src/sibyl/generator/config.py +137 -0
  123. sibyld-1.0.0rc1/src/sibyl/generator/llm.py +426 -0
  124. sibyld-1.0.0rc1/src/sibyl/generator/relationships.py +331 -0
  125. sibyld-1.0.0rc1/src/sibyl/generator/scenarios.py +180 -0
  126. sibyld-1.0.0rc1/src/sibyl/generator/stress.py +317 -0
  127. sibyld-1.0.0rc1/src/sibyl/generator/templates.py +528 -0
  128. sibyld-1.0.0rc1/src/sibyl/ingestion/__init__.py +78 -0
  129. sibyld-1.0.0rc1/src/sibyl/ingestion/cataloger.py +465 -0
  130. sibyld-1.0.0rc1/src/sibyl/ingestion/chunker.py +226 -0
  131. sibyld-1.0.0rc1/src/sibyl/ingestion/extractor.py +339 -0
  132. sibyld-1.0.0rc1/src/sibyl/ingestion/parser.py +301 -0
  133. sibyld-1.0.0rc1/src/sibyl/ingestion/pipeline.py +374 -0
  134. sibyld-1.0.0rc1/src/sibyl/ingestion/relationships.py +254 -0
  135. sibyld-1.0.0rc1/src/sibyl/ingestion/storage.py +329 -0
  136. sibyld-1.0.0rc1/src/sibyl/jobs/__init__.py +118 -0
  137. sibyld-1.0.0rc1/src/sibyl/jobs/backup.py +689 -0
  138. sibyld-1.0.0rc1/src/sibyl/jobs/consolidation.py +254 -0
  139. sibyld-1.0.0rc1/src/sibyl/jobs/crawl.py +284 -0
  140. sibyld-1.0.0rc1/src/sibyl/jobs/entities.py +1082 -0
  141. sibyld-1.0.0rc1/src/sibyl/jobs/memory_extraction.py +413 -0
  142. sibyld-1.0.0rc1/src/sibyl/jobs/pending.py +287 -0
  143. sibyld-1.0.0rc1/src/sibyl/jobs/privacy.py +38 -0
  144. sibyld-1.0.0rc1/src/sibyl/jobs/queue.py +288 -0
  145. sibyld-1.0.0rc1/src/sibyl/jobs/reflection.py +653 -0
  146. sibyld-1.0.0rc1/src/sibyl/jobs/source_imports.py +714 -0
  147. sibyld-1.0.0rc1/src/sibyl/jobs/worker.py +342 -0
  148. sibyld-1.0.0rc1/src/sibyl/locks.py +86 -0
  149. sibyld-1.0.0rc1/src/sibyl/main.py +394 -0
  150. sibyld-1.0.0rc1/src/sibyl/persistence/auth_archive.py +335 -0
  151. sibyld-1.0.0rc1/src/sibyl/persistence/auth_common.py +79 -0
  152. sibyld-1.0.0rc1/src/sibyl/persistence/auth_runtime.py +556 -0
  153. sibyld-1.0.0rc1/src/sibyl/persistence/backups_common.py +131 -0
  154. sibyld-1.0.0rc1/src/sibyl/persistence/backups_runtime.py +132 -0
  155. sibyld-1.0.0rc1/src/sibyl/persistence/content_archive.py +398 -0
  156. sibyld-1.0.0rc1/src/sibyl/persistence/content_common.py +172 -0
  157. sibyld-1.0.0rc1/src/sibyl/persistence/content_runtime.py +480 -0
  158. sibyld-1.0.0rc1/src/sibyl/persistence/graph_runtime.py +1403 -0
  159. sibyld-1.0.0rc1/src/sibyl/persistence/legacy/__init__.py +77 -0
  160. sibyld-1.0.0rc1/src/sibyl/persistence/legacy/graph.py +115 -0
  161. sibyld-1.0.0rc1/src/sibyl/persistence/operations_runtime.py +112 -0
  162. sibyld-1.0.0rc1/src/sibyl/persistence/organization_common.py +104 -0
  163. sibyld-1.0.0rc1/src/sibyl/persistence/organization_runtime.py +285 -0
  164. sibyld-1.0.0rc1/src/sibyl/persistence/settings_runtime.py +74 -0
  165. sibyld-1.0.0rc1/src/sibyl/persistence/settings_types.py +19 -0
  166. sibyld-1.0.0rc1/src/sibyl/persistence/setup_common.py +13 -0
  167. sibyld-1.0.0rc1/src/sibyl/persistence/surreal/__init__.py +25 -0
  168. sibyld-1.0.0rc1/src/sibyl/persistence/surreal/auth.py +808 -0
  169. sibyld-1.0.0rc1/src/sibyl/persistence/surreal/auth_runtime.py +4553 -0
  170. sibyld-1.0.0rc1/src/sibyl/persistence/surreal/backups.py +396 -0
  171. sibyld-1.0.0rc1/src/sibyl/persistence/surreal/content.py +1996 -0
  172. sibyld-1.0.0rc1/src/sibyl/persistence/surreal/organization_runtime.py +2095 -0
  173. sibyld-1.0.0rc1/src/sibyl/persistence/surreal/setup.py +177 -0
  174. sibyld-1.0.0rc1/src/sibyl/persistence/surreal/system_settings.py +110 -0
  175. sibyld-1.0.0rc1/src/sibyl/runtime_shape.py +112 -0
  176. sibyld-1.0.0rc1/src/sibyl/server.py +1824 -0
  177. sibyld-1.0.0rc1/src/sibyl/services/__init__.py +8 -0
  178. sibyld-1.0.0rc1/src/sibyl/services/recall_limits.py +101 -0
  179. sibyld-1.0.0rc1/src/sibyl/services/settings.py +450 -0
  180. sibyld-1.0.0rc1/src/sibyl/services/telemetry.py +141 -0
  181. sibyld-1.0.0rc1/src/sibyl/surreal_runtime_startup.py +66 -0
  182. sibyld-1.0.0rc1/tests/__init__.py +1 -0
  183. sibyld-1.0.0rc1/tests/ai/llm/test_budget.py +175 -0
  184. sibyld-1.0.0rc1/tests/ai/llm/test_config_source.py +113 -0
  185. sibyld-1.0.0rc1/tests/ai/test_llm_settings_api.py +200 -0
  186. sibyld-1.0.0rc1/tests/conftest.py +105 -0
  187. sibyld-1.0.0rc1/tests/evals/__init__.py +9 -0
  188. sibyld-1.0.0rc1/tests/evals/runner.py +36 -0
  189. sibyld-1.0.0rc1/tests/evals/test_metrics.py +306 -0
  190. sibyld-1.0.0rc1/tests/generator/test_llm.py +78 -0
  191. sibyld-1.0.0rc1/tests/harness/__init__.py +90 -0
  192. sibyld-1.0.0rc1/tests/harness/context.py +292 -0
  193. sibyld-1.0.0rc1/tests/harness/helpers.py +326 -0
  194. sibyld-1.0.0rc1/tests/harness/mocks.py +324 -0
  195. sibyld-1.0.0rc1/tests/test_api_app_startup.py +102 -0
  196. sibyld-1.0.0rc1/tests/test_api_entities_create_task_fields.py +135 -0
  197. sibyld-1.0.0rc1/tests/test_api_entities_raw_capture.py +254 -0
  198. sibyld-1.0.0rc1/tests/test_api_raw_captures.py +286 -0
  199. sibyld-1.0.0rc1/tests/test_api_tasks_validation.py +159 -0
  200. sibyld-1.0.0rc1/tests/test_archive_imports.py +35 -0
  201. sibyld-1.0.0rc1/tests/test_auth_api_key_scopes_rest.py +177 -0
  202. sibyld-1.0.0rc1/tests/test_auth_api_keys.py +44 -0
  203. sibyld-1.0.0rc1/tests/test_auth_authorization.py +210 -0
  204. sibyld-1.0.0rc1/tests/test_auth_context.py +13 -0
  205. sibyld-1.0.0rc1/tests/test_auth_cookie_config.py +44 -0
  206. sibyld-1.0.0rc1/tests/test_auth_dependencies.py +375 -0
  207. sibyld-1.0.0rc1/tests/test_auth_errors.py +158 -0
  208. sibyld-1.0.0rc1/tests/test_auth_flow_replay.py +466 -0
  209. sibyld-1.0.0rc1/tests/test_auth_http.py +17 -0
  210. sibyld-1.0.0rc1/tests/test_auth_invitation_token.py +9 -0
  211. sibyld-1.0.0rc1/tests/test_auth_jwt.py +82 -0
  212. sibyld-1.0.0rc1/tests/test_auth_mcp_token_verifier.py +143 -0
  213. sibyld-1.0.0rc1/tests/test_auth_oauth_state.py +35 -0
  214. sibyld-1.0.0rc1/tests/test_auth_passwords.py +44 -0
  215. sibyld-1.0.0rc1/tests/test_auth_rls.py +54 -0
  216. sibyld-1.0.0rc1/tests/test_auth_runtime.py +263 -0
  217. sibyld-1.0.0rc1/tests/test_auth_session_cache.py +65 -0
  218. sibyld-1.0.0rc1/tests/test_auth_settings.py +307 -0
  219. sibyld-1.0.0rc1/tests/test_auth_signup_locks.py +126 -0
  220. sibyld-1.0.0rc1/tests/test_auth_slugify.py +7 -0
  221. sibyld-1.0.0rc1/tests/test_auth_tenancy.py +64 -0
  222. sibyld-1.0.0rc1/tests/test_auth_users_sessions_cookie.py +45 -0
  223. sibyld-1.0.0rc1/tests/test_backups_routes.py +260 -0
  224. sibyld-1.0.0rc1/tests/test_cache.py +358 -0
  225. sibyld-1.0.0rc1/tests/test_cli_bootstrap.py +101 -0
  226. sibyld-1.0.0rc1/tests/test_cli_db.py +237 -0
  227. sibyld-1.0.0rc1/tests/test_cli_export.py +203 -0
  228. sibyld-1.0.0rc1/tests/test_cli_generate.py +28 -0
  229. sibyld-1.0.0rc1/tests/test_cli_main.py +221 -0
  230. sibyld-1.0.0rc1/tests/test_cli_migrate.py +1460 -0
  231. sibyld-1.0.0rc1/tests/test_cli_up_cmd.py +175 -0
  232. sibyld-1.0.0rc1/tests/test_communities.py +841 -0
  233. sibyld-1.0.0rc1/tests/test_config_security.py +213 -0
  234. sibyld-1.0.0rc1/tests/test_content_runtime.py +539 -0
  235. sibyld-1.0.0rc1/tests/test_coordination_local.py +510 -0
  236. sibyld-1.0.0rc1/tests/test_coordination_scheduler.py +126 -0
  237. sibyld-1.0.0rc1/tests/test_crawler_chunker.py +635 -0
  238. sibyld-1.0.0rc1/tests/test_crawler_embedder.py +99 -0
  239. sibyld-1.0.0rc1/tests/test_crawler_graph_integration.py +803 -0
  240. sibyld-1.0.0rc1/tests/test_crawler_pipeline.py +207 -0
  241. sibyld-1.0.0rc1/tests/test_decorators.py +660 -0
  242. sibyld-1.0.0rc1/tests/test_dedup.py +575 -0
  243. sibyld-1.0.0rc1/tests/test_dependencies.py +288 -0
  244. sibyld-1.0.0rc1/tests/test_device_auth.py +154 -0
  245. sibyld-1.0.0rc1/tests/test_document_search_runtime_scan.py +147 -0
  246. sibyld-1.0.0rc1/tests/test_e2e_workflows.py +545 -0
  247. sibyld-1.0.0rc1/tests/test_email_client.py +37 -0
  248. sibyld-1.0.0rc1/tests/test_embedded.py +31 -0
  249. sibyld-1.0.0rc1/tests/test_error_envelope.py +138 -0
  250. sibyld-1.0.0rc1/tests/test_error_factories.py +411 -0
  251. sibyld-1.0.0rc1/tests/test_error_sanitization.py +123 -0
  252. sibyld-1.0.0rc1/tests/test_graph_communities_lod.py +335 -0
  253. sibyld-1.0.0rc1/tests/test_graph_entities.py +1663 -0
  254. sibyld-1.0.0rc1/tests/test_graph_relationships.py +813 -0
  255. sibyld-1.0.0rc1/tests/test_harness.py +309 -0
  256. sibyld-1.0.0rc1/tests/test_ingestion_storage.py +74 -0
  257. sibyld-1.0.0rc1/tests/test_integration_graphrag.py +535 -0
  258. sibyld-1.0.0rc1/tests/test_jit_provisioning.py +86 -0
  259. sibyld-1.0.0rc1/tests/test_jobs_backup.py +265 -0
  260. sibyld-1.0.0rc1/tests/test_jobs_consolidation.py +347 -0
  261. sibyld-1.0.0rc1/tests/test_jobs_crawl.py +172 -0
  262. sibyld-1.0.0rc1/tests/test_jobs_entities.py +337 -0
  263. sibyld-1.0.0rc1/tests/test_jobs_memory_extraction.py +258 -0
  264. sibyld-1.0.0rc1/tests/test_jobs_privacy.py +50 -0
  265. sibyld-1.0.0rc1/tests/test_jobs_queue.py +444 -0
  266. sibyld-1.0.0rc1/tests/test_jobs_reflection.py +257 -0
  267. sibyld-1.0.0rc1/tests/test_jobs_source_imports.py +578 -0
  268. sibyld-1.0.0rc1/tests/test_legacy_graph_persistence.py +870 -0
  269. sibyld-1.0.0rc1/tests/test_locks.py +444 -0
  270. sibyld-1.0.0rc1/tests/test_main_startup.py +78 -0
  271. sibyld-1.0.0rc1/tests/test_mcp_oauth_multi_org_selection.py +201 -0
  272. sibyld-1.0.0rc1/tests/test_mcp_oauth_session_refresh.py +238 -0
  273. sibyld-1.0.0rc1/tests/test_metrics.py +1578 -0
  274. sibyld-1.0.0rc1/tests/test_models.py +132 -0
  275. sibyld-1.0.0rc1/tests/test_models_sources.py +284 -0
  276. sibyld-1.0.0rc1/tests/test_models_tasks.py +407 -0
  277. sibyld-1.0.0rc1/tests/test_oidc.py +170 -0
  278. sibyld-1.0.0rc1/tests/test_operations_runtime.py +78 -0
  279. sibyld-1.0.0rc1/tests/test_organization_runtime.py +2233 -0
  280. sibyld-1.0.0rc1/tests/test_pending_registry.py +408 -0
  281. sibyld-1.0.0rc1/tests/test_rag_api.py +730 -0
  282. sibyld-1.0.0rc1/tests/test_rag_org_filtering.py +206 -0
  283. sibyld-1.0.0rc1/tests/test_rate_limiting.py +97 -0
  284. sibyld-1.0.0rc1/tests/test_recall_limits.py +98 -0
  285. sibyld-1.0.0rc1/tests/test_retrieval.py +332 -0
  286. sibyld-1.0.0rc1/tests/test_route_access_seams.py +62 -0
  287. sibyld-1.0.0rc1/tests/test_route_ordering.py +74 -0
  288. sibyld-1.0.0rc1/tests/test_routes_admin.py +587 -0
  289. sibyld-1.0.0rc1/tests/test_routes_auth.py +1308 -0
  290. sibyld-1.0.0rc1/tests/test_routes_context.py +1104 -0
  291. sibyld-1.0.0rc1/tests/test_routes_crawler_adapters.py +76 -0
  292. sibyld-1.0.0rc1/tests/test_routes_crawler_graph_link.py +50 -0
  293. sibyld-1.0.0rc1/tests/test_routes_crawler_sources.py +203 -0
  294. sibyld-1.0.0rc1/tests/test_routes_crawler_status.py +72 -0
  295. sibyld-1.0.0rc1/tests/test_routes_entities.py +690 -0
  296. sibyld-1.0.0rc1/tests/test_routes_entities_read.py +636 -0
  297. sibyld-1.0.0rc1/tests/test_routes_entities_write.py +528 -0
  298. sibyld-1.0.0rc1/tests/test_routes_epics.py +104 -0
  299. sibyld-1.0.0rc1/tests/test_routes_graph.py +376 -0
  300. sibyld-1.0.0rc1/tests/test_routes_jobs.py +290 -0
  301. sibyld-1.0.0rc1/tests/test_routes_logs.py +207 -0
  302. sibyld-1.0.0rc1/tests/test_routes_memory.py +2441 -0
  303. sibyld-1.0.0rc1/tests/test_routes_org_invitations.py +170 -0
  304. sibyld-1.0.0rc1/tests/test_routes_org_members.py +207 -0
  305. sibyld-1.0.0rc1/tests/test_routes_orgs.py +196 -0
  306. sibyld-1.0.0rc1/tests/test_routes_project_members.py +229 -0
  307. sibyld-1.0.0rc1/tests/test_routes_resolve.py +197 -0
  308. sibyld-1.0.0rc1/tests/test_routes_search.py +346 -0
  309. sibyld-1.0.0rc1/tests/test_routes_session.py +238 -0
  310. sibyld-1.0.0rc1/tests/test_routes_synthesis.py +317 -0
  311. sibyld-1.0.0rc1/tests/test_routes_tasks.py +533 -0
  312. sibyld-1.0.0rc1/tests/test_runtime_shape.py +59 -0
  313. sibyld-1.0.0rc1/tests/test_server_accessible_projects.py +1111 -0
  314. sibyld-1.0.0rc1/tests/test_settings_api_key_loading.py +192 -0
  315. sibyld-1.0.0rc1/tests/test_settings_routes.py +112 -0
  316. sibyld-1.0.0rc1/tests/test_settings_service.py +157 -0
  317. sibyld-1.0.0rc1/tests/test_setup_routes.py +233 -0
  318. sibyld-1.0.0rc1/tests/test_silent_refresh.py +159 -0
  319. sibyld-1.0.0rc1/tests/test_source_recovery.py +378 -0
  320. sibyld-1.0.0rc1/tests/test_surreal_auth_persistence.py +510 -0
  321. sibyld-1.0.0rc1/tests/test_surreal_auth_runtime.py +2954 -0
  322. sibyld-1.0.0rc1/tests/test_surreal_content_persistence.py +1056 -0
  323. sibyld-1.0.0rc1/tests/test_surreal_live_runtime.py +55 -0
  324. sibyld-1.0.0rc1/tests/test_surreal_runtime_startup.py +141 -0
  325. sibyld-1.0.0rc1/tests/test_surreal_setup.py +309 -0
  326. sibyld-1.0.0rc1/tests/test_tasks_dependencies.py +991 -0
  327. sibyld-1.0.0rc1/tests/test_tasks_estimation.py +192 -0
  328. sibyld-1.0.0rc1/tests/test_tasks_manager.py +749 -0
  329. sibyld-1.0.0rc1/tests/test_tasks_workflow.py +847 -0
  330. sibyld-1.0.0rc1/tests/test_telemetry_routes.py +133 -0
  331. sibyld-1.0.0rc1/tests/test_tools_core.py +895 -0
  332. sibyld-1.0.0rc1/tests/test_tools_manage.py +985 -0
  333. sibyld-1.0.0rc1/tests/test_users_routes.py +270 -0
  334. sibyld-1.0.0rc1/tests/test_websocket.py +315 -0
@@ -0,0 +1,97 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ /lib/
14
+ /lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+
23
+ # Virtual environments
24
+ .venv/
25
+ venv/
26
+ ENV/
27
+ env/
28
+
29
+ # Node
30
+ node_modules/
31
+
32
+ # VitePress
33
+ docs/.vitepress/cache/
34
+ docs/.vitepress/dist/
35
+
36
+ # IDE
37
+ .idea/
38
+ .vscode/
39
+ *.swp
40
+ *.swo
41
+ *~
42
+
43
+ # Testing
44
+ .coverage
45
+ coverage.xml
46
+ .pytest_cache/
47
+ htmlcov/
48
+ .tox/
49
+ .nox/
50
+
51
+ # MyPy
52
+ .mypy_cache/
53
+ .dmypy.json
54
+ dmypy.json
55
+
56
+ # Ruff
57
+ .ruff_cache/
58
+
59
+ # Environment
60
+ .env
61
+ .env.local
62
+
63
+ # Docker
64
+ falkordb_data/
65
+
66
+ # Kubernetes / Tilt
67
+ infra/local/secrets.yaml
68
+ .tiltbuild/
69
+ tilt_modules/
70
+
71
+ # OS
72
+ .DS_Store
73
+ Thumbs.db
74
+
75
+ # Logs
76
+ *.log
77
+ logs/
78
+
79
+ .serena
80
+ .coverage.*
81
+
82
+ # moon
83
+ .moon/cache
84
+ .moon/docker
85
+
86
+ # Backups and database dumps
87
+ backups/
88
+ !apps/web/src/app/(main)/settings/admin/backups/
89
+ !apps/web/src/app/(main)/settings/admin/backups/page.tsx
90
+ *.sql
91
+ !docs/schemas/*.sql
92
+
93
+ # generated docs
94
+ docs/research/*
95
+ !docs/research/rust-port/
96
+ docs/research/rust-port/*
97
+ !docs/research/rust-port/INVENTORY.md
@@ -0,0 +1,218 @@
1
+ Metadata-Version: 2.4
2
+ Name: sibyld
3
+ Version: 1.0.0rc1
4
+ Summary: Sibyl daemon - knowledge graph and task workflow server
5
+ Project-URL: Homepage, https://github.com/hyperb1iss/sibyl
6
+ Project-URL: Repository, https://github.com/hyperb1iss/sibyl
7
+ Project-URL: Issues, https://github.com/hyperb1iss/sibyl/issues
8
+ Author-email: Stefanie Jane <stef@hyperbliss.tech>
9
+ License-Expression: AGPL-3.0-only
10
+ Keywords: developer-tools,graph-rag,knowledge-graph,persistent-memory,semantic-search,task-workflow
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: GNU Affero General Public License v3
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Typing :: Typed
17
+ Requires-Python: >=3.13
18
+ Requires-Dist: argon2-cffi>=25.1.0
19
+ Requires-Dist: arq>=0.26.3
20
+ Requires-Dist: authlib<1.8,>=1.7.2
21
+ Requires-Dist: email-validator>=2.3.0
22
+ Requires-Dist: fastapi>=0.115.0
23
+ Requires-Dist: google-genai>=2.0.1
24
+ Requires-Dist: greenlet>=3.3.0
25
+ Requires-Dist: itsdangerous<3,>=2.2
26
+ Requires-Dist: mcp>=1.25
27
+ Requires-Dist: passlib>=1.7
28
+ Requires-Dist: pyjwt[crypto]<3,>=2.13.0
29
+ Requires-Dist: pyyaml>=6.0
30
+ Requires-Dist: rich>=13.0
31
+ Requires-Dist: sibyl-core[crawler,embeddings,graph,graphrag,llm]
32
+ Requires-Dist: slowapi>=0.1.9
33
+ Requires-Dist: starlette>=0.41.0
34
+ Requires-Dist: surrealdb<3.0,>=2.0.0
35
+ Requires-Dist: tomli-w>=1.2.0
36
+ Requires-Dist: typer>=0.20.0
37
+ Requires-Dist: uvicorn[standard]>=0.38
38
+ Provides-Extra: docs
39
+ Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
40
+ Requires-Dist: mkdocs>=1.6; extra == 'docs'
41
+ Requires-Dist: mkdocstrings[python]>=0.27; extra == 'docs'
42
+ Provides-Extra: generator
43
+ Requires-Dist: anthropic>=0.75; extra == 'generator'
44
+ Requires-Dist: faker>=30.0; extra == 'generator'
45
+ Provides-Extra: graphrag
46
+ Requires-Dist: networkx>=3.0; extra == 'graphrag'
47
+ Requires-Dist: python-louvain>=0.16; extra == 'graphrag'
48
+ Provides-Extra: graphrag-leiden
49
+ Requires-Dist: igraph>=0.11; extra == 'graphrag-leiden'
50
+ Requires-Dist: leidenalg>=0.10; extra == 'graphrag-leiden'
51
+ Requires-Dist: networkx>=3.0; extra == 'graphrag-leiden'
52
+ Description-Content-Type: text/markdown
53
+
54
+ # Sibyl API Server
55
+
56
+ `sibyld` is the FastAPI + FastMCP server behind Sibyl's knowledge graph, agent memory loop, task
57
+ workflow, search, synthesis, and real-time updates.
58
+
59
+ ## Quick Reference
60
+
61
+ ```bash
62
+ # Install the embedded daemon without the web UI
63
+ curl -fsSL https://raw.githubusercontent.com/hyperb1iss/sibyl/main/install.sh | sh -s -- --daemon
64
+
65
+ # Start server from the monorepo
66
+ moon run api:serve # or: uv run sibyld serve
67
+
68
+ # Start worker (Redis coordination only)
69
+ moon run api:worker # or: uv run sibyld worker
70
+
71
+ # Quality checks
72
+ moon run api:test # Run tests
73
+ moon run api:lint # Lint
74
+ moon run api:typecheck # Type check
75
+ ```
76
+
77
+ ## What's Here
78
+
79
+ - **MCP Server:** eleven tools for search, context packs, exploration, capture, memory, synthesis,
80
+ and management
81
+ - **REST API:** 26 routers covering entities, tasks, projects, memory, synthesis, sources, auth,
82
+ settings, and admin
83
+ - **Auth System:** JWT sessions, GitHub OAuth, API keys with scopes, MCP OAuth clients, RBAC
84
+ - **Background Jobs:** in-process local runtime or Redis-backed `arq` workers, including the nightly
85
+ reflection dream-cycle
86
+ - **WebSocket:** Real-time updates for entities and tasks
87
+
88
+ ## Architecture
89
+
90
+ ```
91
+ Sibyl API (port 3334)
92
+ ├── /api/* → FastAPI REST endpoints
93
+ ├── /api/openapi.json → OpenAPI schema
94
+ ├── /mcp → MCP server (streamable-http, 11 tools)
95
+ ├── /api/ws → WebSocket for real-time updates
96
+ └── Lifespan → Background jobs + coordination broker
97
+ ```
98
+
99
+ ## Key Directories
100
+
101
+ | Directory | Purpose |
102
+ | --------------- | ----------------------------------------------------------------------------------------------- |
103
+ | `api/routes/` | REST endpoints (26 routers: tasks, entities, memory, synthesis, crawler, auth, admin, and more) |
104
+ | `ai/` | DB-backed LLM settings, model validation routes, runtime invalidation |
105
+ | `auth/` | JWT, sessions, API keys, RBAC, MCP OAuth clients |
106
+ | `persistence/` | SurrealDB-native runtimes for auth, content, graph, and backups |
107
+ | `crawler/` | Documentation crawl and ingestion pipeline |
108
+ | `ingestion/` | Source import pipeline (mailbox and other adapters) |
109
+ | `jobs/` | Background jobs (reflection dream-cycle, crawl, backups) |
110
+ | `coordination/` | Local and Redis brokers for jobs, locks, and pub/sub |
111
+ | `email/` | Transactional email delivery |
112
+ | `generator/` | Synthetic test-data generation |
113
+
114
+ ## Configuration
115
+
116
+ **Required:**
117
+
118
+ ```bash
119
+ SIBYL_JWT_SECRET=... # Auth (auto-generated in dev)
120
+ SIBYL_ANTHROPIC_API_KEY=... # Required when LLM provider=anthropic
121
+ # SIBYL_OPENAI_API_KEY=sk-... # Required when LLM provider=openai
122
+ # SIBYL_GEMINI_API_KEY=... # Required when LLM provider=gemini
123
+
124
+ # Embeddings: choose OpenAI or Gemini
125
+ SIBYL_EMBEDDING_PROVIDER=openai # openai | gemini
126
+ SIBYL_OPENAI_API_KEY=sk-... # Required when embedding provider=openai
127
+ # SIBYL_GEMINI_API_KEY=... # Required when embedding provider=gemini
128
+ ```
129
+
130
+ **Optional:**
131
+
132
+ ```bash
133
+ SIBYL_STORE=surreal # default; legacy is migration/source-side only
134
+ SIBYL_COORDINATION_BACKEND=auto # auto | local | redis
135
+ SIBYL_SURREAL_URL=ws://127.0.0.1:8000/rpc
136
+ SIBYL_SURREAL_USERNAME=root
137
+ SIBYL_SURREAL_PASSWORD=root
138
+ SIBYL_REDIS_HOST=127.0.0.1 # only needed for Redis coordination
139
+ SIBYL_REDIS_PORT=6381
140
+ SIBYL_LLM_PROVIDER=anthropic # anthropic | openai
141
+ SIBYL_LLM_MODEL=claude-haiku-4-5
142
+ SIBYL_LLM_CRAWLER_MODEL=claude-haiku-4-5
143
+ SIBYL_LLM_SYNTHESIS_MODEL=claude-sonnet-4-6
144
+ SIBYL_LLM_TEMPERATURE=0
145
+ SIBYL_LLM_TIMEOUT_SECONDS=60
146
+ SIBYL_EMBEDDING_MODEL=text-embedding-3-small
147
+ SIBYL_EMBEDDING_DIMENSIONS=1536
148
+ SIBYL_GRAPH_EMBEDDING_PROVIDER=openai
149
+ SIBYL_GRAPH_EMBEDDING_MODEL=text-embedding-3-small
150
+ SIBYL_GRAPH_EMBEDDING_DIMENSIONS=1024
151
+ ```
152
+
153
+ PostgreSQL settings are only for historical archive rehearsal commands that explicitly restore a
154
+ retained `postgres.sql` payload against an operator-managed database. They are not part of default
155
+ Surreal runtime startup.
156
+
157
+ Gemini keys can also be supplied through `GEMINI_API_KEY` or `GOOGLE_API_KEY`. Changing embedding
158
+ provider, model, or dimensions changes vector spaces; re-crawl sources and rebuild graph indexes
159
+ before mixing old and new search results.
160
+
161
+ LLM settings are instance-wide. Environment variables win over database settings field by field;
162
+ env-backed fields return `409 LOCKED_BY_ENV` on write. Database settings are managed under:
163
+
164
+ ```text
165
+ GET /api/settings/ai/llm
166
+ PUT /api/settings/ai/llm/{surface}
167
+ POST /api/settings/ai/llm/{surface}/test
168
+ POST /api/settings/ai/keys/{provider}/test
169
+ POST /api/settings/ai/models/{model_alias}/test
170
+ GET /api/settings/ai/registry?kind=llm
171
+ ```
172
+
173
+ Crawler extraction and synthesis generation call `sibyl_core.ai` rather than provider SDKs directly.
174
+ Custom model IDs are accepted as database settings with an `unverified_model` warning; validate them
175
+ with the model test endpoint before using them in production flows.
176
+
177
+ ## CLI Commands
178
+
179
+ ```bash
180
+ sibyld serve # Start the HTTP server
181
+ sibyld serve -t stdio # Start a stdio server (MCP subprocess mode)
182
+ sibyld worker # Start the job worker (local mode exits cleanly)
183
+ sibyld up # Start data services + API
184
+ sibyld down # Stop all services
185
+ sibyld db backup # Back up the graph database
186
+ sibyld migrate import ... # Import a migration archive
187
+ sibyld generate realistic # Generate sample data
188
+ ```
189
+
190
+ ## Runtime Modes
191
+
192
+ For single-machine Surreal development, run `sibyld serve` or `sibyld up` with
193
+ `SIBYL_STORE=surreal`. The default `coordination_backend=auto` resolves to `local`, so background
194
+ jobs, pending state, locks, pub/sub, and schedules all stay in-process with no Redis requirement.
195
+
196
+ Redis remains available for distributed or multi-process dev. Set `SIBYL_COORDINATION_BACKEND=redis`
197
+ when you want the `arq` worker model, then run `sibyld worker` or `moon run api:worker` separately.
198
+
199
+ ## Key Patterns
200
+
201
+ **Multi-tenancy:** Every operation requires org context.
202
+
203
+ ```python
204
+ manager = EntityManager(client, group_id=str(org.id))
205
+ ```
206
+
207
+ Write concurrency: the SurrealDB driver serializes WebSocket operations per client. Clone graph
208
+ drivers per organization rather than sharing one driver across org scopes.
209
+
210
+ **Request context:** Auth middleware injects user and org.
211
+
212
+ ```python
213
+ from sibyl.auth.dependencies import get_current_user, get_current_organization
214
+ ```
215
+
216
+ ## Dependencies
217
+
218
+ Depends on `sibyl-core` for models, graph client, AI substrate, and tool implementations.
@@ -0,0 +1,165 @@
1
+ # Sibyl API Server
2
+
3
+ `sibyld` is the FastAPI + FastMCP server behind Sibyl's knowledge graph, agent memory loop, task
4
+ workflow, search, synthesis, and real-time updates.
5
+
6
+ ## Quick Reference
7
+
8
+ ```bash
9
+ # Install the embedded daemon without the web UI
10
+ curl -fsSL https://raw.githubusercontent.com/hyperb1iss/sibyl/main/install.sh | sh -s -- --daemon
11
+
12
+ # Start server from the monorepo
13
+ moon run api:serve # or: uv run sibyld serve
14
+
15
+ # Start worker (Redis coordination only)
16
+ moon run api:worker # or: uv run sibyld worker
17
+
18
+ # Quality checks
19
+ moon run api:test # Run tests
20
+ moon run api:lint # Lint
21
+ moon run api:typecheck # Type check
22
+ ```
23
+
24
+ ## What's Here
25
+
26
+ - **MCP Server:** eleven tools for search, context packs, exploration, capture, memory, synthesis,
27
+ and management
28
+ - **REST API:** 26 routers covering entities, tasks, projects, memory, synthesis, sources, auth,
29
+ settings, and admin
30
+ - **Auth System:** JWT sessions, GitHub OAuth, API keys with scopes, MCP OAuth clients, RBAC
31
+ - **Background Jobs:** in-process local runtime or Redis-backed `arq` workers, including the nightly
32
+ reflection dream-cycle
33
+ - **WebSocket:** Real-time updates for entities and tasks
34
+
35
+ ## Architecture
36
+
37
+ ```
38
+ Sibyl API (port 3334)
39
+ ├── /api/* → FastAPI REST endpoints
40
+ ├── /api/openapi.json → OpenAPI schema
41
+ ├── /mcp → MCP server (streamable-http, 11 tools)
42
+ ├── /api/ws → WebSocket for real-time updates
43
+ └── Lifespan → Background jobs + coordination broker
44
+ ```
45
+
46
+ ## Key Directories
47
+
48
+ | Directory | Purpose |
49
+ | --------------- | ----------------------------------------------------------------------------------------------- |
50
+ | `api/routes/` | REST endpoints (26 routers: tasks, entities, memory, synthesis, crawler, auth, admin, and more) |
51
+ | `ai/` | DB-backed LLM settings, model validation routes, runtime invalidation |
52
+ | `auth/` | JWT, sessions, API keys, RBAC, MCP OAuth clients |
53
+ | `persistence/` | SurrealDB-native runtimes for auth, content, graph, and backups |
54
+ | `crawler/` | Documentation crawl and ingestion pipeline |
55
+ | `ingestion/` | Source import pipeline (mailbox and other adapters) |
56
+ | `jobs/` | Background jobs (reflection dream-cycle, crawl, backups) |
57
+ | `coordination/` | Local and Redis brokers for jobs, locks, and pub/sub |
58
+ | `email/` | Transactional email delivery |
59
+ | `generator/` | Synthetic test-data generation |
60
+
61
+ ## Configuration
62
+
63
+ **Required:**
64
+
65
+ ```bash
66
+ SIBYL_JWT_SECRET=... # Auth (auto-generated in dev)
67
+ SIBYL_ANTHROPIC_API_KEY=... # Required when LLM provider=anthropic
68
+ # SIBYL_OPENAI_API_KEY=sk-... # Required when LLM provider=openai
69
+ # SIBYL_GEMINI_API_KEY=... # Required when LLM provider=gemini
70
+
71
+ # Embeddings: choose OpenAI or Gemini
72
+ SIBYL_EMBEDDING_PROVIDER=openai # openai | gemini
73
+ SIBYL_OPENAI_API_KEY=sk-... # Required when embedding provider=openai
74
+ # SIBYL_GEMINI_API_KEY=... # Required when embedding provider=gemini
75
+ ```
76
+
77
+ **Optional:**
78
+
79
+ ```bash
80
+ SIBYL_STORE=surreal # default; legacy is migration/source-side only
81
+ SIBYL_COORDINATION_BACKEND=auto # auto | local | redis
82
+ SIBYL_SURREAL_URL=ws://127.0.0.1:8000/rpc
83
+ SIBYL_SURREAL_USERNAME=root
84
+ SIBYL_SURREAL_PASSWORD=root
85
+ SIBYL_REDIS_HOST=127.0.0.1 # only needed for Redis coordination
86
+ SIBYL_REDIS_PORT=6381
87
+ SIBYL_LLM_PROVIDER=anthropic # anthropic | openai
88
+ SIBYL_LLM_MODEL=claude-haiku-4-5
89
+ SIBYL_LLM_CRAWLER_MODEL=claude-haiku-4-5
90
+ SIBYL_LLM_SYNTHESIS_MODEL=claude-sonnet-4-6
91
+ SIBYL_LLM_TEMPERATURE=0
92
+ SIBYL_LLM_TIMEOUT_SECONDS=60
93
+ SIBYL_EMBEDDING_MODEL=text-embedding-3-small
94
+ SIBYL_EMBEDDING_DIMENSIONS=1536
95
+ SIBYL_GRAPH_EMBEDDING_PROVIDER=openai
96
+ SIBYL_GRAPH_EMBEDDING_MODEL=text-embedding-3-small
97
+ SIBYL_GRAPH_EMBEDDING_DIMENSIONS=1024
98
+ ```
99
+
100
+ PostgreSQL settings are only for historical archive rehearsal commands that explicitly restore a
101
+ retained `postgres.sql` payload against an operator-managed database. They are not part of default
102
+ Surreal runtime startup.
103
+
104
+ Gemini keys can also be supplied through `GEMINI_API_KEY` or `GOOGLE_API_KEY`. Changing embedding
105
+ provider, model, or dimensions changes vector spaces; re-crawl sources and rebuild graph indexes
106
+ before mixing old and new search results.
107
+
108
+ LLM settings are instance-wide. Environment variables win over database settings field by field;
109
+ env-backed fields return `409 LOCKED_BY_ENV` on write. Database settings are managed under:
110
+
111
+ ```text
112
+ GET /api/settings/ai/llm
113
+ PUT /api/settings/ai/llm/{surface}
114
+ POST /api/settings/ai/llm/{surface}/test
115
+ POST /api/settings/ai/keys/{provider}/test
116
+ POST /api/settings/ai/models/{model_alias}/test
117
+ GET /api/settings/ai/registry?kind=llm
118
+ ```
119
+
120
+ Crawler extraction and synthesis generation call `sibyl_core.ai` rather than provider SDKs directly.
121
+ Custom model IDs are accepted as database settings with an `unverified_model` warning; validate them
122
+ with the model test endpoint before using them in production flows.
123
+
124
+ ## CLI Commands
125
+
126
+ ```bash
127
+ sibyld serve # Start the HTTP server
128
+ sibyld serve -t stdio # Start a stdio server (MCP subprocess mode)
129
+ sibyld worker # Start the job worker (local mode exits cleanly)
130
+ sibyld up # Start data services + API
131
+ sibyld down # Stop all services
132
+ sibyld db backup # Back up the graph database
133
+ sibyld migrate import ... # Import a migration archive
134
+ sibyld generate realistic # Generate sample data
135
+ ```
136
+
137
+ ## Runtime Modes
138
+
139
+ For single-machine Surreal development, run `sibyld serve` or `sibyld up` with
140
+ `SIBYL_STORE=surreal`. The default `coordination_backend=auto` resolves to `local`, so background
141
+ jobs, pending state, locks, pub/sub, and schedules all stay in-process with no Redis requirement.
142
+
143
+ Redis remains available for distributed or multi-process dev. Set `SIBYL_COORDINATION_BACKEND=redis`
144
+ when you want the `arq` worker model, then run `sibyld worker` or `moon run api:worker` separately.
145
+
146
+ ## Key Patterns
147
+
148
+ **Multi-tenancy:** Every operation requires org context.
149
+
150
+ ```python
151
+ manager = EntityManager(client, group_id=str(org.id))
152
+ ```
153
+
154
+ Write concurrency: the SurrealDB driver serializes WebSocket operations per client. Clone graph
155
+ drivers per organization rather than sharing one driver across org scopes.
156
+
157
+ **Request context:** Auth middleware injects user and org.
158
+
159
+ ```python
160
+ from sibyl.auth.dependencies import get_current_user, get_current_organization
161
+ ```
162
+
163
+ ## Dependencies
164
+
165
+ Depends on `sibyl-core` for models, graph client, AI substrate, and tool implementations.