Skip to content

[Bug]: query only matches names, so code whose body has the question's words is never found #5051

Open

Description

@rohit-jsfreaky

Pre-flight checks

  • I have checked the Troubleshooting section in the README

What happened?

graphify query only matches the question against node names and labels. Agents ask the way issues are written ("credit history transactions"), and the function that does the work is often named something else (Ledger.entries). Its body has every word of the question, but the body is never looked at. So the answer is the tests and docs that happen to have the words in their names, and the agent gives up on the graph and greps.

On SWE-bench Lite + Verified (293 questions, the gold file is the one the fix touched), 0.9.102 has the gold file in the top 5 answers for 61% of the 179 non-Django questions and 65% of the 116 Verified questions. Plain BM25 over whole files gets 67%, at about 20x the tokens to read.

This is a follow-up to #4983 (#4982, shipped in 0.9.102), which ranks source above tests and docs. That helps once the code is a candidate, but here the code never becomes one.

Steps to reproduce

app/ledger.py

class Ledger:
    def entries(self, account_id, limit=50):
        """Return the newest rows for an account."""
        rows = self.db.select("credit_transactions", account=account_id)
        # history page shows refunds and top-ups together
        return sorted(rows, key=lambda r: r.created_at, reverse=True)[:limit]

app/routes.py

from app.ledger import Ledger

def get_rows(request):
    return Ledger().entries(request.user.account_id)

tests/test_history.py

def test_credit_history_page_lists_transactions():
    assert True

def credit_history_fixture():
    return []

docs/credit-history.md

# Credit history

The credit history page lists transactions.

Then graphify update . and graphify query "credit history transactions".

Error output or graph output

Start: ['Credit history', 'credit-history.md', 'credit_history_fixture()', 'test_credit_history_page_lists_transactions()', 'test_history.py'] | 5 nodes found
NODE credit-history.md            [src=docs/credit-history.md]
NODE Credit history               [src=docs/credit-history.md]
NODE credit_history_fixture()     [src=tests/test_history.py]
NODE test_credit_history_page_lists_transactions() [src=tests/test_history.py]
NODE test_history.py              [src=tests/test_history.py]

app/ledger.py and app/routes.py are not in the answer at all.

Graphify version

0.9.102

Operating System

Windows

Python Version

3.12

Installation Method

uv tool install (recommended)

Activity

  1. github-actions commented on Nov 6, 2026

    @github-actions

    Thanks for opening this issue, @rohit-jsfreaky. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions