mirror of
https://github.com/Kaelio/ktx.git
synced 2026-07-13 11:22:11 +02:00
Initial open-source release
This commit is contained in:
commit
1a42152e6f
1199 changed files with 257054 additions and 0 deletions
20
examples/local-warehouse/README.md
Normal file
20
examples/local-warehouse/README.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Local Warehouse Example
|
||||
|
||||
This example is a standalone KLO project that can be copied to a temp directory
|
||||
and used with the local CLI and stdio MCP server. It uses the `fake` ingest
|
||||
adapter so it does not require a database or external app server.
|
||||
|
||||
Run the example from the repository root after building the CLI:
|
||||
|
||||
```bash
|
||||
pnpm --filter @klo/cli run build
|
||||
EXAMPLE_DIR="$(mktemp -d)/local-warehouse"
|
||||
cp -R examples/local-warehouse "$EXAMPLE_DIR"
|
||||
node packages/cli/dist/bin.js knowledge list --project-dir "$EXAMPLE_DIR"
|
||||
node packages/cli/dist/bin.js sl list --project-dir "$EXAMPLE_DIR" --connection-id warehouse
|
||||
node packages/cli/dist/bin.js ingest run --project-dir "$EXAMPLE_DIR" --connection-id warehouse --adapter fake --source-dir "$EXAMPLE_DIR/source"
|
||||
```
|
||||
|
||||
The copied project creates its own Git repository on first use. Keep commands
|
||||
pointed at a copy when experimenting so the checked-in example fixture stays
|
||||
unchanged.
|
||||
25
examples/local-warehouse/klo.yaml
Normal file
25
examples/local-warehouse/klo.yaml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
project: local-warehouse
|
||||
connections:
|
||||
warehouse:
|
||||
driver: postgres
|
||||
readonly: true
|
||||
storage:
|
||||
state: sqlite
|
||||
search: sqlite-fts5
|
||||
git:
|
||||
auto_commit: true
|
||||
author: "klo <klo@example.com>"
|
||||
ingest:
|
||||
adapters:
|
||||
- fake
|
||||
- live-database
|
||||
agent:
|
||||
run_research:
|
||||
enabled: false
|
||||
max_iterations: 20
|
||||
default_toolset:
|
||||
- sl_query
|
||||
- knowledge_search
|
||||
- sl_read_source
|
||||
memory:
|
||||
auto_commit: true
|
||||
15
examples/local-warehouse/knowledge/global/revenue.md
Normal file
15
examples/local-warehouse/knowledge/global/revenue.md
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
summary: Paid order value after refunds
|
||||
tags:
|
||||
- finance
|
||||
- orders
|
||||
refs: []
|
||||
sl_refs:
|
||||
- warehouse.orders
|
||||
usage_mode: auto
|
||||
---
|
||||
|
||||
Revenue is paid order amount after refund adjustments.
|
||||
|
||||
Use `orders.total_revenue` for recognized order value and `orders.order_count`
|
||||
for paid order volume.
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
name: orders
|
||||
table: public.orders
|
||||
description: Orders placed through the storefront.
|
||||
grain:
|
||||
- id
|
||||
columns:
|
||||
- name: id
|
||||
type: number
|
||||
- name: status
|
||||
type: string
|
||||
- name: amount
|
||||
type: number
|
||||
measures:
|
||||
- name: order_count
|
||||
expr: count(*)
|
||||
- name: total_revenue
|
||||
expr: sum(amount)
|
||||
joins: []
|
||||
1
examples/local-warehouse/source/orders/orders.json
Normal file
1
examples/local-warehouse/source/orders/orders.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"source":"orders","description":"Example raw file staged by the fake adapter"}
|
||||
Loading…
Add table
Add a link
Reference in a new issue