How sanskarpan/keel works
Keel is an early-stage, tenant-isolated backend for AI-assisted supplier onboarding and purchase-order orchestration; the README says the role dispatcher currently fails closed until a runtime role is registered. The documented product journey covers supplier invitation and evidence intake, reviewed supplier cases and approvals, then purchase-order workflows, with retrieval and AI capabilities supporting document work. The graph combines those documented stages with source-index-supported calls and storage; unsampled subsystems are included only at directory level, and their links are omitted or marked unverified.
Main entry points: queue.go Inference queue · main.go Role entry point · handler.go Supplier intake API · repository.go Case and evidence store
Components 25
Runtime foundation
- Role entry point
cmd/keel/main.go - Runtime config
internal/platform/config/config.go - Role dispatcher
internal/platform/runtime/dispatcher.go - Tenant context
internal/platform/tenancy/tenant.go
Supplier onboarding
- Supplier intake API
internal/supplier/intake/httpapi/handler.go - Intake service
internal/supplier/intake/service.go - Invitation and upload store
internal/supplier/intake/postgres/repository.go - Supplier case API
internal/supplier/cases/httpapi/handler.go - Case workflow
internal/supplier/cases/model.go - Case and evidence store
internal/supplier/cases/postgres/repository.go - Case effect dispatch
internal/supplier/caseeffects/dispatcher.go
Purchase orders
- Order read API
internal/orders/httpapi/handler.go - Order state
internal/orders/model.go - Order event store
internal/orders/postgres/repository.go - Order projector
internal/orders/projector/projector.go - Kafka relay
internal/platform/kafkarelay/consumer.go
Retrieval and erasure
- Hybrid retrieval
internal/retrieval/hybrid/fusion.go - Index repository
internal/retrieval/postgres/repository.go - Erasure worker
internal/retrieval/erasureworker/runtime.go
AI governance
- Inference queue
internal/ai/queue/queue.go - AI budget store
internal/ai/budget/repository.go - AI policy
internal/ai/policy/policy.go - Context and replay
internal/ai/contextvault/replay/service.go - Context erasure
internal/ai/contextvault/erasureworker/runtime.go
Other components
- Operator or supplier
Connections 21
- Operator or supplier → Role entry point: starts process
cmd/keel/main.go - Role entry point → Runtime config: loads config
cmd/keel/main.go - Role entry point → Role dispatcher: dispatches role
cmd/keel/main.go - Operator or supplier → Supplier intake API: submits intake
internal/supplier/intake/httpapi/handler.go - Supplier intake API → Invitation and upload store: persists invitations
internal/supplier/intake/httpapi/handler.go - Supplier intake API → Intake service: uses intake rules
internal/supplier/intake/httpapi/handler.go - Operator or supplier → Supplier case API: reviews case
internal/supplier/cases/httpapi/handler.go - Supplier case API → Case and evidence store: reads and writes
internal/supplier/cases/httpapi/handler.go - Case and evidence store → Case workflow: applies transitions
internal/supplier/cases/postgres/repository.go - Case and evidence store → Case effect dispatch: records effect intent
- Operator or supplier → Order read API: views orders
internal/orders/httpapi/handler.go - Order read API → Order event store: reads order data
internal/orders/httpapi/handler.go - Order event store → Order state: creates and replays
internal/orders/postgres/repository.go - Order event store → Order projector: publishes events
- Kafka relay → Order projector: dispatches events
internal/platform/kafkarelay/consumer.go - Hybrid retrieval → Index repository: queries index
- Erasure worker → Index repository: processes erasures
internal/retrieval/erasureworker/runtime.go - Inference queue → AI budget store: checks budget
internal/ai/queue/queue.go - Inference queue → AI policy: applies policy
- Inference queue → Context and replay: uses context
- Context erasure → Context and replay: erases context