v2rockets / Loyal-Elephie

Your Trusty Memory-enabled AI Companion - Simple RAG chatbot optimized for local LLMs | 12 Languages Supported | OpenAI API Compatible
MIT License
222 stars 19 forks source link

Format of timed queries #15

Closed hennas-waifson closed 3 days ago

hennas-waifson commented 1 month ago

Hello! A quick question - what syntax does the AI need to use for dates to be understood by the system? mm/dd/yyyy? mm:dd:yyyy? and what's the format for showing the range?

Thank you! :-)

computer problems (last six months) (01/01/2024 to 06/30/2024) new computer preferences (last month, June) (06/2024) budget discussion (January 15) (01/15/2024)

edit: also, could you please tell where to tweak the limit on conversation message size of 1000 characters? sometimes pasting larger chunks of docs for editing and remembering is needed, but not possible due to this limit. Thank you!

v2rockets commented 1 month ago

Hello, in the bottom it uses python dateparser to understand time information in the query, it is aimed to be versatile and multilingual. Besides, the actually query will be generated by LLM, and it should try to make the time information in user input much clearer. Welcome the discussion about some useful time queries format and tests.

As to your example, "computer problems (last six months) (01/01/2024 to 06/30/2024)" should be recognized, but only one of the date "06/30/2024" will be actually used to navigate the document so far but time range support is going to be a good feature. "last six months" is neither supported yet but good LLM is supposed to convert it to actual dates.

"new computer preferences (last month, June) (06/2024)" should befully supported as month will be recognized, you can just say one of the three time indicators.

"budget discussion (January 15) (01/15/2024)" is also supported as it is the basic form.

As to the token limit, it is defined here: "if (value.length > 1000)" in https://github.com/v2rockets/Loyal-Elephie/blob/main/frontend/components/Chat/ChatInput.tsx You may also need to care about the token limit defined here: "max_tokens" in https://github.com/v2rockets/Loyal-Elephie/blob/main/frontend/utils/index.ts

v2rockets commented 3 days ago

date range query is supported now https://github.com/v2rockets/Loyal-Elephie/commit/f19d50478dd70e4d2db2a9b111487d093260d064