Skip to content

feat:Implement Hybrid Search with Call Graph for Better Context Connectivity #33

@BETAER-08

Description

@BETAER-08

Problem

Currently, amdb relies solely on vector similarity search. This leads to context fragmentation, where the AI misses logically connected code (e.g., interface implementations, function callees, parent classes) if they don't share similar keywords. The "God Mode" promise is limited by this lack of structural understanding.

##Proposed Solution

  • Enhance src/core/graph.rs to build a lightweight Call Graph or Symbol Dependency Map during the scanning phase.
  • Modify the search logic (src/core/vector_store.rs) to apply a Hybrid Search algorithm:
    • Step 1: Perform Vector Search to find the top-k relevant chunks.
    • Step 2: Traverse the Graph to find direct dependencies (callees/callers) of those chunks.
    • Step 3: Rerank or include these connected chunks in the final context.

Definition of Done

  • Graph struct implemented to store file/function relationships.
  • Parser updated to extract basic import/call relationships (starting with Rust/TS).
  • Search query returns not just semantically similar files, but also their dependencies.
  • Integration test added: Searching for a function definition also returns the file where it is heavily used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: cliCommand-line interface, arguments, and output formatting.featNew feature or request (e.g., config file, depth control).priority: mediumNormal priority; adds value but not urgent.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions