Discover Packages
github.com/bzdvdn/draftrag
examples
memory
command
Version:
v1.0.0
Opens a new window with list of versions in this module.
Published: Jul 14, 2026
License: Apache-2.0
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
README
¶
Memory example
In-memory RAG example based on Go documentation. Does not require Docker or external services.
Quick start
cd examples/memory && cp .env.example .env && go run .
Environment variables
Basic (from .env.example):
Variable
Default
Description
LLM_PROVIDER
mock
LLM provider (mock, ollama, openai, anthropic)
EMBEDDING_DIM
1536
Embedding dimension
For a real LLM (ollama/openai/anthropic), additional variables are required — see examples/shared/config.go .
What the example does
Creates an in-memory vector store
Indexes 10 documents about Go (goroutines, channels, context, interfaces, etc.)
Asks the question "What is a goroutine?"
Outputs the answer with sources
Requirements
Go 1.21+
For LLM_PROVIDER=mock — nothing else needed
For LLM_PROVIDER=ollama — running Ollama with models
For LLM_PROVIDER=openai — OPENAI_API_KEY
For LLM_PROVIDER=anthropic — ANTHROPIC_API_KEY
Expand ▾
Collapse ▴
Documentation
¶
@sk-task docs-and-examples#T2.1: memory example — in-memory RAG на Go-документации (AC-006).
Без Docker, использует публичный API draftrag + shared/mock.
Быстрый старт:
cd examples/memory && cp .env.example .env && go run .
Source Files
¶
Click to show internal directories.
Click to hide internal directories.