Skip to content

Conversation

@wjiayis
Copy link
Member

@wjiayis wjiayis commented Feb 1, 2026

#33

@Junyi-99 Junyi-99 deleted the branch PaperDebugger:feat/tab-completion February 1, 2026 08:45
@Junyi-99 Junyi-99 closed this Feb 1, 2026
@Junyi-99 Junyi-99 reopened this Feb 1, 2026
@wjiayis
Copy link
Member Author

wjiayis commented Feb 2, 2026

Hey @Junyi-99, you mentioned that the bibliography entries are already indexed by the system. I realise that SocketStore.docs is an empty array of 0 elements even if there are indeed multiple files in the directory.

  1. Could you provide some context on SocketStore.docs? I'm not sure if this is intended to be empty.
  2. How are bibliography entries stored currently, and how shall I access them?

@wjiayis wjiayis self-assigned this Feb 2, 2026
@wjiayis wjiayis added the enhancement New feature or request label Feb 2, 2026
@Junyi-99
Copy link
Member

Junyi-99 commented Feb 2, 2026

Hi @wjiayis , Bibliography files are stored on the backend in the projects table, not directly in SocketStore.

SocketStore is a frontend tool for document content retrieval over WebSocket. Its .docs field is populated only after calling sync; otherwise, it is expected to be empty even if files exist. This is by design, not a bug.

Because SocketStore is relatively slow and protocol-heavy, it’s not recommended for frequent file access. Relevant implementation:

Where you plan to handle the bib files (frontend vs. backend)?

@wjiayis
Copy link
Member Author

wjiayis commented Feb 2, 2026

@Junyi-99 Gotchu, actually I called sync (referencing inputs from webapp/_webapp/src/hooks/useSync.ts) before accessing SocketStore but it was still an empty array. I then reverted my change, having realized it didn't work. Not sure if I entered the inputs wrongly or if there's a deeper reason - I could investigate it and open a separate issue if it's a real problem.

But that aside, yeah I agree SocketStore is prob not the best choice as it adds lots of overhead and latency - which is especially noticeable for an auto-complete feature.

Hm I don't have a strong opinion on handling bib files on the frontend or backend. Would you say backend in better (to maintain a single source of truth), since bib is already stored in the projects table?

Edit: I'll be accessing the raw docs from mongodb for this iteration.

@wjiayis
Copy link
Member Author

wjiayis commented Feb 3, 2026

@Junyi-99 I completed a first end-to-end iteration of the tab completion.

In short, it'll

  1. [Frontend] Recognize that user is trying to add a citation (\cite)
  2. [Backend] Fetch bibliography in .bib files stored in project as raw text
  3. [Backend] Query a lightweight LLM (hardcoded to gpt-5-nano for now) to get citation keys

It's a V0, but isn't usable yet because

  1. It extracts too many citation keys -> I'll tune the prompt, easy to fix
  2. Latency is way too high (severe) -> I'll see what kind of caching / design choices I can do to bring the latency down
  3. Overleaf's default tab suggestions for citations is messing with this auto-complete. User needs to click on the citation instead of pressing tab, which is unintuitive -> I'll find out how to override the default tab suggestions

Pls let me know your thoughts on this V0 and its upcoming improvements! Happy to change the design!

cc: @4ndrelim

@wjiayis wjiayis changed the base branch from staging to feat/tab-completion February 3, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants