Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial roots should be at depth 0 instead of -1 #119

Open
bjchambers opened this issue Feb 5, 2025 · 3 comments
Open

Initial roots should be at depth 0 instead of -1 #119

bjchambers opened this issue Feb 5, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@bjchambers
Copy link
Collaborator

Describe the bug
Currently, the results of start_k are added at depth 0, while initial_root_ids the neighbors of initial_root_ids are treated as depth 0 (making the initial roots effectively depth -1). This leads to confusing explanations of how the traversals behave.

To Reproduce
Read the docs at https://datastax.github.io/graph-rag/get-started/traversal/

Expected behavior
Initial roots should be roots (depth 0) and returned.

Ideally, the docs for traverse and atraverse should also clarify that initial_root_ids and start_k are combined, therefore start_k=0 should be used if you only want initial roots. Possibly a warning too?

@bjchambers bjchambers added the bug Something isn't working label Feb 5, 2025
@bjchambers
Copy link
Collaborator Author

@kerinin filed this for the depth of the initial roots. Thoughts on anywhere else it could/should be documented?

@epinzur
Copy link
Collaborator

epinzur commented Feb 6, 2025

I think this should be an option. I can see where both cases could be desirable.

When initial roots are desired to be part of the output, then they should be added at depth=0. When they are not, it should continue to work as it does now (depth==-1).

@epinzur
Copy link
Collaborator

epinzur commented Feb 6, 2025

I would change this to a feature-request instead of a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants