Back to gallery

Syntax-aware Code Chunking

Turn source code in 306 languages into structure-aware chunks — ready to embed for code search, assistants, and RAG.

Extract
document → structured outputextract()
parser.py
def extract(doc):
return parse(doc)
class Reader:
# 306 formats
{
"functions": 12,
"classes": 3
}

Feed code to an LLM as plain text and a naive splitter cuts on token count — handing the model half a function, an import torn from its body, a class split down the middle.

Xberg parses code with tree-sitter across 306 languages and splits on the syntax tree instead of token counts. Every chunk stays a coherent unit and carries its enclosing symbol — ready to embed for code search, assistants, and RAG.

Open-source primitives, composed into one backend. Curated cohort of design partners. Apply to work with us.

Cookies

We value your privacy

Xberg uses cookies to improve your experience, personalize content, and analyze traffic. You can manage your preferences at any time.