Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/gemma-example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Gemma example

# Runs the offline tests for examples/gemma_ollama. They use a scripted Ollama
# server and the real Joltrin vector store and verify barrier, so no model is
# needed. The live test against gemma3:4b is skipped unless JOLTRIN_OLLAMA_LIVE=1.
# Not a required check, so it can use a path filter.
on:
pull_request:
paths:
- 'examples/gemma_ollama/**'
- 'verify/**'
- 'ai/vector/**'
- 'ai/embed/ollama.go'
- '.github/workflows/gemma-example.yml'

permissions:
contents: read

jobs:
gemma-ollama:
name: Gemma agent loop, offline
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v7
with:
go-version-file: 'go.mod'
cache: true

- run: go vet ./examples/gemma_ollama

- run: go test ./examples/gemma_ollama -race -count=1 -v
7 changes: 7 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ A LangGraph `StateGraph` that calls the verification barrier through `sop-mcp-se
- **Models**: Claude through `langchain-anthropic` when `ANTHROPIC_API_KEY` is set, otherwise a scripted policy (not an LLM) so it runs offline.
- **Check**: `python examples/langgraph_agent/test_agent.py`

### 8. Local agent with Gemma over Ollama (`gemma_ollama`)
Gemma (`gemma3:4b`) proposes actions and `embeddinggemma` provides the vectors. Joltrin retrieves context from an embedded vector store, runs the verification barrier, and commits each accepted action in a transaction. Everything stays in one Go process with no remote database.
- **Key Feature**: app-level schema check, then `verify.Workflow.CheckSafety`, then an ACID commit. A model that asks to publish before a human approval is blocked on every attempt and writes nothing.
- **Why**: Small open-weight models send malformed or out-of-order actions. Splitting payload validation (app code) from ordering rules (the barrier) keeps each layer simple.
- **Run**: `ollama pull gemma3:4b && ollama pull embeddinggemma`, then `go run ./examples/gemma_ollama`
- **Check**: `go test ./examples/gemma_ollama` (offline). Add `JOLTRIN_OLLAMA_LIVE=1 -run TestLiveGemma` to run against your local Ollama.

---

## ▶️ Running the Examples
Expand Down
Loading
Loading