-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from ai-cfia/12-duplicated-url-results-with-ai…
…-lab-llamaindex-search-in-llamaindex-db issue #8: fix duplicate urls
- Loading branch information
Showing
8 changed files
with
1,099 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
@startuml search sequence | ||
|
||
actor user | ||
participant ":Flask" as app | ||
database "cache" as cache | ||
participant ":Config" as config | ||
participant ":VectorStoreIndex" as index | ||
participant ":BaseRetriever" as retriever | ||
entity "ada:EmbedModel" as ada | ||
database "llamaindex_db" as data | ||
|
||
|
||
user -> app: POST /search/llamaindex\nparams: query, top, skip | ||
app -> cache: get results for query | ||
alt no cached results | ||
activate app | ||
app -> config: get index | ||
app -> index: get retriever | ||
activate index | ||
create retriever | ||
index -> retriever: create(similarity_top_k=high) | ||
index --> app: retriever | ||
deactivate index | ||
app -> retriever: retrieve(query) | ||
activate retriever | ||
retriever -> ada: get embeddings for query | ||
retriever -> data: match embeddings | ||
activate data | ||
return matching nodes | ||
return nodes | ||
app -> app: filter out\nduplicate url nodes | ||
app -> app: transform nodes | ||
app -> cache: set results for query | ||
end alt | ||
app -> user: slice results from skip to top | ||
deactivate app | ||
|
||
<style> | ||
legend { | ||
Fontsize 12 | ||
BackgroundColor white | ||
LineColor white | ||
HorizontalAlignment center | ||
} | ||
</style> | ||
legend | ||
<img:../img/logo.png{scale=0.25}> | ||
cfia.ai-ia.acia@inspection.gc.ca | ||
kotchikpaguy-landry.allagbe@inspection.gc.ca | ||
2024-03-21 | ||
end legend | ||
@enduml |
Oops, something went wrong.