command
Version:
v0.8.0
Opens a new window with list of versions in this module.
Published: Jul 20, 2026
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Knowledge Sources Example
Demonstrates RAG document ingestion with three source types working together:
- TextFileSource — unstructured text (DraftCrew overview)
- CSVSource — structured tabular data (feature tracker)
- JSONSource — hierarchical data (build metrics)
The agent indexes all three files via draftRAG (Ollama embedder) and answers questions that require knowledge from different sources.
Prerequisites
- Ollama running (default:
http://localhost:11434)
- An embedding model:
ollama pull nomic-embed-text or ollama pull embeddinggemma:300m
- An LLM model:
ollama pull gemma3:4b
Usage
Ollama LLM + Ollama embedder (recommended)
OLLAMA_BASE_URL=http://localhost:11434 \
OLLAMA_MODEL=gemma3:4b \
LLM_EMBED_MODEL=embeddinggemma:300m \
go run main.go
OpenAI LLM + Ollama embedder
OPENAI_API_KEY=sk-... \
LLM_EMBED_MODEL=nomic-embed-text \
go run main.go
Customising the embedder
| Env var |
Default |
Purpose |
LLM_BASE_URL |
http://localhost:11434/v1 |
Embedder API endpoint |
LLM_API_KEY |
ollama |
Embedder API key |
LLM_EMBED_MODEL |
nomic-embed-text |
Embedding model name |
What the agent answers
- Which process types does DraftCrew support? (from txt)
- Which features are done vs pending? (from csv)
- Current version, packages count, test coverage? (from json)
- What RAG engine does it use? (from txt + json)
Notes
- Sources are loaded eagerly at agent init — one shared
Pipeline (embedder + store) for all sources
- Each source is idempotent: calling
Load() twice is a no-op
- If a source file is missing or malformed, the agent logs a warning and continues without it
Documentation
¶
@sk-task knowledge-sources#T4.2: knowledge example
This example demonstrates multiple knowledge source types:
- TextFileSource — unstructured text
- CSVSource — structured tabular data
- JSONSource — hierarchical data
The agent reads all three files, indexes them via draftRAG (Ollama embedder),
and answers questions based on the combined knowledge.
Prerequisites:
- Ollama running at http://localhost:11434
- An embedding model pulled (e.g. nomic-embed-text or embeddinggemma:300m)
- An LLM model pulled for the agent (e.g. gemma3:4b)
Usage (Ollama LLM + Ollama embedder — recommended):
OLLAMA_BASE_URL=http://localhost:11434 \
OLLAMA_MODEL=gemma3:4b \
LLM_EMBED_MODEL=nomic-embed-text \
go run main.go
Usage (OpenAI LLM + Ollama embedder):
OPENAI_API_KEY=sk-... \
LLM_EMBED_MODEL=nomic-embed-text \
go run main.go
Source Files
¶
Click to show internal directories.
Click to hide internal directories.