A library for semantic search in local environment
Project description
Forcolate Library
AI search is like a box of FORcolates. You never know what you're gonna get.
Forcolate is a versatile library designed to enhance semantic search capabilities, in particular in a setting where it is deployed locally (and not in a cloud environment). It offers a suite of tools that facilitate efficient and intelligent search functionalities, making it easier to find relevant information within large datasets.
Features
- Bullet Point Workflow: Process text messages containing bullet points, where each bullet point is handled using a selected tool.
- Semantic Search for Documents: Search for files and documents within local directories using advanced semantic search algorithms.
- Semantic Search for Outlook Emails: Perform semantic search on Microsoft Outlook emails using the Win32 API.
- Convert Documents to Text: Convert documents from various formats (e.g., PDF, Word) into plain text for easier processing.
- Summarize Documents: Generate summaries for individual documents within a specified directory.
- Summarize Folder: Create a single cohesive summary from the contents of all files in a folder.
- Download URL to Text: Fetch and convert web pages or documents from URLs into plain text.
Installation
To install the Forcolate library, use the following command:
pip install forcolate
Usage
Most of the functions are constructed around a key principle : sequence of working folders Each function take as parameters a query, an input folder and an output folder.
- For search function, the search adds new files to the output and copy all (relevant) files from the input folder
- For transformation function (such as summary), the transformation is applied on all files of the input and produce different files in the output
The query in itseld can contain rich informations such as other folders path to take as input.
Bullet Point Workflow
The Forcolate library includes a workflow for processing text messages containing bullet points. Each bullet point is processed using a selected tool. Below is an example of how to use this workflow:
from forcolate.bullet_point_workflow import run_bullet_point_workflow
text_message = """
- Search for documents in the folder
- Summarize the documents
- Convert URLs to text
"""
memory_folder = "path/to/memory/folder" # This folder will contain one folder per step
# Run the workflow
for progress in run_bullet_point_workflow(text_message, memory_folder):
print(f"Step {progress['step']} of {progress['total_steps']}: {progress['message']}")
Semantic Search for Outlook Emails
This tool performs semantic search on Outlook emails using the Win32 API. Below is an example of how to use this tool:
from forcolate import search_outlook_emails
query = "Search emails for 'project updates' "
folder_in = "path/to/input/folder" # all the content will be copied in output
folder_out = "path/to/output/folder"
file_paths = search_outlook_emails(query, folder_in, folder_out)
print(file_paths)
Semantic Search for Documents
This tool searches for documents in a folder (and recursively in subfolder and compressed files) using a semantic search model. Below is an example of how to use this tool:
from forcolate import search_folder
query = "Search for 'financial reports' in path/to/source/directory"
folder_in = "path/to/input/folder" # this folder will also be search in
folder_out = "path/to/output/folder"
file_paths = search_folder(query, folder_in, folder_out)
print(file_paths)
Convert Documents to Text
This tool converts documents from various formats into plain text. Below is an example of how to use this tool:
from forcolate import convert_folders_to_markdown
query = "Convert documents in path/to/source/directory to text"
folder_in = "path/to/input/folder"
folder_out = "path/to/output/folder"
convert_folders_to_markdown(query, folder_in, folder_out)
Summarize Documents
This tool summarizes the content of each individual document within a specified directory. Below is an example of how to use this tool:
from forcolate import summarize_documents
query = "" # Not used at the moment
folder_in = "path/to/input/folder"
folder_out = "path/to/output/folder"
summarize_documents(query, folder_in, folder_out)
Summarize Folder
This tool generates a single summary from all the information in a folder. Below is an example of how to use this tool:
from forcolate import summarize_folder
query = "Summarize all files in path/to/source/directory"
folder_in = "path/to/input/folder"
folder_out = "path/to/output/folder"
summarize_folder(query, folder_in, folder_out)
Download URL to Text
This tool downloads a document or web page from the internet and converts the content into plain text. Below is an example of how to use this tool:
from forcolate import convert_URLS_to_markdown
query = "Download and convert https://example.com/document1 and https://example.com/document2"
folder_in = "path/to/input/folder" # This folder will be copied
folder_out = "path/to/output/folder"
convert_URLS_to_markdown(query, folder_in, folder_out)
Contributing
Contributions to the Forcolate library are welcome! If you have ideas for new features, improvements, or bug fixes, please open an issue or submit a pull request.
Acknowledgement
This project received funding from the French ”IA Cluster” program within the Artificial and Natural Intelligence Toulouse Institute (ANITI) and from the "France 2030" program within IRT Saint Exupery. The authors gratefully acknowledge the support of the FOR projects.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file forcolate-0.1.15.tar.gz.
File metadata
- Download URL: forcolate-0.1.15.tar.gz
- Upload date:
- Size: 125.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94269fbad68b3f384e2db0ab772c7bc5d6409968503822d7d45ee293bafaa0f2
|
|
| MD5 |
63b6b130a460eacc4419b02fc1b5f9b8
|
|
| BLAKE2b-256 |
088d51df70f4276a9c35572b27f1bc25dda7e6f16726eb76563f073bb5270626
|
Provenance
The following attestation bundles were made for forcolate-0.1.15.tar.gz:
Publisher:
publish.yml on FOR-sight-ai/FORcolate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
forcolate-0.1.15.tar.gz -
Subject digest:
94269fbad68b3f384e2db0ab772c7bc5d6409968503822d7d45ee293bafaa0f2 - Sigstore transparency entry: 206075364
- Sigstore integration time:
-
Permalink:
FOR-sight-ai/FORcolate@cfd34c84ede80f26983819b0103fe4be5ee2e849 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/FOR-sight-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cfd34c84ede80f26983819b0103fe4be5ee2e849 -
Trigger Event:
push
-
Statement type:
File details
Details for the file forcolate-0.1.15-py3-none-any.whl.
File metadata
- Download URL: forcolate-0.1.15-py3-none-any.whl
- Upload date:
- Size: 128.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51ae965c7d3738fbd54440a502ea6ab5fc55bb5a59781dda945902223bb80aec
|
|
| MD5 |
eec4fa87371ff6e9631e63bf8a3c20e8
|
|
| BLAKE2b-256 |
5e871e74690f1109654d2a5fe46d4e2411aa725ed446afb1c9091b1023628965
|
Provenance
The following attestation bundles were made for forcolate-0.1.15-py3-none-any.whl:
Publisher:
publish.yml on FOR-sight-ai/FORcolate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
forcolate-0.1.15-py3-none-any.whl -
Subject digest:
51ae965c7d3738fbd54440a502ea6ab5fc55bb5a59781dda945902223bb80aec - Sigstore transparency entry: 206075365
- Sigstore integration time:
-
Permalink:
FOR-sight-ai/FORcolate@cfd34c84ede80f26983819b0103fe4be5ee2e849 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/FOR-sight-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cfd34c84ede80f26983819b0103fe4be5ee2e849 -
Trigger Event:
push
-
Statement type: