memory

command
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

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

  1. Creates an in-memory vector store
  2. Indexes 10 documents about Go (goroutines, channels, context, interfaces, etc.)
  3. Asks the question "What is a goroutine?"
  4. 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=openaiOPENAI_API_KEY
  • For LLM_PROVIDER=anthropicANTHROPIC_API_KEY

Documentation

Overview

@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 .

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL