Skip to content

Commit a3f48a1

Browse files
authored
feat: add Local RAG Factory workflow (#19)
* feat: add local RAG factory showcase * fix: use structured RAG activity commands
1 parent ae72e0a commit a3f48a1

14 files changed

Lines changed: 170 additions & 0 deletions

File tree

‎generative-ai/local-rag/.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
outputs/
2+

‎generative-ai/local-rag/README.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Local RAG Factory
2+
3+
A network-free retrieval-augmented generation pipeline. It normalizes a local
4+
Markdown knowledge base, chunks documents, builds a hashed TF-IDF vector index,
5+
retrieves evidence for a benchmark question set, and produces grounded answers
6+
with citations. The deterministic extractive generator is useful for CI; an
7+
Ollama adapter can be added without changing the workflow boundaries.
8+
9+
Run `./run.sh`. The corpus and evaluation questions are versioned under `data/`.
10+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Environments
2+
An AkôFlow environment describes where work may execute. Local, SSH, Slurm,
3+
Kubernetes and cloud targets expose capabilities through runtime resources.
4+
Environment versions keep old plans reproducible when infrastructure changes.
5+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Planning
2+
A workflow defines dependencies without fixing an execution location. A plan
3+
maps each activity to compatible resources and estimates time, transfer cost
4+
and queue delays. The same workflow may compare multiple scheduling plans.
5+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Provenance
2+
AkôFlow records activities, generated entities and responsible agents. The
3+
lineage graph follows W3C PROV relationships such as used, wasGeneratedBy and
4+
wasAssociatedWith. Artifact hashes make outputs verifiable.
5+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[
2+
{"question": "Why are environment versions useful?", "expected": "reproducible"},
3+
{"question": "Which standard describes the lineage graph?", "expected": "W3C PROV"},
4+
{"question": "What does a plan map to resources?", "expected": "activity"}
5+
]
6+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM python:3.12-slim
2+
WORKDIR /app
3+
COPY data /app/data
4+
COPY scripts/pipeline.py /app/scripts/pipeline.py
5+
ENTRYPOINT ["python", "/app/scripts/pipeline.py"]
6+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
id: local-rag-factory-environment
2+
name: Local RAG Factory environment
3+
driver: local
4+
runtimes: [{id: local, type: local, containerRuntime: docker}]
5+
resources: [{id: workstation, runtimeId: local, cpuCores: 4, memoryBytes: 4294967296}]
6+

‎generative-ai/local-rag/run.sh‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
set -eu
3+
root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd);rm -rf "$root/outputs"
4+
python3 "$root/scripts/pipeline.py" --stage all --output "$root/outputs";"$root/validate.sh"
5+

‎generative-ai/local-rag/scope.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
id: local-rag-factory-scope
2+
name: Local RAG Factory scope
3+
environmentVersionIds: [local-rag-factory-v1]
4+

0 commit comments

Comments
 (0)