Skip to content

localgpt-app/localgpt-go-experiment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LocalGPT (Go)

Go port of LocalGPT — a local AI assistant with persistent memory, autonomous heartbeat tasks, and full-text search.

Status

Experimental — feature-complete port of the Rust version (minus desktop GUI). Same config format, same session format (JSONL), same workspace layout.

Features

  • CLI interactive chat with readline support
  • Single-question mode (ask)
  • Daemon mode with HTTP server, WebSocket, embedded web UI
  • Autonomous heartbeat task runner
  • Persistent memory with SQLite FTS5 full-text search
  • Multi-provider LLM support (OpenAI, Anthropic, Ollama, Claude CLI)
  • JSONL session persistence (OpenClaw-compatible)
  • 7 built-in tools (bash, read_file, write_file, edit_file, memory_search, memory_get, web_fetch)
  • Skills system (OpenClaw-compatible SKILL.md format)
  • Prompt injection sanitization
  • Cross-process workspace locking
  • Context compaction with automatic summarization

Build

# Requires Go 1.23+ and CGo (for SQLite)
go build -o localgpt ./cmd/localgpt

# Or install directly
go install github.com/localgpt-app/localgpt-go/cmd/localgpt@latest

Usage

# Initialize config
localgpt config init

# Interactive chat
localgpt chat

# Single question
localgpt ask "What is the meaning of life?"

# Run daemon (HTTP server + heartbeat)
localgpt daemon start --foreground

# Memory operations
localgpt memory search "query"
localgpt memory reindex
localgpt memory stats

Configuration

Uses the same ~/.localgpt/config.toml as the Rust version:

[agent]
default_model = "claude-cli/opus"

[providers.anthropic]
api_key = "${ANTHROPIC_API_KEY}"

[heartbeat]
enabled = true
interval = "30m"

Architecture

cmd/localgpt/          CLI entry point (cobra)
internal/
  agent/               Agent core, session management, tool execution
  config/              TOML config, env var expansion, workspace resolution
  concurrency/         Cross-process workspace lock, in-process turn gate
  heartbeat/           Autonomous task runner
  memory/              SQLite FTS5 index, file watcher, workspace management
  provider/            LLM providers (OpenAI, Anthropic, Ollama, Claude CLI)
  sanitize/            Prompt injection defense, content delimiters
  server/              HTTP server, WebSocket, embedded web UI
  session/             JSONL session persistence, token counting
  skills/              Skill loading and invocation
  tools/               Built-in tool implementations

Differences from Rust Version

Feature Rust Go
Desktop GUI (egui) Yes (optional) No
Semantic search (fastembed/ONNX) Yes Not yet
sqlite-vec Yes Not yet
Binary size ~27MB TBD
Daemon forking Unix fork Foreground only

License

[Apache-2.0]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors