sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
474da6cb4572d8e907da2c53b31f2470002acc89f62125cd91072869871b46bb
Rust
15,641
429
//! 4-bit RaBitQ quantization. //! //! Uses a ray-walk algorithm to find the optimal grid point in //! {±0.5, ±1.5, ±2.5, ±3.5, ±4.5, ±5.5, ±6.5, ±7.5}^dim that maximises //! cosine similarity with the data residual. use std::mem::size_of; use bitpacking::{BitPacker, BitPacker8x}; use chroma_distance::DistanceFunctio...
b99c7bbf491c85036a91a614e4d24bcc52d023501d07d41be92d0ae729ffcf29
Rust
15,816
439
use crate::{CollectionRequest, FrontendReferenceState}; use chroma_types::{ strategies::{ arbitrary_metadata, arbitrary_update_metadata, TestWhereFilter, TestWhereFilterParams, DOCUMENT_TEXT_STRATEGY, }, AddCollectionRecordsRequest, DeleteCollectionRecordsRequest, GetRequest, Include, Includ...
7b4a6152f08077c8e15a39f4c360898ccb54112f75132f2abcd600d3a920102e
Rust
15,868
340
use super::{ data_record::DataRecordStorage, quantized_cluster_delta::QuantizedClusterDelta, single_column_storage::SingleColumnStorage, spann_posting_list_delta::SpannPostingListDelta, }; use crate::{ arrow::types::ArrowWriteableKey, key::{CompositeKey, KeyWrapper}, }; use arrow::{ array::{ ...
1feae7f3b2c784a2092609a31647073b09b4321eb2950214394bd57fbbdce2c5
Rust
15,965
506
use crate::{ utils::duration_ms, ChannelError, CleanupGuard, Component, ComponentContext, ComponentHandle, PanicError, System, }; use async_trait::async_trait; use chroma_error::ChromaError; use core::fmt::Debug; use std::any::type_name; use std::sync::LazyLock; use std::time::Instant; use tokio::sync::oneshot:...
44a30bc109f7c32f9282e7df2c8f2b2f230986971b9a81cbc729745038c0d9ca
Rust
16,016
463
use parking_lot::RwLock; use std::sync::atomic::AtomicU64; use std::sync::LazyLock; use std::sync::{Arc, Weak}; use std::time::{Duration, Instant}; use std::{collections::HashMap, fmt::Debug}; use tokio::select; use tracing::Span; use super::{utils::duration_ms, Component, ComponentContext, Handler, Message}; pub(cra...
a8c91fb19e6e6cdc2d3f0442bea815f37da66080989d1efefc4131ce790de542
Rust
16,083
440
//! Migration runner for Spanner schema migrations. use google_cloud_googleapis::spanner::admin::database::v1::UpdateDatabaseDdlRequest; use google_cloud_spanner::admin::client::Client as AdminClient; use google_cloud_spanner::client::Client; use google_cloud_spanner::mutation::insert; use google_cloud_spanner::statem...
4bf304cfb82d1eb989d776ed3c2be448f24a0c5bbb9b91a43bb82fd8ba11b298
Rust
16,131
460
use crate::work_queue::types::{FinishResult, WorkQueueError}; use crate::work_queue::work_queue_manager::{ DeferWorkMessage, FinishWorkMessage, GetWorkMessage, GetWorkResult, PushWorkMessage, SetFunctionFailureCountMessage, UpdateFunctionFailureCountMessage, WorkQueueManager, }; use crate::work_queue::GET_WORK_...
a713a8b1bfd1b5e708d3e528bd2f64dd26d24653df32e16eb67523ddbe59c7ba
Rust
16,148
508
//! Test utilities for Storage implementations //! //! This module provides reusable test functions that can be used to test //! any Storage backend (GCS, S3, Azure, Local, AdmissionControlled, etc.) //! via the unified Storage enum interface. use chroma_storage::{DeleteOptions, ETag, GetOptions, PutMode, PutOptions, ...
fd9641adc2dd7e2081b6709e93f198e40fb6fa33d08b857249c2f5910351da33
Rust
16,380
513
use std::sync::Arc; use chroma_storage::s3_client_for_test_with_new_bucket; use wal3::{ create_s3_factories, Cursor, CursorName, CursorStoreOptions, FragmentManagerFactory, LogPosition, LogReader, LogReaderOptions, LogWriter, LogWriterOptions, ManifestManagerFactory, S3ManifestManagerFactory, SnapshotOpti...
43f2f913f3adf7c5c1af3c4af8b6e6f25ee8f2dcadd4486111ae642e94cccba2
Rust
16,388
400
use std::collections::BTreeSet; use crate::common; use chroma_blockstore::provider::BlockfileProvider; use chroma_blockstore::{ arrow::provider::BlockfileReaderOptions, test_arrow_blockfile_provider, BlockfileWriterOptions, }; use chroma_index::sparse::maxscore::{MaxScoreReader, SPARSE_POSTING_BLOCK_SIZE_BYTES}; u...
0c0e6bf797cad1f30b17afda1ebbc7d4483f944650dd60248a895bf3fdbf3c2b
Rust
16,772
484
//! Configuration types for Chroma client initialization and behavior. //! //! This module defines options that control authentication, retry behavior, and connection //! parameters for the Chroma client. The primary type is [`ChromaClientOptions`], which bundles //! all configuration needed to construct a [`ChromaClie...
c6483976944b7876bb184b13b7b946ae2c901157bf7f538b577f3365bcf3d39f
Rust
16,809
481
use std::{fmt::Debug, mem::size_of_val}; use super::{ ConversionError, Operation, OperationConversionError, ScalarEncoding, ScalarEncodingConversionError, UpdateMetadata, UpdateMetadataValue, UpdateMetadataValueConversionError, }; use crate::{chroma_proto, CHROMA_DOCUMENT_KEY}; use chroma_error::{ChromaErr...
c761ac6bf38dfa8b86e558c1260401f85e510175b8688a4119263ba93af4a5bf
Rust
16,889
302
use async_trait::async_trait; use chroma_blockstore::provider::BlockfileProvider; use chroma_segment::bloom_filter::BloomFilterManager; use chroma_system::{ wrap, ComponentContext, ComponentHandle, Dispatcher, Handler, Orchestrator, OrchestratorContext, TaskMessage, TaskResult, }; use chroma_types::{ operat...
d3792bc345a7d34ca60055f9dd6d9d9c9d8ceadc447bbcdc5438249c8c1bc7ba
Rust
17,099
477
//! `POST /api/read-page` — reconstruct a single wiki page in full from its //! chunks, keyed by `slug`. //! //! Search returns chunk-level hits; this route reassembles a whole page: fetch //! every chunk for the slug, order them by `chunk_id`, and join their //! documents. Scalar page metadata is read from the head ch...
0cb206930a5ec00fc05fc2716517e3cc7c83d403eb24bda2c39e2ae3fac1008a
Rust
17,137
494
//! Interactive CLI tool for configuring regions and topologies. //! //! This tool guides the user through creating a `MultiCloudMultiRegionConfiguration` //! by interactively querying for regions and topologies. use std::io::BufRead; use std::io::Write; use chroma_types::MultiCloudMultiRegionConfiguration; use chrom...
7ac771f133358a8d67c1b363b38ff33fe5b9bdd369278c693b9a3c50a060cf9b
Rust
17,200
539
use std::sync::Arc; use std::time::Duration; use async_trait::async_trait; use chroma_config::registry::Injectable; use chroma_types::chroma_proto::fault_action::Act; use chroma_types::chroma_proto::fault_injection_service_server::FaultInjectionService; use chroma_types::chroma_proto::fault_selector::By; use chroma_ty...
9887056a3227a4af7214296d3ae9996e3e350c85eec6eae1dab6e336783c6083
Rust
17,240
527
use crate::client::dashboard_client::{DashboardClient, DashboardClientError, Team}; use crate::commands::db::DbError; use crate::commands::login::LoginError::BrowserAuthFailed; use crate::config_store::{ConfigStore, FileConfigStore}; use crate::terminal::{SystemTerminal, Terminal}; use crate::ui_utils::validate_uri; us...
3f98c5686e99df683b522bb7c770fff74e7e1ed2991c2db0eea65c49c883bbc2
Rust
17,289
503
use std::{ collections::{HashMap, HashSet}, ops::{Add, Div, Mul, Sub}, }; use async_trait::async_trait; use chroma_error::{ChromaError, ErrorCodes}; use chroma_system::Operator; use chroma_types::operator::{RankExpr, RecordMeasure}; use thiserror::Error; // NOTE: `RankDomain` represents evaluated scores for r...
5185c1a0e5328fce1d8164ef35114949b77b77736aece000094005e0c202d774
Rust
17,294
493
use async_trait::async_trait; use chroma_error::{ChromaError, ErrorCodes}; use chroma_storage::{DeleteOptions, Storage}; use chroma_sysdb::SysDb; use chroma_system::{Operator, OperatorType}; use chroma_types::chroma_proto::{CollectionVersionFile, VersionListForCollection}; use futures::stream::StreamExt; use std::sync:...
35c71f90a0f5edc9ee21d73e2f37b5bc7cb4b83e70823f896694a1c0267830a6
Rust
17,334
467
use std::{cmp::Ordering, num::TryFromIntError}; use async_trait::async_trait; use chroma_blockstore::provider::BlockfileProvider; use chroma_error::{ChromaError, ErrorCodes}; use chroma_segment::{ blockfile_record::{ RecordSegmentReaderOptions, RecordSegmentReaderShard, RecordSegmentReaderShardCreationErro...
ad15dc39c8858cc90847052aefba01dc7b60a34be85fa8d8146a75111d056a05
Rust
17,408
605
use parking_lot::Mutex; use s3heap::{ Error, HeapPruner, HeapReader, HeapScheduler, HeapWriter, Limits, PruneStats, RetryConfig, Schedule, Triggerable, }; use std::collections::HashMap; use std::str::FromStr; use std::sync::Arc; use std::time::Duration; use uuid::Uuid; // Dummy scheduler for testing purposes s...
045dc63380e797f9213350288c179b1c2385cdff6cb147fd5717d5618868dd18
Rust
17,794
427
//! Backend abstraction for the SysDb service. //! //! # Architecture //! //! ```text //! ┌─────────────────────────────────────────────────────────────┐ //! │ gRPC Server │ //! │ (server.rs) │ //! │ Implements ...
7b661cfe0336e58b59c5c890b03a94f7307a14b678062d02b022ea1f314e648d
Rust
17,943
481
use async_trait::async_trait; use chroma_error::{ChromaError, ErrorCodes}; use chroma_system::{ wrap, ChannelError, ComponentContext, ComponentHandle, Dispatcher, Handler, Orchestrator, OrchestratorContext, TaskMessage, TaskResult, }; use chroma_system::{PanicError, TaskError}; use chroma_types::{JobId, Segment...
ccaaedf9c1463fdbe22afb2140c9db4453b072c753c9e5108f0624d42519876a
Rust
17,966
558
use crate::{utils::duration_ms, utils::PanicError, ReceiverForMessage}; use async_trait::async_trait; use chroma_error::{ChromaError, ErrorCodes}; use futures::FutureExt; use std::{any::type_name, fmt::Debug, panic::AssertUnwindSafe}; use std::{sync::LazyLock, time::Instant}; use thiserror::Error; use tokio_util::sync:...
f8bdbf90228e19ef767fce917bb0ddc23591cf6d75ef5b4b09871811b060416f
Rust
17,974
467
use chroma_cache::CacheConfig; use chroma_config::helpers::deserialize_duration_from_seconds; use chroma_config::{registry::Registry, Configurable}; use chroma_error::{ChromaError, ErrorCodes}; use chroma_log::config::LogConfig; use chroma_storage::config::StorageConfig; use chroma_storage::Storage; use chroma_system::...
5488d84f06d993792e9fccc8d667b8755a690de09f199fd3d225d451b7932cb2
Rust
18,146
510
use crate::grpc_log::{GrpcLog, GrpcPushLogsError, GrpcSealLogError, ScoutLogFragmentsResponse}; use crate::in_memory_log::InMemoryLog; use crate::sqlite_log::SqliteLog; use crate::types::CollectionInfo; use chroma_api_types::CONDITIONAL_WRITE_CONFLICT_MESSAGE; use chroma_error::{ChromaError, ErrorCodes}; use chroma_mem...
b16a13d1e94ab4269966866a211994b2ea38080a13ef243e371dd2a5fd13a96e
Rust
18,165
454
use super::*; use chroma_config::{registry::Registry, Configurable}; use chroma_frontend::{impls::service_based_frontend::ServiceBasedFrontend, FrontendConfig}; use chroma_log::LocalCompactionManager; use chroma_sqlite::db::SqliteDb; use chroma_system::{ComponentHandle, System}; use chroma_types::*; use std::collection...
d1dfcf9ca12990bb8c233cf21b6c2e8195d6294329efb04f5842128da46f5647
Rust
18,173
512
use std::str::FromStr; use std::time::{Duration, SystemTime}; use super::{Metadata, MetadataValueConversionError}; use crate::{ chroma_proto, test_segment, CollectionConfiguration, InternalCollectionConfiguration, Schema, SchemaError, Segment, SegmentScope, UpdateCollectionConfiguration, UpdateMetadata, }; use...
ba056117f4ef53db413f56a72fbf498c112d192a31775cddc8d0e3fdf5bd5d54
Rust
18,266
573
use std::sync::Arc; use chroma_storage::s3_client_for_test_with_new_bucket; use wal3::{ create_s3_factories, Cursor, CursorName, CursorStoreOptions, FragmentManagerFactory, GarbageCollectionOptions, Limits, LogPosition, LogReader, LogReaderOptions, LogWriter, LogWriterOptions, ManifestManagerFactory, S3Ma...
4cd8e1c4ba95d9f661555dcf2c9e2389023ff644385271d816484852ccfaf829
Rust
18,561
535
use super::config::LocalExecutorConfig; use async_trait::async_trait; use chroma_config::{registry::Registry, Configurable}; use chroma_distance::normalize; use chroma_error::ChromaError; use chroma_log::{BackfillMessage, LocalCompactionManager, PurgeLogsMessage}; use chroma_segment::{ local_hnsw::LocalHnswSegmentR...
df784648ad839900a6d2b42712ac533662458a38fa99e18f71a5723a605099ce
Rust
18,606
527
// Note: This service is not fully functional after nonce removal // Keeping code structure intact for potential future reimplementation // TODO(tanujnay112): Remove this after reimplementation #![allow(unused_imports)] #![allow(dead_code)] use std::collections::HashMap; use std::sync::Arc; use std::time::Duration; u...
8af297339e769c999c1061ba9886f5aa7df734086bd9d5e8e900d1cebcf05df5
Rust
18,720
520
use std::collections::HashSet; use std::io::Cursor; use murmur3::murmur3_32; use tantivy::tokenizer::{ LowerCaser, NgramTokenizer, RemoveLongFilter, SimpleTokenizer, TextAnalyzer, Token, TokenFilter, TokenStream, Tokenizer, }; use thiserror::Error; // ----------------------------------------------------------...
60903e0905bcbdca84a0732c7548a18e467cd4122ea9a1a462f8b1fe2e1c27dc
Rust
18,854
502
use crate::types::ChromaSegmentFlusher; use super::blockfile_record::{ApplyMaterializedLogError, RecordSegmentReaderShard}; use super::types::MaterializeLogsResult; use chroma_error::{ChromaError, ErrorCodes}; use chroma_index::hnsw_provider::{ HnswIndexProvider, HnswIndexProviderCreateError, HnswIndexProviderFork...
aa22a9c0e75734dc675a60fca3e3d5e67766d900dc5dd040e1552122b29e5a9a
Rust
18,866
572
use std::sync::Arc; use chroma_storage::Storage; use chroma_sysdb::{SysDb, TestSysDb}; use chroma_types::{CollectionUuid, DirtyMarker}; use wal3::{ create_s3_factories, CursorStore, CursorStoreOptions, FragmentSeqNo, LogPosition, LogReader, LogReaderOptions, LogWriter, LogWriterOptions, ManifestReader, S3Fragm...
4e7cc0f2f45fb2bebca106789a70da895a037de0dd1d1f7e58640f3aeecbd719
Rust
18,906
572
use std::sync::Arc; use google_cloud_spanner::client::Client; use tokio::sync::Semaphore; use uuid::Uuid; use chroma_storage::Storage; mod fragment_manager; mod manifest_manager; use crate::{Error, FragmentUuid, LogWriterOptions, Manifest}; use super::batch_manager::BatchManager; use super::{FragmentManagerFactory...
54891f3c17db30ca32d59b9d6d880d9fd5e5265c2b9e69f9bf16817e7a53ac83
Rust
18,978
667
use crate::config_store::{ConfigStore, FileConfigStore}; use crate::terminal::{SystemTerminal, Terminal}; use crate::utils::{CliConfig, CliError, Profiles}; use clap::{Args, Subcommand}; use colored::Colorize; use thiserror::Error; #[derive(Debug, Error)] pub enum ProfileError { #[error("Profile {0} not found")] ...
d29bc57b4cf7becf9f0c6ceeb24cdd506d2b7f10c592bec8f84fabf5aee787b6
Rust
19,116
522
use async_trait::async_trait; use chroma_blockstore::provider::BlockfileProvider; use chroma_error::{ChromaError, ErrorCodes}; use chroma_segment::{ blockfile_record::{ RecordSegmentReaderOptions, RecordSegmentReaderShard, RecordSegmentReaderShardCreationError, }, bloom_filter::BloomFilterManager, ...
e9ab5395810af3d9f2b1239fa0d6122764ac6d2c26cd68acaa65a713b80ef43f
Rust
19,277
628
use super::{ error::QueryConversionError, operator::{ Filter, GroupBy, KnnBatch, KnnProjection, Limit, Projection, Rank, Scan, ScanToProtoError, Select, }, }; use crate::{ chroma_proto, operator::{Key, RankExpr}, validators::{validate_group_by, validate_rank, validate_search_payl...
c20a5d66908c2b07c9c42cf1af1695ca03012661e557700ff2f6ece5f590e760
Rust
19,507
494
//! `POST /api/subagent_search` — runs a query against the external "context-1" //! deep-research API and streams the result back to the caller. //! //! This endpoint owns its wire contract; it is not a transparent proxy. We //! parse every event from the dependency into a typed [`AgentEvent`] and //! re-emit our own [...
61d08fd3a895584a78cec0a8a96a062193dd38d9d8763d6a8d944b754120e2ba
Rust
19,772
544
use chroma_error::{source_chain_contains, ChromaError}; use chroma_log::grpc_log::GrpcPullLogsError; use chroma_sysdb::GetCollectionsOptions; use chroma_system::{Operator, System}; use chroma_types::{AttachedFunction, AttachedFunctionUuid, CollectionUuid, DatabaseName}; use std::collections::HashMap; use std::error::Er...
fa4c7430f0ed78902495f700ea86daf0bbf651c84290de68ad659e7edf9f3617
Rust
19,974
572
//! HTTP routes for storing and reading generated wiki trajectories. //! //! The request and response bodies intentionally mirror //! [`crate::trajectories`] types. Axum concerns stay here: Foundation auth, //! scorecard metering, caller-token extraction, collection resolution, and //! cache invalidation for stale coll...
bde57426be650e6eca2cb4938c797b9cd49ee260a5b282325b5dab88a3dfc8aa
Rust
20,247
503
use async_trait::async_trait; use chroma_blockstore::provider::BlockfileProvider; use chroma_error::{ChromaError, ErrorCodes}; use chroma_segment::{ blockfile_record::{ RecordSegmentReaderOptions, RecordSegmentReaderShard, RecordSegmentReaderShardCreationError, }, bloom_filter::BloomFilterManager, }...
1a3852ecbe54c8f3ff3cf662d3ede1e3580a19cd9a89c16ab304b482cb957c6c
Rust
20,268
560
use crate::{default_space, hnsw_configuration::Space, SpannIndexConfig}; use chroma_error::{ChromaError, ErrorCodes}; use serde::{Deserialize, Serialize}; use thiserror::Error; use validator::Validate; pub fn default_search_nprobe() -> u32 { 64 } pub fn default_search_rng_factor() -> f32 { 1.0 } pub fn defau...
6949c6764b5786c64913ca1c75c1464006b450a04e29111a9555c566f32ab4d5
Rust
20,400
462
/* Much of this file is copied from https://github.com/qdrant/qdrant/blob/master/lib/segment/src/spaces/simple_neon.rs copyright Qdrant, licensed under the Apache 2.0 license. TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use,...
fdefb8304ebf5d75047824ce91f4b5246417dc2cb15eaffd2d84dd78d21907c5
Rust
20,563
616
use super::{scheduler::Scheduler, utils::duration_ms, ChannelError, RequestError, WrappedMessage}; use async_trait::async_trait; use chroma_config::registry::Injectable; use chroma_error::ChromaError; use core::panic; use futures::Stream; use parking_lot::Mutex; use std::sync::atomic::{AtomicU64, Ordering}; use std::sy...
703bdd4e86c437a42c2d9dea09c76de97aaa0bae1d84c73b22404dfefc8b8f1c
Rust
20,782
585
use crate::config::{MigrationHash, MigrationMode, SqliteDBConfig}; use crate::migrations::{GetSourceMigrationsError, Migration, MigrationDir, MIGRATION_DIRS}; use chroma_error::{ChromaError, ErrorCodes}; use sqlx::sqlite::SqlitePool; use sqlx::{Executor, Row}; use thiserror::Error; use tokio::io; // // TODO: // // - s...
496e9dff4b11a6b873c65576b58c3e7a090f7ae669dec552b219decb2ca1b663
Rust
20,844
603
use super::*; use chroma_log::{ local_compaction_manager::LocalCompactionManagerConfig, sqlite_log::SqliteLog, Log, }; use chroma_segment::local_segment_manager::LocalSegmentManagerConfig; use chroma_sysdb::{test_sysdb::TestSysDb, SysDb}; use chroma_system::System; use chroma_types::{ Chunk, Collection, Collect...
a0260e9c653ef1ac56b35733bce35703478f46aa07e98f236be88d102a21c8b1
Rust
20,844
544
use std::{ collections::HashMap, fmt, future::{ready, Future}, pin::Pin, }; use chroma_error::ChromaError; use chroma_types::{plan::SearchPayload, CollectionUuid, Metadata, Schema, UpdateMetadata, Where}; use strum::IntoEnumIterator; use strum_macros::EnumIter; use thiserror::Error; use validator::Vali...
cdf97d816ca625b4a58f7c44aec8eb5241da3fe38ad416a70e1b6c4282edcb03
Rust
20,954
676
use crate::config_store::{ConfigStore, FileConfigStore}; use crate::terminal::{SystemTerminal, Terminal}; use crate::ui_utils::read_secret; use crate::utils::UtilsError::UserInputFailed; use crate::utils::{CliConfig, CliError, Profile, SELECTION_LIMIT}; use clap::Parser; use colored::Colorize; use indicatif::{ProgressB...
b2da6558d28acf7bab1584ec8f8ea2c27e332d4905b6759a34c2bc3b58e0d479
Rust
21,010
567
use std::future::Future; use std::time::Duration; use super::config; use async_trait::async_trait; use backon::ExponentialBuilder; use backon::Retryable; use chroma_config::registry; use chroma_config::{assignment::assignment_policy::AssignmentPolicy, Configurable}; use chroma_error::ChromaError; use chroma_memberlist...
535777cbd78d35f258c006e2c26a1852e488cc8805bb8f8f8232acd4ed6f092c
Rust
21,125
522
//! A drainable GCRA (generic cell rate algorithm) rate limiter with token refunds. //! //! Instead of periodically refilling a counter, the bucket tracks a theoretical arrival time. //! Consuming tokens advances that time; returning tokens moves it back, no earlier than now. use std::sync::atomic::{AtomicU64, Orderin...
059d341724a474abcf85590931f87bbd8312646e68bb0e96c3904f761a71ffb0
Rust
21,304
535
/** * Contains the reference implementation of the garbage collector state machine. * * The reference implementation keeps track of all files created and a graph of the fork tree. * The main invariant that this provides hooks for is that the set of files on disk match the expected set of files (accounting for files...
cf9cd95210fad3e3c2e77cce6041d1546adca00606968b9b8be6ad906a2a6f2d
Rust
21,393
579
use std::num::TryFromIntError; use std::sync::Arc; use chroma_cache::{Cache, CacheConfig, CacheError, Weighted}; use chroma_error::{ChromaError, ErrorCodes}; use chroma_storage::admissioncontrolleds3::StorageRequestPriority; use chroma_storage::{GetOptions, Storage, StorageError}; use chroma_types::chroma_proto; use c...
5da585ec44cccbeb561837483e2e3f82e1f82687555dd121d9d3c1b022d9b384
Rust
21,858
599
//! Conditional transaction support for collection-scoped optimistic writes. //! //! Conditional transactions provide optimistic read-check-write behavior for a //! single collection. Reads execute immediately and writes are buffered until an //! explicit commit or an implicit [`run`](ConditionalCollectionTransaction::...
0cdc9d6515eb98b24951215bba1a4355abd7344995a2163b09cf379d7fc81c7a
Rust
21,906
591
use async_trait::async_trait; use chroma_blockstore::provider::BlockfileProvider; use chroma_distance::DistanceFunction; use chroma_error::{ChromaError, ErrorCodes}; use chroma_index::hnsw_provider::HnswIndexProvider; use chroma_segment::{ bloom_filter::BloomFilterManager, distributed_hnsw::{DistributedHNSWSegm...
29b66b4bfeb8da93a42ac8659b9ff608335594e5bd20fe85772d3e5a02b7fb1d
Rust
21,973
522
/* Much of this file is copied from https://github.com/qdrant/qdrant/blob/master/lib/segment/src/spaces/simple_sse.rs copyright Qdrant, licensed under the Apache 2.0 license. TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, ...
0be9bf65e8a50754111a9abef0a0282008d935566f44000a9b8fc292cea5e3f7
Rust
22,013
554
//! `POST /api/agent` — runs the `chroma-agent` loop over the foundation //! retrieval tools and streams each step back to the caller as SSE. //! //! The agent is driven manually (reset -> observe -> infer -> act -> observe) //! inside an [`async_stream`] so every inference step and tool observation can //! be emitted ...
28e8ef08422e8ea37f45b5467d62c1f735970d9cd40de7c8f63a528d7c477c09
Rust
22,059
621
use std::{any::Any, future::Future, sync::Arc}; use self::config::StorageConfig; use admissioncontrolleds3::StorageRequestPriority; use async_trait::async_trait; use bytes::Bytes; use chroma_config::{registry::Registry, Configurable}; use chroma_error::{ChromaError, ErrorCodes}; use futures::Stream; pub mod admission...
d62ffdb5eea168bf2d3ff461f3e519f90f1aa8945242a177021121d428afaf09
Rust
22,096
631
use std::collections::HashMap; use chroma_blockstore::BlockfileReader; use chroma_error::{ChromaError, ErrorCodes}; use chroma_types::SignedRoaringBitmap; use futures::future::join; use thiserror::Error; use crate::sparse::types::{encode_u32, Score, TopKHeap, DIMENSION_PREFIX}; #[derive(Debug, Error)] pub enum Spars...
0540f0f60708083c6898025fe0e44f2502e248cadded01c14aae7409026b44a7
Rust
22,193
709
mod provisioning; use super::*; use crate::{ config::FoundationApiConfig, registry::{FoundationPage, FoundationRegistry}, routes::test_auth::{expect_ok, server_with_config, FakeAuth}, }; use async_trait::async_trait; use chroma_error::{ChromaError, ErrorCodes}; use chroma_sysdb::{SysDb, TestSysDb}; use htt...
abd587019755e68032aecb432cc59efff5cad5f29ac1248a91d6979d3d9e97da
Rust
22,194
617
use std::collections::HashMap; use super::{storage::BlockStorage, types::Delta}; use crate::{ arrow::{ block::Block, types::{ArrowWriteableKey, ArrowWriteableValue}, }, key::CompositeKey, }; use arrow::array::RecordBatch; use uuid::Uuid; /// This is the delta type used by most applications...
a8f6969767b9a487c1bed79ec6ad74e203e641a92ef247cfe9459d9f741c3575
Rust
22,319
555
use axum::http::{HeaderMap, StatusCode}; use chroma_api_types::GetUserIdentityResponse; use chroma_error::{ChromaError, ErrorCodes}; use crate::auth::{AuthError, AuthenticateAndAuthorize, AuthzAction, AuthzResource}; use crate::routes::FoundationScope; /// Longest Foundation name that can ever be deleted. /// /// Sof...
d1f145cd46d04102f7ae6b9cc03bf1bde38c81a07b42099951202292128eb579
Rust
22,405
592
//! `POST /api/search` — hybrid dense+sparse search over the wiki collection. //! //! Embeds the query with the caller's token (dense Qwen + sparse SPLADE), //! fuses the two `$knn` rankings with Reciprocal Rank Fusion, then groups the //! chunk hits by `slug` on the engine to return a slim, one-per-page result //! lis...
68e7f7eabfcc70d5fc2048e9b013fc90708cbbc6e6a779e8b10a62a3fd6e5bee
Rust
22,586
580
use crate::types::FilePathSet; use async_trait::async_trait; use chroma_blockstore::{arrow::provider::RootManagerError, RootManager}; use chroma_error::{ChromaError, ErrorCodes}; use chroma_index::{ hnsw_provider::{HnswIndexProvider, FILES}, usearch::USearchIndex, IndexUuid, }; use chroma_storage::StorageEr...
fad247e7b2d4181622ba94ff17c8f72dbe7f660b62ef3a38368540bad5682c49
Rust
22,592
532
/* Much of this file is copied from https://github.com/qdrant/qdrant/blob/master/lib/segment/src/spaces/simple_avx.rs copyright Qdrant, licensed under the Apache 2.0 license. TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, ...
48ed9b619ba0848f70644de8e9761d30edb6a7a0f64ff1d211f7e778ab7babab
Rust
22,692
492
/* Parts of file is copied from https://github.com/qdrant/qdrant/blob/master/lib/segment/src/spaces/simple.rs copyright Qdrant, licensed under the Apache 2.0 license. TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduc...
06b52d02fe205a0362d3a94c5d4e72b020f946054f7aa14b1c5d7957de75f89d
Rust
22,879
622
use std::collections::HashMap; use std::sync::Arc; use async_trait::async_trait; use chroma_error::ChromaError; use chroma_types::{AttachedFunction, Chunk, LogRecord, MaterializedLogOperation}; use frontend_core::foundation::source_kind_for_collection_name; use serde::{Deserialize, Serialize}; use thiserror::Error; u...
84b6714e8448b1b9bd607cb7c931ec7ae804dfb765e7f40625821250d013a532
Rust
23,083
606
//! The agent state machine and behavior composition. //! //! [`Agent`] drives the `infer -> act -> observe` loop, mirroring the Python //! `Agent` class. It exposes the same two modes: //! //! - **Manual driving** (for RL / external control): call [`Agent::reset`], //! [`Agent::observe`], [`Agent::infer`], [`Agent::...
e9eb95ea869d89325ce5e92e03d2bc7b103e376d406a33a223cbe1aab5b78fc5
Rust
23,226
621
use chroma_metering_macros::initialize_metering; use serde::{Deserialize, Serialize}; use std::{sync::atomic::Ordering, time::Instant}; use crate::types::{MeteringAtomicU64, MeteringInstant}; fn default_region() -> String { String::new() } #[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Hash, Serialize)...
08584141be2913c6f4b97d1d9a5715bf218da381755f20aace1f88a9389ae654
Rust
23,780
614
#[cfg(test)] mod tests { use crate::work_queue::work_queue_client::WorkQueueClient; use chroma_config::registry::Registry; use chroma_config::Configurable; use chroma_sysdb::{DatabaseOrTopology, GetCollectionsOptions, SysDb}; use chroma_types::chroma_proto::{ CheckInvocationStatusRequest, In...
1e9275fd1e7e247a93984265314566e6850da9a06a1913b3da9e2ee926fc8186
Rust
24,085
610
use chroma_blockstore::RootManager; use chroma_config::Configurable; use chroma_log::Log; use chroma_storage::Storage; use chroma_storage::StorageError; use chroma_sysdb::{GetCollectionsOptions, SysDb}; use chroma_system::Dispatcher; use chroma_system::Orchestrator; use chroma_types::chroma_proto::CollectionVersionFile...
500776e1ce7541c5c9f50729e3b17ef29308ddfde13b449f4e4fa36fdf817e6e
Rust
24,153
580
/* Much of this file is copied from https://github.com/qdrant/qdrant/blob/master/lib/segment/src/spaces/simple_avx.rs copyright Qdrant, licensed under the Apache 2.0 license. TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, ...
18af48fdfaefbbc5e6711ac8795721a8d802556b11e555e13a8aaea36cfa4e77
Rust
24,169
710
use std::sync::{ atomic::{AtomicUsize, Ordering}, Arc, }; use chroma_cache::{Cache, Weighted}; use chroma_distance::DistanceFunction; use chroma_error::{ChromaError, ErrorCodes}; use chroma_storage::{ admissioncontrolleds3::StorageRequestPriority, GetOptions, PutOptions, Storage, StorageError, }; use chrom...
8102a72b6c949e673352dd39d7cb8dfbdd3a2243728acad8df44c6734218a02d
Rust
24,216
718
// NOTE: This is mostly a copy paste from the standalone s3 impl, which will be cleaned up later //! Object storage backend implementation using object_store. //! //! ## ETag Implementation Note //! The `UpdateVersion` struct is serialized to JSON and stored as an ETag string. use std::{error::Error as StdError, sync::...
2623c5879e50b51f9f5aa525e499f59aed2403ffbd7ef4e76cc25eed1706a4cb
Rust
24,464
599
use super::garbage_collector_reference::{ CollectionStatus, ReferenceGarbageCollector, ReferenceState, }; use super::proptest_types::SegmentIds; use crate::define_thread_local_stats; use crate::proptest_helpers::proptest_types::Transition; use chroma_blockstore::RootManager; use chroma_cache::nop::NopCache; use chr...
103cc3182efc0d148b997d3134834c95d86e9ac56a5401c3a89d7b1b0a5b7ab1
Rust
24,825
698
//! Comprehensive Search API Example //! //! This example demonstrates the full functionality of the Chroma Rust client, //! including schema configuration, data ingestion with sparse vectors, and //! comprehensive search operations using the Search API. //! //! # What This Example Demonstrates //! //! 1. **Schema Conf...
2795d46628d418d172552a4e84f356a8ab629177b13a35c9181ecc0be7751b23
Rust
24,941
692
//! This module implements a scorecard for tracking active requests. //! //! The principle behind a scorecard is that traffic gets tagged with string labels, and then said //! string labels become the basis for tracking and reporting on the traffic. A set of application //! rules define wildcard patterns that match th...
74f5f720dc8a783816df53b9013de84683066552d5f79a447662f09a347c0606
Rust
25,083
642
//! Model-based coverage of the complete local frontend, log, compactor and HNSW stack. //! Small ID spaces deliberately generate duplicate adds and add/delete/add histories. use std::{collections::BTreeMap, path::Path, time::Duration}; use chroma_cache::{CacheConfig, FoyerCacheConfig}; use chroma_config::{registry::R...
2c1b41784b159b2408b450eeb11332c0e229f1295f91475f85451e5b92007203
Rust
25,092
651
use chroma_blockstore::BlockfileReader; use chroma_types::{SignedRoaringBitmap, SparsePostingBlock}; use half::f16; enum CursorSource<'view> { /// All blocks are fully deserialized in memory. Eager { blocks: Vec<SparsePostingBlock> }, /// Raw serialized byte slices borrowed from the Arrow block cache. ...
5e40c7ecea2da7aa18ffc17c7c67f7670987dcd3296666ce0d92ad84b2573a2b
Rust
25,356
680
use chroma_blockstore::config::BlockfileProviderConfig; use chroma_config::assignment; use chroma_config::helpers::deserialize_duration_from_seconds; use chroma_index::config::{HnswProviderConfig, SpannProviderConfig}; use chroma_log::config::LogConfig; use chroma_segment::bloom_filter::BloomFilterManagerConfig; use ch...
5a7de36c45301e17ae37bd0a9c1086505dd558edd6824427d879062124cc4221
Rust
25,771
417
#![recursion_limit = "256"] use chroma_benchmark::datasets::wikipedia_splade::WikipediaSplade; use chroma_blockstore::arrow::provider::BlockfileReaderOptions; use chroma_blockstore::{test_arrow_blockfile_provider, BlockfileWriterOptions}; use chroma_index::fulltext::types::{DocumentMutation, FullTextIndexReader, FullT...
abf2087bcd5648a9d452cb0b0c181c01d26c91477c7c07555dc24faef60451a7
Rust
25,927
675
use crate::{blockfile_record::RecordSegmentReaderOptions, spann_provider::SpannProvider}; use super::{ blockfile_metadata::MetadataSegmentWriterShard, blockfile_record::RecordSegmentWriterShard, bloom_filter::BloomFilterManager, distributed_hnsw::DistributedHNSWSegmentWriter, types::materialize_logs, }; us...
b7d8bbbad6874ea5c861ebff0237b85ac5b250375cef97ff7f6fa79c5bffef4a
Rust
25,949
668
//! The Foundation MCP server: the [`FoundationMcpServer`] handler plus its //! `subagent_search` / `search` / `read_page` tools and server //! instructions. use axum::http::{request::Parts, HeaderMap}; use mdac::ScorecardGuard; use rmcp::{ handler::server::{router::tool::ToolRouter, wrapper::Parameters}, mode...
4c74ccaa2b09318eb7a802ce7372ef93ffca1b2bccb85a7bbd4d66a422c0eedd
Rust
26,117
663
use async_trait::async_trait; use chroma_blockstore::provider::BlockfileProvider; use chroma_error::ChromaError; use chroma_log::Log; use chroma_segment::types::HydratedMaterializedLogRecord; use chroma_segment::{ blockfile_record::{ RecordSegmentReader, RecordSegmentReaderOptions, RecordSegmentReaderShard,...
6dd79c65acc8f63b69bfd5334ddef1d3a51c0eb129bd3fab9ad2cdbebc431047
Rust
26,131
723
use crate::work_queue::types::{WorkQueueError, WorkQueueRecord}; use arrow::array::{Array, Int32Array, Int64Array, StringArray, UInt64Array}; use arrow::datatypes::{DataType, Field, Schema}; use arrow::record_batch::RecordBatch; use bytes::Bytes; use chroma_types::{AttachedFunctionUuid, CollectionUuid}; use parquet::ar...
db79e3fc968eede8fdee913a77b68c498b3d019455182ce79283439bad38218d
Rust
26,151
721
use crate::{ hnsw_configuration::Space, regex::hir::ChromaHir, Collection, CollectionAndSegments, CollectionUuid, DocumentExpression, DocumentOperator, EmbeddingFunctionConfiguration, EmbeddingFunctionNewConfiguration, IncludeList, InternalCollectionConfiguration, InternalHnswConfiguration, InternalSpan...
ad1a0db26366fd2a516c1944801c22aae2ec78ed90ba348a3bd9170706f99ed3
Rust
26,237
836
use std::collections::{BTreeMap, BTreeSet}; use chroma::client::ChromaHttpClientError; use chroma::types::{ ConditionalCommitResult, Include, IncludeList, Metadata, MetadataValue, UpdateMetadata, UpdateMetadataValue, }; use chroma::{ChromaCollection, ChromaHttpClient, ChromaHttpClientOptions}; use proptest::pr...
b054655b677ccc85f170d75e23278a3dd9565329efd46618d09d8b891cda4992
Rust
26,344
774
use super::{ block::{Block, BlockToBytesError}, sparse_index::{SparseIndexReader, SparseIndexValue, SparseIndexWriter, SparseIndexWriterData}, types::{ArrowReadableKey, ArrowWriteableKey}, }; use crate::{arrow::sparse_index::SparseIndexDelimiter, key::CompositeKey}; use arrow::{ array::{ Array, ...
3a1429a9eb41fd74d3771e3e3f0347044edca3b2c6da851bbb2ce24ad3994b80
Rust
27,217
749
use std::collections::HashMap; use async_trait::async_trait; use chroma_blockstore::provider::BlockfileProvider; use chroma_error::ChromaError; use chroma_segment::{ blockfile_metadata::{MetadataSegmentError, MetadataSegmentReaderShard}, blockfile_record::{ RecordSegmentReaderOptions, RecordSegmentRea...
80182d6e102d5f4939028756ff530f90b0ab30c64ce33768208679459222f47f
Rust
27,562
734
use chroma_blockstore::arrow::provider::BlockManager; use chroma_blockstore::test_utils::sparse_index_test_utils::create_test_sparse_index; use chroma_blockstore::RootManager; use chroma_index::hnsw_provider::{HnswIndexProvider, FILES}; use chroma_index::usearch::USearchIndex; use chroma_index::IndexUuid; use chroma_se...
0a0b338e98e4c13b8f1c05f1b1bd251b409fa9547594c82eadccd8e7ecf6dc33
Rust
28,087
748
use crate::types::{VersionGraph, VersionStatus}; use async_trait::async_trait; use chroma_error::{ChromaError, ErrorCodes}; use chroma_system::{Operator, OperatorType}; use chroma_types::CollectionUuid; use chrono::{DateTime, Utc}; use petgraph::visit::Topo; use std::collections::{BTreeMap, HashMap, HashSet}; use thise...
d94b2ce13b52b9bac8ea8f4fe9cf644eb21134c05e7ce7e8282ddb2e3ec2395c
Rust
28,210
697
use std::{ collections::{HashMap, HashSet}, sync::Arc, }; use async_trait::async_trait; use chroma_error::{ChromaError, ErrorCodes}; use chroma_log::Log; use chroma_storage::Storage; use chroma_system::{Operator, OperatorType}; use chroma_types::{CollectionUuid, DatabaseName, TopologyName}; use futures::future...
ee28bd26367d00c0d0f53309f46ea08b5a02f60eda402a7d72cffe5cb448e66d
Rust
28,894
801
use crate::{ operators::{ fetch_lineage_file::{ FetchLineageFileError, FetchLineageFileInput, FetchLineageFileOperator, FetchLineageFileOutput, }, fetch_version_file::{ FetchVersionFileError, FetchVersionFileInput, FetchVersionFileOperator, Fet...
6cf258ddc118fdc160533b1faeb00d0f718929281f1545eedec74ff83661f8ef
Rust
28,955
854
use super::utils::to_records; use chroma_api_types::{OccReadMode, StaleReadError}; use chroma_distance::DistanceFunction; use chroma_error::ChromaError; use chroma_segment::test::TestReferenceSegment; use chroma_types::operator::{Filter, KnnBatch, KnnProjection, Limit, Projection, Scan}; use chroma_types::plan::{Count,...
21e93fb8eba63367a12c6ac06fc2199d86f1837a62f2d8781dc40272e3b195cc
Rust
29,034
955
use crate::key::{CompositeKey, KeyWrapper}; use chroma_error::ChromaError; use chroma_types::{DataRecord, QuantizedCluster, SpannPostingList, SparsePostingBlock}; use parking_lot::RwLock; use roaring::RoaringBitmap; use std::{ collections::{BTreeMap, HashMap}, sync::Arc, }; pub trait Writeable { fn write_t...
8a050244cf82fe944e0d43351f57d855f3f513e4c951ddc70af4e589f2181b29
Rust
29,046
805
use crate::{ execution::plan::SearchPayload, operator::{Aggregate, GroupBy, QueryVector, Rank}, CollectionMetadataUpdate, Metadata, MetadataValue, Schema, UpdateMetadata, UpdateMetadataValue, DOCUMENT_KEY, EMBEDDING_KEY, }; use regex::Regex; use std::collections::HashMap; use std::str::FromStr; use std:...
3256c0c042eabfd10b82c268214ff1b093221f0af0ac7924bf50c8f0a4960130
Rust
29,057
805
use super::memberlist_provider::Memberlist; use async_trait::async_trait; use chroma_config::assignment::{ assignment_policy::AssignmentPolicy, rendezvous_hash::AssignmentError, }; use chroma_error::ChromaError; use chroma_system::{Component, ComponentContext, Handler}; use chroma_tracing::GrpcClientTraceService; u...
23767385ad3f417305ab07b9192f7e514ec7380a6f774923cc1bb7e22b639f88
Rust
29,499
901
//! Chroma Cloud embedding function implementations. //! //! This module mirrors the Python `chromadb` Chroma Cloud embedding functions: //! `chroma-cloud-qwen` for dense embeddings and `chroma-cloud-splade` for sparse embeddings. use std::{collections::HashMap, env}; use chroma_types::{ EmbeddingFunctionConfigur...
c4b33a07f9dcaf6b904c9487321e94366b12cf17876e219dbebc74a3c9fb8943
Rust
29,983
814
use std::collections::HashMap; use async_trait::async_trait; use chroma_error::{ChromaError, ErrorCodes}; use chroma_segment::{ blockfile_metadata::MetadataSegmentError, blockfile_record::{ ApplyMaterializedLogError, RecordSegmentReaderShardCreationError, RecordSegmentWriterShardCreationError, ...
b82cf3f5dd10e83508dbabcd4285d10114d414bec6ab8ee22bf2c59350c54d22
Rust
30,125
904
mod mocks; use std::sync::{Arc, Mutex}; use setsum::Setsum; use mocks::MockManifestPublisher; use wal3::{ unprefixed_snapshot_path, Error, Fragment, FragmentIdentifier, FragmentSeqNo, Garbage, LogPosition, Snapshot, SnapshotCache, SnapshotPointer, }; // Mock implementations for testing #[derive(Default)] st...