Awesome Go

gleann

CategoryArtificial Intelligence
SubcategoryArtificial Intelligence
Stars48

Local vector search engine, codebase intelligence graph, and persistent memory with MCP support

About gleann

gleann

CI Mentioned in Awesome Go License: MIT Go Reference codecov

High-performance local AI workspace, codebase intelligence, and persistent cross-session memory for AI coding agents and terminal power users.

Single Go binary (~34MB). Zero Python virtual environments, zero Docker required. Everything runs locally on your machine.


Gleann terminal demo — index AI docs, semantic search, RAG Q&A, long-term memory, MCP setup


⚡ Quick Start (60 Seconds)

1. Install Gleann

# Go install (Recommended)
go install github.com/tevfik/gleann/cmd/gleann@latest

# Or One-Liner (Linux & macOS) — installs the lite build
curl -sSfL https://raw.githubusercontent.com/tevfik/gleann/main/scripts/install.sh | sh

# With bitllm.c local embeddings, FAISS and the tree-sitter parsers
curl -sSfL https://raw.githubusercontent.com/tevfik/gleann/main/scripts/install.sh | GLEANN_VARIANT=full sh
GLEANN_VARIANTIncludesPlatforms
lite (default)pure Go, with the code graph (Go calls; declarations for other languages); no bitllm.c, FAISS or tree-sitterall
eif+ bitllm.c local embeddings (EIF runtime)linux-amd64, linux-arm64, darwin-arm64
full+ bitllm.c, FAISS, tree-sitter parsers (call graph of non-Go languages)linux-amd64, linux-arm64, darwin-arm64

Later, update gleann and its plugins from the latest GitHub release:

gleann update --check   # is a newer release available?
gleann update           # replace this binary (checksum-verified when the release has SHA256SUMS)
gleann plugin update    # update installed plugins (e.g. docs) the same way

2. Index Your Codebase or Documents

# Index a codebase with AST call-graph intelligence
gleann index build my-code --docs ./src --graph

# Index documents, PDFs, or Markdown notes
gleann index build my-docs --docs ./documents

3. Connect to Your AI Editors & Agents

# Auto-configure all detected AI tools (Cursor, Claude Code, Windsurf, Zed, etc.)
gleann install

Now ask questions, search semantically, or let your AI editor use Gleann over MCP:

# Semantic search
gleann search my-code "auth middleware rate limiting"

# RAG Q&A directly in your terminal
gleann ask my-code "How are database migrations handled?"

🎯 What Do You Want to Do?

Choose your workflow to see how Gleann accelerates your engineering:

🤖 1. Supercharge Your AI Agent / Editor (MCP & A2A)

Connect Gleann directly to Claude Code, Cursor, Windsurf, Cline, Zed, JetBrains, or Neovim.

  • 1-Click Setup: Run gleann install to automatically register the Model Context Protocol (MCP) server across 17+ AI platforms.
  • Context Field Theory (Φ Scoring): Dynamic re-ranking prioritizes recency, frequency, and code proximity.
  • Shell Output Compression: 95+ regex patterns collapse verbose Git, Go, NPM, and Docker logs before they reach the LLM context window.
  • Token Gain Tracking: gleann_gain reports the tokens saved by gleann_shell and gleann_read since the MCP server started.
  • 👉 Read the MCP Setup Guide & Agent Integration.

🧠 2. Deep Code Intelligence & Blast Radius

Vector search alone misses function calls, callers, and dependencies. Gleann combines vector search with an AST code graph stored in the index's own SQLite database (every build, including the pure-Go one).

  • AST Chunking: Tree-sitter partitions functions, structs, and interfaces cleanly at syntax boundaries.
  • Call-Graph Traversal: Discover callers and callees with gleann graph callers <symbol>.
  • Blast Radius Analysis: Trace upstream impact before making breaking changes with gleann graph explain <symbol>.
  • 👉 Read the Code Graph Guide & Tree-sitter Details.

📄 3. Technical Documents, PDFs & Tables

Extract complex multi-page documents, PDFs, and spreadsheets without losing table structure.

  • Table-Aware Chunker: Preserves Markdown tables atomically or splits rows while replicating headers across sub-chunks.
  • Docling BitNet Vision (bitllm.c): In-process IBM Docling BitNet 1.58-bit VLM for scanned/raster PDFs and diagrams.
  • Pure-Go Fast Path: Digital PDFs and DOCX files extract in milliseconds without Python overhead.
  • 👉 Read the Hierarchical GraphRAG Guide & Plugin Architecture.

💾 4. Persistent Long-Term Memory (Across Sessions)

Give your AI coding assistant institutional memory that survives terminal restarts.

  • Tiered Memory: Short (session state), Medium (sprints/TODOs), and Long (permanent architectural decisions).
  • Auto-Injection: Relevant memories are automatically injected into every prompt.
  • CLI Commands:
    gleann memory remember "Database migrations must always use snake_case" --tag convention
    gleann memory search "architecture"
    gleann memory context
    
  • 👉 Read the Memory Engine Guide.

🖥️ 5. Terminal RAG & Interactive Chat

Work directly from your shell without leaving the keyboard.

  • Interactive Chat: Multi-turn conversations with streaming, cancellation, collapsible reasoning and source cards (gleann chat my-code). /index picks which indexes and tags to search, @symbol attaches a definition from the code graph. --classic selects the old interface.
  • Pipe Support: Send compiler logs or diffs directly into Gleann (git diff | gleann ask my-code "Review changes").
  • Multi-Index Fan-Out: Query documentation and source code simultaneously (gleann ask docs,code "How does auth work?").
  • 👉 Read the Cookbook.

🧩 Supported AI Tools & Platforms

Running gleann install auto-detects and installs configuration for:

PlatformIntegration TypeSupported Features
Claude CodeSessionStart Hook + CLAUDE.mdMCP Tools + Auto Memory Injection
Cursor.cursor/rules + MCP ConfigSemantic Code Search + Full Documents
Windsurf.windsurf/rules + MCP ConfigGraph Traversal + Impact Analysis
Cline / Roo Code.clinerules + MCP ConfigFile Maps + AST Breadcrumbs
Zedsettings.json MCPFast Codebase Retrieval
NeovimAvante / CodeCompanion MCPIn-editor RAG & Context
JetBrains.junie/guidelines.md + MCPMulti-Index Knowledge Retrieval
Gemini CLI / CodexAgent Hooks + ConfigShell Compression + Token Gain
Aider / OpenClawSkills + System PromptLong-Term Memory Recall

🛠️ Essential Command Reference

Index Management

gleann index build my-code --docs ./src --graph   # Index source code with call graph
gleann index build my-docs --docs ./docs          # Index technical documentation
gleann index list                                 # List all indexes, status, and tags
gleann index migrate my-docs                      # Convert an index built by gleann v1.9 or earlier (see docs/releases/v1.20.0.md)
gleann index watch my-code --docs ./src --graph   # Auto-sync index on file changes

Search & RAG

gleann search my-code "connection pool timeout"           # Fast semantic search
gleann search my-code "connection pool timeout" --rerank  # Search with cross-encoder reranking
gleann ask my-code "Explain how auth tokens are verified" # RAG Q&A with local/cloud LLM
gleann ask docs,code "How to configure SSL?"              # Multi-index federated query

Code Graph & Impact

gleann graph callers "HandleRequest" --index my-code      # Find all callers of a symbol
gleann graph deps "HandleRequest" --index my-code         # Downstream dependencies
gleann graph explain "HandleRequest" --index my-code      # Full blast radius context

Memory & MCP

gleann memory remember "JWT secrets are rotated every 90 days"
gleann memory search "rotation"
gleann install                 # Auto-configure AI editors
gleann token create ci --scope query          # API token for the REST server (gleann serve prints the admin token path)
gleann index storage           # Show / switch vector storage (store | recompute)
gleann mcp                     # Launch stdio MCP server

Utilities

gleann completion bash         # Generate shell completion (bash, zsh, fish)
gleann tokens ./src            # Estimate token consumption across read modes

🧭 Feature Status

gleann covers a lot of ground. This table says what is measured in CI on every change and what is still young.

AreaStatusNotes
Index build and sync, hybrid search (HNSW, DiskANN, FTS5), metadata filtersCoreRecall gate (bench/vectordb/gate) and retrieval quality gate (internal/quality) run in CI
Code graph (Go AST; other languages with -tags treesitter)CoreStored in the index's SQLite database
MCP server, CLI, REST APICore
Long-term memory (blocks, tiers, failure memory)CoreRetrieval floor and duplicate merge measured on a small evaluation set
A2A protocolExperimentalSingle-turn tasks only, no streaming; multi-turn is RFC 007
Multimodal (images, audio, video)ExperimentalNeeds an external multimodal model or plugin; not covered by the quality gates
Web UI (gleann serve)ExperimentalSettings, chat and graph views; the CLI and TUI are the main interfaces
FAISS backend (-tags faiss), Rust core (-tags native)Optional buildsNot in the release binaries' default path

Experimental features work, but their interfaces may change between minor versions.


📚 Documentation Deep Dives


🤝 Contributing & License

Contributions are welcome! Please check CONTRIBUTING.md for development setup.

Licensed under the MIT License.

Frequently Asked Questions

What is gleann?

gleann is a Artificial Intelligence library for the Go programming language. Local vector search engine, codebase intelligence graph, and persistent memory with MCP support

How do I install gleann?

Install gleann with the Go module system using `go get tevfik/gleann`. Check the repository for the current installation instructions.

What category does gleann belong to?

gleann is listed under Artificial Intelligence, specifically Artificial Intelligence.

← Back to Artificial Intelligence