Commit Graph

543 Commits

Author SHA1 Message Date
Stan Girard
4d730448af
chore: packages (#2527)
Update python packages
2024-05-01 11:20:15 -07:00
Stan Girard
e1ad3dfb2a
feat(notifications): implemented notifications with RLS and realtime (#2525)
This pull request adds the implementation of the notifications feature,
including the ability to create, update, and delete notifications.
2024-05-01 11:11:12 -07:00
Stan Girard
8b0c55de5c
feat(llamaparse): Add Llama Parse integration for complex document parsing (#2517)
This pull request adds Llama Parse integration for complex document
parsing in Quivr. Llama Parse is a tool from Llama Index that allows you
to read complex documents in Quivr. It provides an API key that needs to
be added to the `.env` file as `LLAMA_CLOUD_API_KEY`. Once configured,
you can use the Llama Parse tool to read `pdf`, `docx`, and `doc` files
in Quivr.
2024-04-29 09:31:21 -07:00
Stan Girard
5717fdc1d5 Update .env.example and backend/models/settings.py 2024-04-29 10:36:10 +02:00
Damien Mourot
fb3aae27f1
feat(backend): use SQLAlchemy instead od supabase API (#2516)
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
2024-04-29 01:27:50 -07:00
Stan Girard
5de8166e46
feat(supabase): Add logging statements and refactor Supabase client creation (#2514)
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
2024-04-28 07:23:14 -07:00
Stan Girard
30b9e057ff
feat(db): Add Supabase client and database instances caching (#2513)
This pull request adds caching for the Supabase client and database
instances in order to improve performance and reduce unnecessary API
calls. The `get_supabase_client()` and `get_supabase_db()` functions now
check if the instances have already been created and return the cached
instances if available. This avoids creating new instances for every
function call, resulting in faster execution times.
2024-04-28 06:46:16 -07:00
Stan Girard
bdb115ad0a
feat(profiler): Add pyinstrument package and update Makefile and backend code (#2512)
This pull request adds the pyinstrument package and updates the Makefile
and backend code. The pyinstrument package is used for profiling and the
Makefile and backend code have been modified to support profiling.
2024-04-28 06:10:21 -07:00
Stan Girard
eb360830e0 Update Dockerfile dependencies 2024-04-28 14:34:44 +02:00
Stan Girard
d2086a97d3 Refactor logging configuration and remove unused imports 2024-04-28 13:35:07 +02:00
Stan Girard
4050313078 Remove debug flag from supabase db push command 2024-04-27 15:35:24 +02:00
Stan Girard
b12fc4f4bf Remove supabase initialization from ci-migration.sh 2024-04-27 15:34:36 +02:00
Stan Girard
b3e8c3d711 Add Supabase schema, migrations, and .gitignore file 2024-04-27 15:31:43 +02:00
Stan Girard
74c0e2d72c Add Supabase to Dockerfile 2024-04-27 15:20:39 +02:00
Stan Girard
e28ef7d709 Add debug flag to supabase db push command 2024-04-27 15:09:55 +02:00
Stan Girard
5baf2f02e5 Add supabase db password to ci-migration script 2024-04-27 15:04:19 +02:00
Stan Girard
9bfa9f63c5 Update ci-migration.sh script with environment variable setup and supabase commands 2024-04-27 15:00:35 +02:00
Stan Girard
491b1f85bf Add supabase initialization to ci-migration.sh 2024-04-27 14:56:45 +02:00
Stan Girard
5c0e5db0d9
Feat/migration ci 2 (#2509)
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
2024-04-27 05:49:15 -07:00
Stan Girard
cba3ac3729
Add ci-migration script (#2508)
This pull request adds a ci-migration script that sets the project ID
from an environment variable and runs the supabase link and supabase db
push commands. This script will be used for continuous integration
purposes.
2024-04-27 05:43:12 -07:00
Stan Girard
785066f9cb
fix(metadata): Removed citation from metadata (#2507)
This pull request removes the citation metadata from the generate_answer
and generate_stream functions. The citation metadata was previously
being added to the streamed_chat_history and metadata dictionaries, but
it is no longer necessary. This change improves the efficiency and
clarity of the code.
2024-04-27 05:19:13 -07:00
Stan Girard
2be6aac02a
feat(embedding): keeping citations (#2506)
This pull request updates the chunk size and overlap parameters in the
File class to improve performance. It also increases the top_n value in
the compressor for both the CohereRerank and FlashrankRerank models.
Additionally, it ensures that the page content is encoded in UTF-8
before processing.
2024-04-27 05:18:51 -07:00
Antoine Dewez
e7ce2fa54b
feat(frontend): show remaining credits (#2495)
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
2024-04-27 04:44:48 -07:00
Stan Girard
e7b5699818
feat(docker): Update Dockerfile to install Supabase CLI (#2505)
This pull request updates the Dockerfile to include the installation of
the Supabase CLI. The Supabase CLI is required for interacting with the
Supabase backend. This update ensures that the Supabase CLI is installed
in the Docker image, allowing developers to easily use the Supabase CLI
within their Docker environment.
2024-04-27 04:42:24 -07:00
Stan Girard
b7ff2e77af
feat(citations): system added (#2498)
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
2024-04-26 08:11:01 -07:00
Damien Mourot
85c4835c59
fix(backend): compute history only if needed and put some cache to remove some call… (#2497)
… to the DB API

# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
2024-04-25 15:18:12 -07:00
Stan Girard
2a25f442e5
feat: Add telemetry ping task to celery worker and main.py (#2494)
This pull request adds a new telemetry ping task to the celery worker
and main.py files. The ping task sends a ping message to the telemetry
system.
2024-04-25 07:22:13 -07:00
Stan Girard
0239d5d19c feat(porter): Add Porter.yaml files for backend and frontend services 2024-04-25 10:51:10 +02:00
Stan Girard
47491bc967
feat: Update chunk overlap to 200 (#2488)
This pull request updates the chunk overlap value in the File class from
300 to 200. This change reduces the overlap between chunks, improving
the performance of chunking operations.
2024-04-24 14:15:31 -07:00
Stan Girard
5c5e022990
feat(history): max tokens in the history provided (#2487)
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
2024-04-24 14:09:55 -07:00
Stan Girard
f656dbcb42
feat(reranker): Add flashrank and contextual compression retriever (#2480)
This pull request adds the flashrank and contextual compression
retriever to the codebase. The flashrank reranker model is used for
compression, and the contextual compression retriever combines the base
compressor and base retriever to improve document retrieval.
2024-04-24 10:44:31 -07:00
Stan Girard
0fd99fe5b2
feat(docs): update to new (#2465)
This pull request updates the API documentation to include new sections
on configuring Quivr and contacting the Quivr team. It also removes the
"API Brains" section from the documentation.
2024-04-22 08:34:11 -07:00
Stan Girard
fbddb70f81
fix(sources): Remove duplicate sources and add metadata to model response (#2462)
This pull request fixes the issue of duplicate sources in the model
response and adds metadata to the response. It removes duplicate sources
with the same name and creates a list of unique sources. Additionally,
it includes the generated URLs and sources in the metadata of the model
response.
2024-04-21 14:50:44 -07:00
Stan Girard
1f48043bb9
fix(gpt4): Refactor GPT4Brain and KnowledgeBrainQA classes to add non-streaming-saving-answer (#2460)
This pull request refactors the GPT4Brain and KnowledgeBrainQA classes
to add the functionality of saving non-streaming answers. It includes
changes to the `generate_answer` method and the addition of the
`save_non_streaming_answer` method. This enhancement improves the
overall functionality and performance of the code.
2024-04-21 04:09:52 -07:00
Stan Girard
e426ecd178
feat(gpt4): Add chat service and generate answer method to GPT4Brain class (#2459)
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
2024-04-21 03:42:03 -07:00
Thoonsen Maxime
5c965b6d22
refactor: reorg the files #2 (#2457)
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
2024-04-20 02:28:20 -07:00
Thoonsen Maxime
43a20ebefe
refactor: Refacto code #1 (#2458)
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
2024-04-20 02:22:05 -07:00
Stan Girard
ec37400691
Revert "refactor: reorg files in backend" (#2456)
Reverts QuivrHQ/quivr#2449
2024-04-20 01:42:35 -07:00
Thoonsen Maxime
dc6bd53519
refactor: reorg files in backend (#2449)
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):


<!--
ELLIPSIS_HIDDEN
-->
----

| 🚀 This description was created by
[Ellipsis](https://www.ellipsis.dev) for commit
997576d577 |
|--------|

### Summary:
This PR involves a significant refactoring of the codebase, with file
and class relocations and renames, and updated import paths, without
introducing new functionality.

**Key points**:
- Significant refactoring of the codebase for improved organization and
clarity.
- File and class relocations and renames.
- Updated import paths to reflect new locations and names.
- No new functionality introduced.


----
Generated with ❤️ by [ellipsis.dev](https://www.ellipsis.dev)

<!--
ELLIPSIS_HIDDEN
-->
2024-04-19 22:25:03 -10:00
Stan Girard
9301cee76d
fix: Fix error message in SummaryAssistant class (#2453)
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
2024-04-19 03:02:59 -07:00
Stan Girard
0761738082 feat: Fix error message for missing files key in input 2024-04-19 12:01:53 +02:00
Stan Girard
5d92b98bcb Update output description in summary_inputs function 2024-04-19 11:54:38 +02:00
Antoine Dewez
803f304390
feat(frontend): Quivr Assistants (#2448)
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):


<!--
ELLIPSIS_HIDDEN
-->
----

| 🚀 This description was created by
[Ellipsis](https://www.ellipsis.dev) for commit
3e95f1a5aa |
|--------|

### Summary:
This PR introduces the 'Quivr Assistants' feature with new frontend
components and pages, backend routes and DTOs changes, and a minor
update in the `processAssistant` function.

**Key points**:
- Introduced the 'Quivr Assistants' feature with new frontend components
and pages, backend routes and DTOs changes.
- Added new `AssistantModal` component in
`/frontend/app/assistants/AssistantModal/AssistantModal.tsx`.
- Added new `InputsStep` and `OutputsStep` components for handling
assistant inputs and outputs.
- Added new `AssistantModal` page in
`/frontend/app/assistants/page.tsx`.
- Added new API endpoints and types for assistants in
`/frontend/lib/api/assistants/assistants.ts` and
`/frontend/lib/api/assistants/types.ts`.
- Updated backend assistant routes and DTOs in
`backend/modules/assistant/controller/assistant_routes.py`,
`backend/modules/assistant/dto/inputs.py`,
`backend/modules/assistant/ito/difference.py`, and
`backend/modules/assistant/ito/summary.py`.
- Made a minor update in the `processAssistant` function in the
`/frontend/lib/api/assistants/assistants.ts` file.


----
Generated with ❤️ by [ellipsis.dev](https://www.ellipsis.dev)

<!--
ELLIPSIS_HIDDEN
-->
2024-04-19 01:36:36 -07:00
Stan Girard
c3e0c2f2ee
feat(summary): improve prompt to get more insights (#2446)
This pull request includes a commit that improves the prompt used to get
more insights from the document. The commit modifies the map and reduce
templates to provide clearer instructions for analyzing each section of
the document and generating a consolidated summary. The changes also
include adjustments to the text splitter to improve the chunk overlap.

<!--
ELLIPSIS_HIDDEN
-->


----

| 🚀 This description was created by
[Ellipsis](https://www.ellipsis.dev) for commit
adf5541dab |
|--------|

### Summary:
This PR enhances the document analysis and summary generation
instructions in the `SummaryAssistant` class and improves text splitting
by adjusting the `chunk_overlap` parameter.

**Key points**:
- Updated `map_template` and `reduce_template` in `process_assistant`
method of `SummaryAssistant` class in
`/backend/modules/assistant/ito/summary.py`.
- Adjusted `chunk_overlap` parameter of `CharacterTextSplitter` instance
from 0 to 100.


----
Generated with ❤️ by [ellipsis.dev](https://www.ellipsis.dev)



<!--
ELLIPSIS_HIDDEN
-->
2024-04-18 14:04:06 -07:00
Stan Girard
3e53ff0dce
fix(assistants): brain id is null (#2445)
This pull request fixes an issue where the brain activation and value
handling were not working correctly. The `BrainInput` model now allows
for optional activation and value fields, and an empty string is
converted to `None` using a root validator. This ensures that brain
activation and value can be properly handled in the application.

<!--
ELLIPSIS_HIDDEN
-->


----

| 🚀 This description was created by
[Ellipsis](https://www.ellipsis.dev) for commit
d63ed6e651 |
|--------|

### Summary:
This PR modifies the `BrainInput` class in
`/backend/modules/assistant/dto/inputs.py` to make `activated` and
`value` fields optional and adds a root validator to convert empty
strings to `None`.

**Key points**:
- Modified `BrainInput` class in
`/backend/modules/assistant/dto/inputs.py`
- Made `activated` and `value` fields optional with default values
- Added root validator `empty_string_to_none` to convert empty strings
to `None`


----
Generated with ❤️ by [ellipsis.dev](https://www.ellipsis.dev)



<!--
ELLIPSIS_HIDDEN
-->
2024-04-18 14:03:47 -07:00
Stan Girard
1e6ff8fce0
feat(rag): Refactor DEFAULT_DOCUMENT_PROMPT in quivr_rag.py (#2442)
This pull request refactors the DEFAULT_DOCUMENT_PROMPT in quivr_rag.py
to improve code readability and maintainability. The unnecessary file
name information has been removed from the prompt template as it is now
included in the vector embedding

<!--
ELLIPSIS_HIDDEN
-->


----

| <a href="https://ellipsis.dev" target="_blank"><img
src="https://avatars.githubusercontent.com/u/80834858?s=400&u=31e596315b0d8f7465b3ee670f25cea677299c96&v=4"
alt="Ellipsis" width="30px" height="30px"/></a> | 🚀 This PR
description was created by [Ellipsis](https://www.ellipsis.dev) for
commit 81939457e6. |
|--------|--------|

### Summary:
This PR refactors the `DEFAULT_DOCUMENT_PROMPT` in `quivr_rag.py` by
removing the file name information from the prompt template, enhancing
code readability and maintainability.

**Key points**:
- Refactored `DEFAULT_DOCUMENT_PROMPT` in `quivr_rag.py`.
- Removed file name information from the prompt template.
- File name information is now included in the vector embedding.


----
Generated with ❤️ by [ellipsis.dev](https://www.ellipsis.dev)



<!--
ELLIPSIS_HIDDEN
-->
2024-04-17 15:26:24 -07:00
Stan Girard
309666f3fd
feat: Update Docker build commands and dependencies (#2441)
This pull request updates the Docker build commands and dependencies.
2024-04-17 14:37:32 -07:00
Stan Girard
311d9bb15c
feat(assistant): check if key of file is same as filename uploaded (#2439)
This pull request fixes the file key validation in the `check_input`
method. Previously, the method only checked if a file was uploaded and
if the key of the file was "doc_to_summarize". However, it did not check
if the key of the file was the same as the name of the file. This PR
adds a check to ensure that the key of the file is the same as the name
of the file. This improves the accuracy of the file validation process.

<!--
ELLIPSIS_HIDDEN
-->


----

| <a href="https://ellipsis.dev" target="_blank"><img
src="https://avatars.githubusercontent.com/u/80834858?s=400&u=31e596315b0d8f7465b3ee670f25cea677299c96&v=4"
alt="Ellipsis" width="30px" height="30px"/></a> | 🚀 This PR
description was created by [Ellipsis](https://www.ellipsis.dev) for
commit 8f04d832ac. |
|--------|--------|

### Summary:
This PR enhances the file validation process in the `SummaryAssistant`
class by ensuring the key of the uploaded file matches its filename.

**Key points**:
- Added a new file key validation in `check_input` method of
`SummaryAssistant` class.
- The validation checks if the key of the uploaded file matches the
filename.
- This is an additional check to the existing file upload and key
validations.


----
Generated with ❤️ by [ellipsis.dev](https://www.ellipsis.dev)



<!--
ELLIPSIS_HIDDEN
-->
2024-04-17 13:27:15 -07:00
Stan Girard
1bd7e81b3d
fix(assistant): summary now can output 2000 tokens (#2440)
This pull request increases the token limit for the summary output to
2000 in order to accommodate larger documents.

<!--
ELLIPSIS_HIDDEN
-->


----

| <a href="https://ellipsis.dev" target="_blank"><img
src="https://avatars.githubusercontent.com/u/80834858?s=400&u=31e596315b0d8f7465b3ee670f25cea677299c96&v=4"
alt="Ellipsis" width="30px" height="30px"/></a> | 🚀 This PR
description was created by [Ellipsis](https://www.ellipsis.dev) for
commit 4412ecde83. |
|--------|--------|

### Summary:
This PR increases the token limit for the summary output to 2000 in the
`SummaryAssistant` class to accommodate larger documents.

**Key points**:
- Increased `max_tokens` parameter in `ChatLiteLLM` instance to 2000 in
`process_assistant` function of `SummaryAssistant` class in
`/backend/modules/assistant/ito/summary.py` file.


----
Generated with ❤️ by [ellipsis.dev](https://www.ellipsis.dev)



<!--
ELLIPSIS_HIDDEN
-->
2024-04-17 08:34:04 -07:00
Stan Girard
3400b8633f
feat(analytics): rely on sql rather that python loop for brains (#2437)
This pull request refactors the get_brains_usages method in the
Analytics class. The changes include improving code readability,
optimizing database queries, and fixing potential bugs.

<!--
ELLIPSIS_HIDDEN
-->


----

| <a href="https://ellipsis.dev" target="_blank"><img
src="https://avatars.githubusercontent.com/u/80834858?s=400&u=31e596315b0d8f7465b3ee670f25cea677299c96&v=4"
alt="Ellipsis" width="30px" height="30px"/></a> | 🚀 This PR
description was created by [Ellipsis](https://www.ellipsis.dev) for
commit f0ad664673. |
|--------|--------|

### Summary:
This PR optimizes the `get_brains_usages` method in the `Analytics`
class by reducing database calls and improving code readability.

**Key points**:
- Refactored `get_brains_usages` method in `Analytics` class.
- Optimized database query to fetch chat history in one go.
- Improved code readability and formatting.


----
Generated with ❤️ by [ellipsis.dev](https://www.ellipsis.dev)



<!--
ELLIPSIS_HIDDEN
-->
2024-04-17 07:24:03 -07:00