zed/crates/collab/migrations
Kyle Kelley 49371b44cb
Semantic Index (#10329)
This introduces semantic indexing in Zed based on chunking text from
files in the developer's workspace and creating vector embeddings using
an embedding model. As part of this, we've created an embeddings
provider trait that allows us to work with OpenAI, a local Ollama model,
or a Zed hosted embedding.

The semantic index is built by breaking down text for known
(programming) languages into manageable chunks that are smaller than the
max token size. Each chunk is then fed to a language model to create a
high dimensional vector which is then normalized to a unit vector to
allow fast comparison with other vectors with a simple dot product.
Alongside the vector, we store the path of the file and the range within
the document where the vector was sourced from.

Zed will soon grok contextual similarity across different text snippets,
allowing for natural language search beyond keyword matching. This is
being put together both for human-based search as well as providing
results to Large Language Models to allow them to refine how they help
developers.

Remaining todo:

* [x] Change `provider` to `model` within the zed hosted embeddings
database (as its currently a combo of the provider and the model in one
name)


Release Notes:

- N/A

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Conrad Irwin <conrad@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Antonio <antonio@zed.dev>
2024-04-12 11:40:59 -06:00
..
20210527024318_initial_schema.sql
20210607190313_create_access_tokens.sql
20210805175147_create_chat_tables.sql
20210916123647_add_nonce_to_channel_messages.sql
20210920192001_add_interests_to_signups.sql
20220421165757_drop_signups.sql
20220505144506_add_trigram_index_to_users.sql
20220506130724_create_contacts.sql
20220518151305_add_invites_to_users.sql
20220523232954_allow_user_deletes.sql
20220620211403_create_projects.sql
20220913211150_create_signups.sql
20220929182110_add_metrics_id.sql
20221111092550_reconnection_support.sql
20221125192125_add_added_to_mailing_list_to_signups.sql
20221207165001_add_connection_lost_to_room_participants.sql
20221213125710_index_room_participants_on_room_id.sql
20221214144346_change_epoch_from_uuid_to_integer.sql
20221219181850_project_reconnection_support.sql
20230103200902_replace_is_completed_with_completed_scan_id.sql
20230202155735_followers.sql
20230508211523_add-repository-entries.sql
20230511004019_add_repository_statuses.sql
20230529164700_add_worktree_settings_files.sql
20230605191135_remove_repository_statuses.sql
20230616134535_add_is_external_to_worktree_entries.sql
20230727150500_add_channels.sql
20230819154600_add_channel_buffers.sql
20230825190322_add_server_feature_flags.sql
20230907114200_add_channel_messages.sql
20230925210437_add_channel_changes.sql
20230926102500_add_participant_index_to_room_participants.sql
20231004130100_create_notifications.sql
20231009181554_add_release_channel_to_rooms.sql
20231010114600_add_unique_index_on_rooms_channel_id.sql
20231011214412_add_guest_role.sql
20231017185833_projects_room_id_fkey_on_delete_cascade.sql
20231018102700_create_mentions.sql
20231024085546_move_channel_paths_to_channels_table.sql
20240103025509_add_role_to_room_participants.sql
20240111085546_fix_column_name.sql
20240117150300_add_impersonator_to_access_tokens.sql
20240122174606_add_contributors.sql
20240122224506_add_requires_zed_cla_column_to_channels.sql
20240129193601_fix_parent_path_index.sql
20240203113741_add_reply_to_message.sql
20240207041417_add_in_call_column_to_room_participants.sql
20240213200201_remove_unused_room_columns.sql
20240214102900_add_extensions.sql
20240220234826_add_rate_buckets.sql
20240221151017_add_edited_at_field_to_channel_message.sql
20240226163408_hosted_projects.sql
20240226164505_unique_channel_names.sql
20240227215556_hosted_projects_in_projects.sql
20240307163119_denormalize_buffer_ops.sql
20240315182903_non_null_channel_role.sql
20240315183903_channel_parent_path_not_null.sql
20240320124800_add_extension_schema_version.sql
20240321162658_add_devservers.sql
20240335123500_add_extension_wasm_api_version.sql
20240402155003_add_dev_server_projects.sql
20240409082755_create_embeddings.sql