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.
- sibyld-1.0.0rc1/.gitignore +97 -0
- sibyld-1.0.0rc1/PKG-INFO +218 -0
- sibyld-1.0.0rc1/README.md +165 -0
- sibyld-1.0.0rc1/pyproject.toml +318 -0
- sibyld-1.0.0rc1/src/sibyl/__init__.py +32 -0
- sibyld-1.0.0rc1/src/sibyl/ai/__init__.py +1 -0
- sibyld-1.0.0rc1/src/sibyl/ai/llm/__init__.py +11 -0
- sibyld-1.0.0rc1/src/sibyl/ai/llm/budget.py +219 -0
- sibyld-1.0.0rc1/src/sibyl/ai/llm/config_source.py +191 -0
- sibyld-1.0.0rc1/src/sibyl/ai/llm/routes.py +349 -0
- sibyld-1.0.0rc1/src/sibyl/ai/llm/service.py +26 -0
- sibyld-1.0.0rc1/src/sibyl/api/__init__.py +31 -0
- sibyld-1.0.0rc1/src/sibyl/api/app.py +443 -0
- sibyld-1.0.0rc1/src/sibyl/api/context_audit.py +321 -0
- sibyld-1.0.0rc1/src/sibyl/api/decorators.py +293 -0
- sibyld-1.0.0rc1/src/sibyl/api/dependencies.py +153 -0
- sibyld-1.0.0rc1/src/sibyl/api/errors.py +662 -0
- sibyld-1.0.0rc1/src/sibyl/api/event_types.py +31 -0
- sibyld-1.0.0rc1/src/sibyl/api/idempotency.py +108 -0
- sibyld-1.0.0rc1/src/sibyl/api/pubsub.py +31 -0
- sibyld-1.0.0rc1/src/sibyl/api/rate_limit.py +54 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/__init__.py +60 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/admin.py +932 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/auth.py +1715 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/backups.py +438 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/context.py +332 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/crawler.py +1145 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/entities.py +1840 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/epics.py +357 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/graph.py +699 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/jobs.py +341 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/logs.py +139 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/memory.py +2475 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/metrics.py +691 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/org_invitations.py +156 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/org_members.py +121 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/orgs.py +181 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/project_members.py +161 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/rag.py +745 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/resolve.py +292 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/search.py +330 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/session.py +279 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/settings.py +345 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/setup.py +402 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/synthesis.py +213 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/tasks.py +1098 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/telemetry.py +62 -0
- sibyld-1.0.0rc1/src/sibyl/api/routes/users.py +407 -0
- sibyld-1.0.0rc1/src/sibyl/api/schemas.py +2107 -0
- sibyld-1.0.0rc1/src/sibyl/api/websocket.py +390 -0
- sibyld-1.0.0rc1/src/sibyl/auth/__init__.py +56 -0
- sibyld-1.0.0rc1/src/sibyl/auth/api_key_common.py +103 -0
- sibyld-1.0.0rc1/src/sibyl/auth/authorization.py +307 -0
- sibyld-1.0.0rc1/src/sibyl/auth/context.py +5 -0
- sibyld-1.0.0rc1/src/sibyl/auth/dependencies.py +271 -0
- sibyld-1.0.0rc1/src/sibyl/auth/errors.py +175 -0
- sibyld-1.0.0rc1/src/sibyl/auth/http.py +23 -0
- sibyld-1.0.0rc1/src/sibyl/auth/jit.py +48 -0
- sibyld-1.0.0rc1/src/sibyl/auth/jwt.py +19 -0
- sibyld-1.0.0rc1/src/sibyl/auth/locks.py +36 -0
- sibyld-1.0.0rc1/src/sibyl/auth/mcp_auth.py +81 -0
- sibyld-1.0.0rc1/src/sibyl/auth/mcp_oauth.py +741 -0
- sibyld-1.0.0rc1/src/sibyl/auth/middleware.py +35 -0
- sibyld-1.0.0rc1/src/sibyl/auth/oauth_state.py +81 -0
- sibyld-1.0.0rc1/src/sibyl/auth/oidc.py +295 -0
- sibyld-1.0.0rc1/src/sibyl/auth/passwords.py +10 -0
- sibyld-1.0.0rc1/src/sibyl/auth/primitives.py +51 -0
- sibyld-1.0.0rc1/src/sibyl/auth/rls.py +66 -0
- sibyld-1.0.0rc1/src/sibyl/auth/session_cache.py +105 -0
- sibyld-1.0.0rc1/src/sibyl/auth/silent_refresh.py +32 -0
- sibyld-1.0.0rc1/src/sibyl/auth/tenancy.py +30 -0
- sibyld-1.0.0rc1/src/sibyl/backup_ids.py +10 -0
- sibyld-1.0.0rc1/src/sibyl/banner.py +50 -0
- sibyld-1.0.0rc1/src/sibyl/cache.py +496 -0
- sibyld-1.0.0rc1/src/sibyl/cli/__init__.py +20 -0
- sibyld-1.0.0rc1/src/sibyl/cli/auth_flow.py +837 -0
- sibyld-1.0.0rc1/src/sibyl/cli/bootstrap.py +301 -0
- sibyld-1.0.0rc1/src/sibyl/cli/common.py +222 -0
- sibyld-1.0.0rc1/src/sibyl/cli/db.py +1012 -0
- sibyld-1.0.0rc1/src/sibyl/cli/export.py +307 -0
- sibyld-1.0.0rc1/src/sibyl/cli/generate.py +502 -0
- sibyld-1.0.0rc1/src/sibyl/cli/main.py +456 -0
- sibyld-1.0.0rc1/src/sibyl/cli/migrate.py +2097 -0
- sibyld-1.0.0rc1/src/sibyl/cli/up_cmd.py +369 -0
- sibyld-1.0.0rc1/src/sibyl/config.py +717 -0
- sibyld-1.0.0rc1/src/sibyl/coordination/__init__.py +59 -0
- sibyld-1.0.0rc1/src/sibyl/coordination/_local/__init__.py +1 -0
- sibyld-1.0.0rc1/src/sibyl/coordination/_local/broker.py +645 -0
- sibyld-1.0.0rc1/src/sibyl/coordination/_local/events.py +45 -0
- sibyld-1.0.0rc1/src/sibyl/coordination/_local/locks.py +93 -0
- sibyld-1.0.0rc1/src/sibyl/coordination/_local/pending.py +115 -0
- sibyld-1.0.0rc1/src/sibyl/coordination/_local/scheduler.py +129 -0
- sibyld-1.0.0rc1/src/sibyl/coordination/_redis/__init__.py +1 -0
- sibyld-1.0.0rc1/src/sibyl/coordination/_redis/broker.py +719 -0
- sibyld-1.0.0rc1/src/sibyl/coordination/_redis/events.py +139 -0
- sibyld-1.0.0rc1/src/sibyl/coordination/_redis/locks.py +193 -0
- sibyld-1.0.0rc1/src/sibyl/coordination/_redis/pending.py +117 -0
- sibyld-1.0.0rc1/src/sibyl/coordination/_redis/scheduler.py +16 -0
- sibyld-1.0.0rc1/src/sibyl/coordination/broker.py +249 -0
- sibyld-1.0.0rc1/src/sibyl/coordination/events.py +49 -0
- sibyld-1.0.0rc1/src/sibyl/coordination/locks.py +78 -0
- sibyld-1.0.0rc1/src/sibyl/coordination/pending.py +65 -0
- sibyld-1.0.0rc1/src/sibyl/coordination/scheduler.py +42 -0
- sibyld-1.0.0rc1/src/sibyl/crawler/__init__.py +106 -0
- sibyld-1.0.0rc1/src/sibyl/crawler/chunker.py +589 -0
- sibyld-1.0.0rc1/src/sibyl/crawler/discovery.py +305 -0
- sibyld-1.0.0rc1/src/sibyl/crawler/embedder.py +296 -0
- sibyld-1.0.0rc1/src/sibyl/crawler/graph_integration.py +915 -0
- sibyld-1.0.0rc1/src/sibyl/crawler/llms_parser.py +228 -0
- sibyld-1.0.0rc1/src/sibyl/crawler/local.py +202 -0
- sibyld-1.0.0rc1/src/sibyl/crawler/pipeline.py +609 -0
- sibyld-1.0.0rc1/src/sibyl/crawler/service.py +922 -0
- sibyld-1.0.0rc1/src/sibyl/crawler/tagger.py +179 -0
- sibyld-1.0.0rc1/src/sibyl/crypto.py +164 -0
- sibyld-1.0.0rc1/src/sibyl/db/__init__.py +7 -0
- sibyld-1.0.0rc1/src/sibyl/email/__init__.py +20 -0
- sibyld-1.0.0rc1/src/sibyl/email/client.py +152 -0
- sibyld-1.0.0rc1/src/sibyl/email/templates.py +248 -0
- sibyld-1.0.0rc1/src/sibyl/embedded.py +127 -0
- sibyld-1.0.0rc1/src/sibyl/generator/__init__.py +31 -0
- sibyld-1.0.0rc1/src/sibyl/generator/base.py +107 -0
- sibyld-1.0.0rc1/src/sibyl/generator/config.py +137 -0
- sibyld-1.0.0rc1/src/sibyl/generator/llm.py +426 -0
- sibyld-1.0.0rc1/src/sibyl/generator/relationships.py +331 -0
- sibyld-1.0.0rc1/src/sibyl/generator/scenarios.py +180 -0
- sibyld-1.0.0rc1/src/sibyl/generator/stress.py +317 -0
- sibyld-1.0.0rc1/src/sibyl/generator/templates.py +528 -0
- sibyld-1.0.0rc1/src/sibyl/ingestion/__init__.py +78 -0
- sibyld-1.0.0rc1/src/sibyl/ingestion/cataloger.py +465 -0
- sibyld-1.0.0rc1/src/sibyl/ingestion/chunker.py +226 -0
- sibyld-1.0.0rc1/src/sibyl/ingestion/extractor.py +339 -0
- sibyld-1.0.0rc1/src/sibyl/ingestion/parser.py +301 -0
- sibyld-1.0.0rc1/src/sibyl/ingestion/pipeline.py +374 -0
- sibyld-1.0.0rc1/src/sibyl/ingestion/relationships.py +254 -0
- sibyld-1.0.0rc1/src/sibyl/ingestion/storage.py +329 -0
- sibyld-1.0.0rc1/src/sibyl/jobs/__init__.py +118 -0
- sibyld-1.0.0rc1/src/sibyl/jobs/backup.py +689 -0
- sibyld-1.0.0rc1/src/sibyl/jobs/consolidation.py +254 -0
- sibyld-1.0.0rc1/src/sibyl/jobs/crawl.py +284 -0
- sibyld-1.0.0rc1/src/sibyl/jobs/entities.py +1082 -0
- sibyld-1.0.0rc1/src/sibyl/jobs/memory_extraction.py +413 -0
- sibyld-1.0.0rc1/src/sibyl/jobs/pending.py +287 -0
- sibyld-1.0.0rc1/src/sibyl/jobs/privacy.py +38 -0
- sibyld-1.0.0rc1/src/sibyl/jobs/queue.py +288 -0
- sibyld-1.0.0rc1/src/sibyl/jobs/reflection.py +653 -0
- sibyld-1.0.0rc1/src/sibyl/jobs/source_imports.py +714 -0
- sibyld-1.0.0rc1/src/sibyl/jobs/worker.py +342 -0
- sibyld-1.0.0rc1/src/sibyl/locks.py +86 -0
- sibyld-1.0.0rc1/src/sibyl/main.py +394 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/auth_archive.py +335 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/auth_common.py +79 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/auth_runtime.py +556 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/backups_common.py +131 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/backups_runtime.py +132 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/content_archive.py +398 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/content_common.py +172 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/content_runtime.py +480 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/graph_runtime.py +1403 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/legacy/__init__.py +77 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/legacy/graph.py +115 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/operations_runtime.py +112 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/organization_common.py +104 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/organization_runtime.py +285 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/settings_runtime.py +74 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/settings_types.py +19 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/setup_common.py +13 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/surreal/__init__.py +25 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/surreal/auth.py +808 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/surreal/auth_runtime.py +4553 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/surreal/backups.py +396 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/surreal/content.py +1996 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/surreal/organization_runtime.py +2095 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/surreal/setup.py +177 -0
- sibyld-1.0.0rc1/src/sibyl/persistence/surreal/system_settings.py +110 -0
- sibyld-1.0.0rc1/src/sibyl/runtime_shape.py +112 -0
- sibyld-1.0.0rc1/src/sibyl/server.py +1824 -0
- sibyld-1.0.0rc1/src/sibyl/services/__init__.py +8 -0
- sibyld-1.0.0rc1/src/sibyl/services/recall_limits.py +101 -0
- sibyld-1.0.0rc1/src/sibyl/services/settings.py +450 -0
- sibyld-1.0.0rc1/src/sibyl/services/telemetry.py +141 -0
- sibyld-1.0.0rc1/src/sibyl/surreal_runtime_startup.py +66 -0
- sibyld-1.0.0rc1/tests/__init__.py +1 -0
- sibyld-1.0.0rc1/tests/ai/llm/test_budget.py +175 -0
- sibyld-1.0.0rc1/tests/ai/llm/test_config_source.py +113 -0
- sibyld-1.0.0rc1/tests/ai/test_llm_settings_api.py +200 -0
- sibyld-1.0.0rc1/tests/conftest.py +105 -0
- sibyld-1.0.0rc1/tests/evals/__init__.py +9 -0
- sibyld-1.0.0rc1/tests/evals/runner.py +36 -0
- sibyld-1.0.0rc1/tests/evals/test_metrics.py +306 -0
- sibyld-1.0.0rc1/tests/generator/test_llm.py +78 -0
- sibyld-1.0.0rc1/tests/harness/__init__.py +90 -0
- sibyld-1.0.0rc1/tests/harness/context.py +292 -0
- sibyld-1.0.0rc1/tests/harness/helpers.py +326 -0
- sibyld-1.0.0rc1/tests/harness/mocks.py +324 -0
- sibyld-1.0.0rc1/tests/test_api_app_startup.py +102 -0
- sibyld-1.0.0rc1/tests/test_api_entities_create_task_fields.py +135 -0
- sibyld-1.0.0rc1/tests/test_api_entities_raw_capture.py +254 -0
- sibyld-1.0.0rc1/tests/test_api_raw_captures.py +286 -0
- sibyld-1.0.0rc1/tests/test_api_tasks_validation.py +159 -0
- sibyld-1.0.0rc1/tests/test_archive_imports.py +35 -0
- sibyld-1.0.0rc1/tests/test_auth_api_key_scopes_rest.py +177 -0
- sibyld-1.0.0rc1/tests/test_auth_api_keys.py +44 -0
- sibyld-1.0.0rc1/tests/test_auth_authorization.py +210 -0
- sibyld-1.0.0rc1/tests/test_auth_context.py +13 -0
- sibyld-1.0.0rc1/tests/test_auth_cookie_config.py +44 -0
- sibyld-1.0.0rc1/tests/test_auth_dependencies.py +375 -0
- sibyld-1.0.0rc1/tests/test_auth_errors.py +158 -0
- sibyld-1.0.0rc1/tests/test_auth_flow_replay.py +466 -0
- sibyld-1.0.0rc1/tests/test_auth_http.py +17 -0
- sibyld-1.0.0rc1/tests/test_auth_invitation_token.py +9 -0
- sibyld-1.0.0rc1/tests/test_auth_jwt.py +82 -0
- sibyld-1.0.0rc1/tests/test_auth_mcp_token_verifier.py +143 -0
- sibyld-1.0.0rc1/tests/test_auth_oauth_state.py +35 -0
- sibyld-1.0.0rc1/tests/test_auth_passwords.py +44 -0
- sibyld-1.0.0rc1/tests/test_auth_rls.py +54 -0
- sibyld-1.0.0rc1/tests/test_auth_runtime.py +263 -0
- sibyld-1.0.0rc1/tests/test_auth_session_cache.py +65 -0
- sibyld-1.0.0rc1/tests/test_auth_settings.py +307 -0
- sibyld-1.0.0rc1/tests/test_auth_signup_locks.py +126 -0
- sibyld-1.0.0rc1/tests/test_auth_slugify.py +7 -0
- sibyld-1.0.0rc1/tests/test_auth_tenancy.py +64 -0
- sibyld-1.0.0rc1/tests/test_auth_users_sessions_cookie.py +45 -0
- sibyld-1.0.0rc1/tests/test_backups_routes.py +260 -0
- sibyld-1.0.0rc1/tests/test_cache.py +358 -0
- sibyld-1.0.0rc1/tests/test_cli_bootstrap.py +101 -0
- sibyld-1.0.0rc1/tests/test_cli_db.py +237 -0
- sibyld-1.0.0rc1/tests/test_cli_export.py +203 -0
- sibyld-1.0.0rc1/tests/test_cli_generate.py +28 -0
- sibyld-1.0.0rc1/tests/test_cli_main.py +221 -0
- sibyld-1.0.0rc1/tests/test_cli_migrate.py +1460 -0
- sibyld-1.0.0rc1/tests/test_cli_up_cmd.py +175 -0
- sibyld-1.0.0rc1/tests/test_communities.py +841 -0
- sibyld-1.0.0rc1/tests/test_config_security.py +213 -0
- sibyld-1.0.0rc1/tests/test_content_runtime.py +539 -0
- sibyld-1.0.0rc1/tests/test_coordination_local.py +510 -0
- sibyld-1.0.0rc1/tests/test_coordination_scheduler.py +126 -0
- sibyld-1.0.0rc1/tests/test_crawler_chunker.py +635 -0
- sibyld-1.0.0rc1/tests/test_crawler_embedder.py +99 -0
- sibyld-1.0.0rc1/tests/test_crawler_graph_integration.py +803 -0
- sibyld-1.0.0rc1/tests/test_crawler_pipeline.py +207 -0
- sibyld-1.0.0rc1/tests/test_decorators.py +660 -0
- sibyld-1.0.0rc1/tests/test_dedup.py +575 -0
- sibyld-1.0.0rc1/tests/test_dependencies.py +288 -0
- sibyld-1.0.0rc1/tests/test_device_auth.py +154 -0
- sibyld-1.0.0rc1/tests/test_document_search_runtime_scan.py +147 -0
- sibyld-1.0.0rc1/tests/test_e2e_workflows.py +545 -0
- sibyld-1.0.0rc1/tests/test_email_client.py +37 -0
- sibyld-1.0.0rc1/tests/test_embedded.py +31 -0
- sibyld-1.0.0rc1/tests/test_error_envelope.py +138 -0
- sibyld-1.0.0rc1/tests/test_error_factories.py +411 -0
- sibyld-1.0.0rc1/tests/test_error_sanitization.py +123 -0
- sibyld-1.0.0rc1/tests/test_graph_communities_lod.py +335 -0
- sibyld-1.0.0rc1/tests/test_graph_entities.py +1663 -0
- sibyld-1.0.0rc1/tests/test_graph_relationships.py +813 -0
- sibyld-1.0.0rc1/tests/test_harness.py +309 -0
- sibyld-1.0.0rc1/tests/test_ingestion_storage.py +74 -0
- sibyld-1.0.0rc1/tests/test_integration_graphrag.py +535 -0
- sibyld-1.0.0rc1/tests/test_jit_provisioning.py +86 -0
- sibyld-1.0.0rc1/tests/test_jobs_backup.py +265 -0
- sibyld-1.0.0rc1/tests/test_jobs_consolidation.py +347 -0
- sibyld-1.0.0rc1/tests/test_jobs_crawl.py +172 -0
- sibyld-1.0.0rc1/tests/test_jobs_entities.py +337 -0
- sibyld-1.0.0rc1/tests/test_jobs_memory_extraction.py +258 -0
- sibyld-1.0.0rc1/tests/test_jobs_privacy.py +50 -0
- sibyld-1.0.0rc1/tests/test_jobs_queue.py +444 -0
- sibyld-1.0.0rc1/tests/test_jobs_reflection.py +257 -0
- sibyld-1.0.0rc1/tests/test_jobs_source_imports.py +578 -0
- sibyld-1.0.0rc1/tests/test_legacy_graph_persistence.py +870 -0
- sibyld-1.0.0rc1/tests/test_locks.py +444 -0
- sibyld-1.0.0rc1/tests/test_main_startup.py +78 -0
- sibyld-1.0.0rc1/tests/test_mcp_oauth_multi_org_selection.py +201 -0
- sibyld-1.0.0rc1/tests/test_mcp_oauth_session_refresh.py +238 -0
- sibyld-1.0.0rc1/tests/test_metrics.py +1578 -0
- sibyld-1.0.0rc1/tests/test_models.py +132 -0
- sibyld-1.0.0rc1/tests/test_models_sources.py +284 -0
- sibyld-1.0.0rc1/tests/test_models_tasks.py +407 -0
- sibyld-1.0.0rc1/tests/test_oidc.py +170 -0
- sibyld-1.0.0rc1/tests/test_operations_runtime.py +78 -0
- sibyld-1.0.0rc1/tests/test_organization_runtime.py +2233 -0
- sibyld-1.0.0rc1/tests/test_pending_registry.py +408 -0
- sibyld-1.0.0rc1/tests/test_rag_api.py +730 -0
- sibyld-1.0.0rc1/tests/test_rag_org_filtering.py +206 -0
- sibyld-1.0.0rc1/tests/test_rate_limiting.py +97 -0
- sibyld-1.0.0rc1/tests/test_recall_limits.py +98 -0
- sibyld-1.0.0rc1/tests/test_retrieval.py +332 -0
- sibyld-1.0.0rc1/tests/test_route_access_seams.py +62 -0
- sibyld-1.0.0rc1/tests/test_route_ordering.py +74 -0
- sibyld-1.0.0rc1/tests/test_routes_admin.py +587 -0
- sibyld-1.0.0rc1/tests/test_routes_auth.py +1308 -0
- sibyld-1.0.0rc1/tests/test_routes_context.py +1104 -0
- sibyld-1.0.0rc1/tests/test_routes_crawler_adapters.py +76 -0
- sibyld-1.0.0rc1/tests/test_routes_crawler_graph_link.py +50 -0
- sibyld-1.0.0rc1/tests/test_routes_crawler_sources.py +203 -0
- sibyld-1.0.0rc1/tests/test_routes_crawler_status.py +72 -0
- sibyld-1.0.0rc1/tests/test_routes_entities.py +690 -0
- sibyld-1.0.0rc1/tests/test_routes_entities_read.py +636 -0
- sibyld-1.0.0rc1/tests/test_routes_entities_write.py +528 -0
- sibyld-1.0.0rc1/tests/test_routes_epics.py +104 -0
- sibyld-1.0.0rc1/tests/test_routes_graph.py +376 -0
- sibyld-1.0.0rc1/tests/test_routes_jobs.py +290 -0
- sibyld-1.0.0rc1/tests/test_routes_logs.py +207 -0
- sibyld-1.0.0rc1/tests/test_routes_memory.py +2441 -0
- sibyld-1.0.0rc1/tests/test_routes_org_invitations.py +170 -0
- sibyld-1.0.0rc1/tests/test_routes_org_members.py +207 -0
- sibyld-1.0.0rc1/tests/test_routes_orgs.py +196 -0
- sibyld-1.0.0rc1/tests/test_routes_project_members.py +229 -0
- sibyld-1.0.0rc1/tests/test_routes_resolve.py +197 -0
- sibyld-1.0.0rc1/tests/test_routes_search.py +346 -0
- sibyld-1.0.0rc1/tests/test_routes_session.py +238 -0
- sibyld-1.0.0rc1/tests/test_routes_synthesis.py +317 -0
- sibyld-1.0.0rc1/tests/test_routes_tasks.py +533 -0
- sibyld-1.0.0rc1/tests/test_runtime_shape.py +59 -0
- sibyld-1.0.0rc1/tests/test_server_accessible_projects.py +1111 -0
- sibyld-1.0.0rc1/tests/test_settings_api_key_loading.py +192 -0
- sibyld-1.0.0rc1/tests/test_settings_routes.py +112 -0
- sibyld-1.0.0rc1/tests/test_settings_service.py +157 -0
- sibyld-1.0.0rc1/tests/test_setup_routes.py +233 -0
- sibyld-1.0.0rc1/tests/test_silent_refresh.py +159 -0
- sibyld-1.0.0rc1/tests/test_source_recovery.py +378 -0
- sibyld-1.0.0rc1/tests/test_surreal_auth_persistence.py +510 -0
- sibyld-1.0.0rc1/tests/test_surreal_auth_runtime.py +2954 -0
- sibyld-1.0.0rc1/tests/test_surreal_content_persistence.py +1056 -0
- sibyld-1.0.0rc1/tests/test_surreal_live_runtime.py +55 -0
- sibyld-1.0.0rc1/tests/test_surreal_runtime_startup.py +141 -0
- sibyld-1.0.0rc1/tests/test_surreal_setup.py +309 -0
- sibyld-1.0.0rc1/tests/test_tasks_dependencies.py +991 -0
- sibyld-1.0.0rc1/tests/test_tasks_estimation.py +192 -0
- sibyld-1.0.0rc1/tests/test_tasks_manager.py +749 -0
- sibyld-1.0.0rc1/tests/test_tasks_workflow.py +847 -0
- sibyld-1.0.0rc1/tests/test_telemetry_routes.py +133 -0
- sibyld-1.0.0rc1/tests/test_tools_core.py +895 -0
- sibyld-1.0.0rc1/tests/test_tools_manage.py +985 -0
- sibyld-1.0.0rc1/tests/test_users_routes.py +270 -0
- 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
|
sibyld-1.0.0rc1/PKG-INFO
ADDED
|
@@ -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.
|