Skip to content

🧠 Feature: Code-aware embedding with AST chunking #245

Closed

Description

@ajianaz

Feature: Code-Aware Embedding (AST Chunking)

Problem

Current embedding treats content as flat text. Code-specific structures (functions, classes, imports, control flow) are not represented in the embedding, leading to lower quality recall for code-related memories.

Proposed Solution

Add an AST-aware chunking pipeline that:

  1. Parses code into AST nodes (functions, structs, impls, classes)
  2. Chunks by semantic boundary (function body, class definition) instead of fixed token count
  3. Adds code-specific metadata (language, symbol type, imports) to each chunk

Why v0.2.0

Depends on pluggable embedding models (#249) — code-aware chunking may need a different embedding strategy than natural language. Must have model flexibility first.

Priority Chain

v0.0.12: FTS5 hybrid (#250) + Metadata (#251) + Threshold (#252)
v0.1.0:  Pluggable models (#249) + Graph (#246) + MCP (#248)
v0.2.0:  This issue — AST chunking builds on all above

Implementation

  • Add tree-sitter or tree-sitter bindings for multi-language AST parsing
  • New chunker: uteke-core/src/chunker/ast.rs
  • Config: chunking.strategy = "ast" or "fixed" (default)
  • Metadata enrichment: language, symbol_type, symbol_name, imports

Languages (Priority Order)

  1. Rust (dogfooding)
  2. Go (Bond, Mikrodius)
  3. TypeScript/Svelte (frontend projects)
  4. Python (scripts, data)
  5. Dart/Flutter (Usago)

Acceptance Criteria

  • AST chunking for Rust files (functions, structs, impls, traits)
  • Metadata includes language, symbol type, symbol name
  • Config toggle: ast vs fixed chunking
  • Recall quality improvement measurable vs fixed chunking
  • Graceful fallback to fixed chunking for unsupported languages

Activity

  1. reopened this on Jun 9, 2026
  2. added
    v0.2.0
    type:feature
    enhancement
    and removed
    type:feature
    on Jun 9, 2026
  3. added this to the milestone on Jun 11, 2026
  4. added
    epic:code-intelligence
    status:in-progress
    on Jun 13, 2026
  5. added a commit that references this issue on Jun 14, 2026
  6. added a commit that references this issue on Jul 2, 2026
  7. added 2 commits that reference this issue on Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementepic:code-intelligencepriority:mediumscope:corestatus:in-progressv0.2.0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions