Sibyl daemon - knowledge graph and task workflow server
Project description
Sibyl API Server
sibyld is the FastAPI + FastMCP server behind Sibyl's knowledge graph, agent memory loop, task
workflow, search, synthesis, and real-time updates.
Quick Reference
# Install the embedded daemon without the web UI
curl -fsSL https://raw.githubusercontent.com/hyperb1iss/sibyl/main/install.sh | sh -s -- --daemon
# Start server from the monorepo
moon run api:serve # or: uv run sibyld serve
# Start worker (Redis coordination only)
moon run api:worker # or: uv run sibyld worker
# Quality checks
moon run api:test # Run tests
moon run api:lint # Lint
moon run api:typecheck # Type check
What's Here
- MCP Server: eleven tools for search, context packs, exploration, capture, memory, synthesis, and management
- REST API: 29 routers covering entities, tasks, projects, memory, synthesis, sources, auth, settings, and admin
- Auth System: JWT sessions, GitHub OAuth, API keys with scopes, MCP OAuth clients, RBAC, SMTP-backed password reset
- Background Jobs: in-process local runtime or Redis-backed
arqworkers, including the nightly reflection dream-cycle - WebSocket: Real-time updates for entities and tasks
Architecture
Sibyl API (port 3334)
├── /api/* → FastAPI REST endpoints
├── /api/openapi.json → OpenAPI schema
├── /mcp → MCP server (streamable-http, 11 tools)
├── /api/ws → WebSocket for real-time updates
└── Lifespan → Background jobs + coordination broker
Key Directories
| Directory | Purpose |
|---|---|
api/routes/ |
REST endpoints (29 routers: tasks, entities, memory, synthesis, crawler, ingestion, auth, admin) |
ai/ |
DB-backed LLM settings, model validation routes, runtime invalidation |
auth/ |
JWT, sessions, API keys, RBAC, MCP OAuth clients |
persistence/ |
SurrealDB-native runtimes for auth, content, graph, and backups |
crawler/ |
Documentation crawl and ingestion pipeline |
ingestion/ |
Source import pipeline (mailbox and other adapters) |
jobs/ |
Background jobs (reflection dream-cycle, crawl, backups) |
coordination/ |
Local and Redis brokers for jobs, locks, and pub/sub |
email/ |
Transactional email delivery |
generator/ |
Synthetic test-data generation |
Configuration
Required:
SIBYL_JWT_SECRET=... # Auth (required in production; dev auto-generates)
SIBYL_ANTHROPIC_API_KEY=... # Required when LLM provider=anthropic
# SIBYL_OPENAI_API_KEY=sk-... # Required when LLM provider=openai
# SIBYL_GEMINI_API_KEY=... # Required when LLM provider=gemini
# Embeddings: choose OpenAI or Gemini
SIBYL_EMBEDDING_PROVIDER=openai # openai | gemini
SIBYL_OPENAI_API_KEY=sk-... # Required when embedding provider=openai
# SIBYL_GEMINI_API_KEY=... # Required when embedding provider=gemini
Optional:
SIBYL_STORE=surreal # default; legacy is migration/source-side only
SIBYL_COORDINATION_BACKEND=auto # auto | local | redis
SIBYL_SURREAL_URL=ws://127.0.0.1:8000/rpc
SIBYL_SURREAL_USERNAME=root
SIBYL_SURREAL_PASSWORD=root
SIBYL_REDIS_HOST=127.0.0.1 # only needed for Redis coordination
SIBYL_REDIS_PORT=6381
SIBYL_LLM_PROVIDER=anthropic # anthropic | openai
SIBYL_LLM_MODEL=claude-haiku-4-5
SIBYL_LLM_CRAWLER_MODEL=claude-haiku-4-5
SIBYL_LLM_SYNTHESIS_MODEL=claude-sonnet-4-6
SIBYL_LLM_TEMPERATURE=0
SIBYL_LLM_TIMEOUT_SECONDS=60
SIBYL_EMBEDDING_MODEL=text-embedding-3-small
SIBYL_EMBEDDING_DIMENSIONS=1536
SIBYL_GRAPH_EMBEDDING_PROVIDER=openai
SIBYL_GRAPH_EMBEDDING_MODEL=text-embedding-3-small
SIBYL_GRAPH_EMBEDDING_DIMENSIONS=1024
PostgreSQL settings are only for historical archive rehearsal commands that explicitly restore a
retained postgres.sql payload against an operator-managed database. They are not part of default
Surreal runtime startup.
Gemini keys can also be supplied through GEMINI_API_KEY or GOOGLE_API_KEY. Changing embedding
provider, model, or dimensions changes vector spaces; re-crawl sources and rebuild graph indexes
before mixing old and new search results.
LLM settings are instance-wide. Environment variables win over database settings field by field;
env-backed fields return 409 LOCKED_BY_ENV on write. Database settings are managed under:
GET /api/settings/ai/llm
PUT /api/settings/ai/llm/{surface}
POST /api/settings/ai/llm/{surface}/test
POST /api/settings/ai/keys/{provider}/test
POST /api/settings/ai/models/{model_alias}/test
GET /api/settings/ai/registry?kind=llm
Crawler extraction and synthesis generation call sibyl_core.ai rather than provider SDKs directly.
Custom model IDs are accepted as database settings with an unverified_model warning; validate them
with the model test endpoint before using them in production flows.
CLI Commands
sibyld serve # Start the HTTP server
sibyld serve -t stdio # Start a stdio server (MCP subprocess mode)
sibyld worker # Start the job worker (local mode exits cleanly)
sibyld up # Start data services + API
sibyld down # Stop all services
sibyld db backup # Back up the graph database
sibyld migrate import ... # Import a migration archive
sibyld generate realistic # Generate sample data
Runtime Modes
For single-machine Surreal development, run sibyld serve or sibyld up with
SIBYL_STORE=surreal. The default coordination_backend=auto resolves to local, so background
jobs, pending state, locks, pub/sub, and schedules all stay in-process with no Redis requirement.
Redis remains available for distributed or multi-process dev. Set SIBYL_COORDINATION_BACKEND=redis
when you want the arq worker model, then run sibyld worker or moon run api:worker separately.
Key Patterns
Multi-tenancy: Every operation requires org context.
manager = EntityManager(client, group_id=str(org.id))
Write concurrency: the SurrealDB driver serializes WebSocket operations per client. Clone graph drivers per organization rather than sharing one driver across org scopes.
SurrealDB access model: The API server, worker, CLI, and schema bootstrap flows use configured
SurrealDB system credentials (SIBYL_SURREAL_USERNAME / SIBYL_SURREAL_PASSWORD) so they can run
migrations, background jobs, and admin workflows. Route code must keep explicit org, project, and
principal predicates because system users sit above table-level permissions.
Auth and content schema migrations also define table permissions for future scoped Surreal record
users. Tenant-owned tables accept rows where organization_id (or organizations.uuid) matches
either $token.org from an external JWT access method or $auth.organization_id from a Surreal
record session. Secret-heavy and global tables, such as API keys, sessions, OAuth tokens, system
settings, and telemetry rollups, remain PERMISSIONS NONE for direct scoped DB access.
Request context: Auth middleware injects user and org.
from sibyl.auth.dependencies import get_current_user, get_current_organization
Dependencies
Depends on sibyl-core for models, graph client, AI substrate, and tool implementations.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sibyld-1.0.0rc8.tar.gz.
File metadata
- Download URL: sibyld-1.0.0rc8.tar.gz
- Upload date:
- Size: 781.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39da93ded1a99f415a5dce9357ae5796242aad0ac66cd8ff42269a9ca0e1a14c
|
|
| MD5 |
b8c94d539a6af63c5149d1343f5c6c37
|
|
| BLAKE2b-256 |
da63951872c981ab387c9154de995237ec8e207266a7886bac60268ef717ad8d
|
Provenance
The following attestation bundles were made for sibyld-1.0.0rc8.tar.gz:
Publisher:
publish.yml on hyperb1iss/sibyl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sibyld-1.0.0rc8.tar.gz -
Subject digest:
39da93ded1a99f415a5dce9357ae5796242aad0ac66cd8ff42269a9ca0e1a14c - Sigstore transparency entry: 1948703037
- Sigstore integration time:
-
Permalink:
hyperb1iss/sibyl@779a9347c81e5be1377e6675e4b702e8533ab980 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/hyperb1iss
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@779a9347c81e5be1377e6675e4b702e8533ab980 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file sibyld-1.0.0rc8-py3-none-any.whl.
File metadata
- Download URL: sibyld-1.0.0rc8-py3-none-any.whl
- Upload date:
- Size: 586.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7bbd24cd9f1a100499f337d8203a8146ce3c9d21b8f14bc9c47c8d9759f303d
|
|
| MD5 |
c7e40f862b49f163b2c43aaa4177b0c1
|
|
| BLAKE2b-256 |
d18c886a5d4e7984ecdce5af134d206ecdd2b00c02f699ea6dc7b623956825d4
|
Provenance
The following attestation bundles were made for sibyld-1.0.0rc8-py3-none-any.whl:
Publisher:
publish.yml on hyperb1iss/sibyl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sibyld-1.0.0rc8-py3-none-any.whl -
Subject digest:
a7bbd24cd9f1a100499f337d8203a8146ce3c9d21b8f14bc9c47c8d9759f303d - Sigstore transparency entry: 1948703614
- Sigstore integration time:
-
Permalink:
hyperb1iss/sibyl@779a9347c81e5be1377e6675e4b702e8533ab980 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/hyperb1iss
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@779a9347c81e5be1377e6675e4b702e8533ab980 -
Trigger Event:
workflow_dispatch
-
Statement type: