Skip to main content
Glean Logo

Glean

System for collecting, deriving and querying facts about source code

What is Glean?

Glean is an open-source code indexing system that stores typed, schema-defined facts about source code in a queryable database. Facts cover definitions, references, types, call relationships, inheritance, imports, and more. Facts can be queried with Angle, a Datalog-style query language. They are produced by indexers for languages including C++, Hack, Python, Haskell, and Flow, plus LSIF/SCIP support for Go, Java, Rust, and TypeScript.

Use Glean when you need precise, semantic answers about code rather than text-based guesses. Typical questions Glean answers directly:

  • “Where is this symbol defined?”
  • “Who calls this function?”
  • “What implements this interface?”
  • “What does this type alias resolve to?”
  • “What are the transitive dependencies of this module?”

Coding agents, IDEs, and developer tools query Glean instead of relying on grep when they need accuracy, cross-file/cross-language reasoning, or large-scale code analysis.

Key Features

Semantic code graph

Definitions, references, call graphs, type hierarchies, and cross-language links — not text matching.

Multi-language

Indexers for C++, Hack, Python, Haskell, Flow, .NET, Go, Java, Rust, and TypeScript.

Built for scale

Compact, incremental storage designed to index monorepos with billions of facts.

Angle query language

A typed, declarative query language for composing precise questions over the code graph.

Agent- and tool-friendly

Query via CLI, language-specific APIs or Thrift — ideal for IDEs, code review bots, refactoring tools, LLM coding agents, and more.

Extensible schemas

Define your own predicates to capture domain-specific facts about your language or codebase.

When to use Glean

  • Code navigation: jump-to-definition, find references, call hierarchy, type hierarchy.
  • Refactoring & migrations: find every callsite, every implementer, every override across a monorepo.
  • Code search agents & LLMs: ground answers in real symbol relationships instead of grep heuristics.
  • Dependency analysis: module/file/symbol-level dependency graphs and impact analysis.
  • Code review automation: reason about what a change actually affects.
  • Custom code intelligence: build new tools on top of a uniform, language-agnostic fact store.