Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
/python/packages/claude/ @chetantoshniwal @eavanvalkenburg @giles17 @moonbox3
/python/packages/copilotstudio/ @chetantoshniwal @eavanvalkenburg @giles17 @moonbox3
/python/packages/core/ @chetantoshniwal @eavanvalkenburg @moonbox3 @TaoChenOSU @jpalvarezl @giles17
/python/packages/core/agent_framework/_in_memory.py @chetantoshniwal @westey-m @eavanvalkenburg @giles17 @moonbox3 @TaoChenOSU @jpalvarezl @peibekwe @baywet @rogerbarreto @SergeyMenshykh
/python/packages/core/agent_framework/_vector_filters.py @chetantoshniwal @westey-m @eavanvalkenburg @giles17 @moonbox3 @TaoChenOSU @jpalvarezl @peibekwe @baywet @rogerbarreto @SergeyMenshykh
/python/packages/core/agent_framework/_vectors.py @chetantoshniwal @westey-m @eavanvalkenburg @giles17 @moonbox3 @TaoChenOSU @jpalvarezl @peibekwe @baywet @rogerbarreto @SergeyMenshykh
/python/packages/core/agent_framework/_workflows/ @chetantoshniwal @eavanvalkenburg @moonbox3 @TaoChenOSU @jpalvarezl
/python/packages/core/agent_framework/_harness/ @chetantoshniwal @westey-m @eavanvalkenburg @moonbox3
Expand Down
167 changes: 139 additions & 28 deletions docs/features/vector-stores-and-embeddings/README.md

Large diffs are not rendered by default.

39 changes: 36 additions & 3 deletions python/packages/core/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,50 @@ agent_framework/
- **`@tool`** decorator - Converts functions to tools
- **`use_function_invocation()`** - Decorator to add automatic function calling to chat clients

### Vector stores (`_vectors.py`)
### Vector stores

The vector store API is experimental under the shared `VECTOR_STORES` feature ID.

- **`@vectorstoremodel`** - Declares key, data, and vector fields on dataclasses, Pydantic models, and plain classes
- **`register_vectorstoremodel`** - Registers one definition and msgspec-backed codec pair per model type
- **`VectorStoreField`** - Frozen core key/data/vector metadata; common index and distance values remain open to
provider-defined strings, key fields can be store-generated, and copied `provider_annotations` remains mutable for
connector-specific configuration
- **`Filter` / `FilterGroup`** - Mutable data-only filter inputs shared by local and remote vector stores; collection
operations bound structural traversal before copying and pass an independent snapshot to connectors. Parameter
detection includes collection members and mapping keys; string operators require string operands after resolution
- **`Param`** - Native typed search-tool parameter reference embedded in filter values or paging options
- Defaults and supplied mutable values are copied per filter invocation, including for definition-less search tools
- Filter parameters may opt into null omission with a nullable type and explicit `default=None`, such as
`Param("text", str | None, default=None, omit_if_none=True)`; absent/null arguments remove that leaf, while
remaining AND/OR children still apply. Empty groups (including NOT with an omitted child) are removed
recursively; removing the whole tree means no filter. Paging parameters do not support null omission.
- **`BaseVectorCollection`** - Base class for collection lifecycle and msgspec-backed record CRUD operations;
upserts generate embeddings by default and retrieval excludes vectors by default
upserts generate embeddings by default, retrieval excludes vectors by default, and filtered retrieval is an
alternate mode to key lookup
- **Embedding generation selection** - `generate_vectors=True` regenerates every vector field, `False` preserves all
values, and a list or tuple of logical vector field names generates only those fields so connectors can combine
local, precomputed, and provider-side vectorization
- **Vector payloads** - Shared dense query/generated vectors accept numeric sequences and binary bytes; connectors
declare supported element/representation types. Sparse vectors remain provider-native through codecs or
`search(values=...)`, not a core sparse type.
- **Vector dimensions** - Final dense sequence lengths are checked after optional generation for the whole write
batch before connector conversion or writes, and for the selected query field before search dispatch. In-memory
queries also check their normalized numeric sequence, including array-like inputs and empty collections. These
are length checks, not element validation; null vectors, source text, binary payloads, and non-sequence
provider-native representations remain connector-owned.
- **`BaseVectorStore`** - Base class for stores that create collection clients
- **`BaseVectorSearch`** - Base class for vector and keyword-hybrid search
- **`BaseVectorSearch`** - Base class for vector and keyword-hybrid search; core validates portable requests and
deserializes results without interpreting thresholds or re-filtering returned scores. Connectors own scoring,
filter execution, score thresholds (including provider-defined/default metrics), and paging. Use native backend
execution where available, otherwise an explicit connector-local fallback or reject unsupported options
- **`create_vector_search_tool`** - Creates an agent tool from any `SupportsVectorSearch` implementation
- **`InMemoryCollection` / `InMemoryStore`** - Dependency-free, process-local development and test implementation;
cosine scoring scales finite inputs, all metrics reject non-finite scores, and unsupported distance functions
fail before record scanning. Hamming scores/thresholds use the fraction of unequal dimensions, not a count.
Scoring, filtering, and thresholds run locally before paging; `DEFAULT` means cosine distance and uses a maximum
distance threshold.
Shared serialization normalizes stored data; codecs and connector overrides remain trusted Python code
- **`SupportsVectorUpsert`** / **`SupportsVectorSearch`** - Structural protocols for vector store capabilities

### Middleware (`_middleware.py`)
Expand Down
20 changes: 20 additions & 0 deletions python/packages/core/agent_framework/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,25 @@
"validate_tool_mode",
"validate_tools",
),
"._in_memory": (
"InMemoryCollection",
"InMemoryStore",
),
"._vector_filters": (
"Filter",
"FilterGroup",
"FilterGroupOperator",
"FilterOperator",
"Param",
),
"._vectors": (
"DISTANCE_FUNCTION_DIRECTION_HELPER",
"BaseVectorCollection",
"BaseVectorSearch",
"BaseVectorStore",
"DistanceFunction",
"FieldTypes",
"GenerateVectors",
"IndexKind",
"SearchResponse",
"SearchResults",
Expand Down Expand Up @@ -493,6 +505,10 @@
"FileSkillsSource",
"FileStoreEntry",
"FileSystemAgentFileStore",
"Filter",
"FilterGroup",
"FilterGroupOperator",
"FilterOperator",
"FilteringSkillsSource",
"FinalT",
"FinishReason",
Expand All @@ -507,13 +523,16 @@
"FunctionalWorkflow",
"FunctionalWorkflowAgent",
"FunctionalWorkflowDefinition",
"GenerateVectors",
"GeneratedEmbeddings",
"GraphConnectivityError",
"HistoryProvider",
"InMemoryAgentFileStore",
"InMemoryCheckpointStorage",
"InMemoryCollection",
"InMemoryHistoryProvider",
"InMemorySkillsSource",
"InMemoryStore",
"InProcRunnerContext",
"IndexKind",
"InlineSkill",
Expand Down Expand Up @@ -543,6 +562,7 @@
"MiddlewareTypes",
"OuterFinalT",
"OuterUpdateT",
"Param",
"RawAgent",
"ReleaseCandidateFeature",
"ResponseStream",
Expand Down
11 changes: 11 additions & 0 deletions python/packages/core/agent_framework/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ from ._harness._tool_approval import (
create_always_approve_tool_response,
create_always_approve_tool_with_arguments_response,
)
from ._in_memory import InMemoryCollection, InMemoryStore
from ._mcp import (
MCPStdioTool,
MCPStreamableHTTPTool,
Expand Down Expand Up @@ -250,13 +251,15 @@ from ._types import (
validate_tool_mode,
validate_tools,
)
from ._vector_filters import Filter, FilterGroup, FilterGroupOperator, FilterOperator, Param
from ._vectors import (
DISTANCE_FUNCTION_DIRECTION_HELPER,
BaseVectorCollection,
BaseVectorSearch,
BaseVectorStore,
DistanceFunction,
FieldTypes,
GenerateVectors,
IndexKind,
SearchResponse,
SearchResults,
Expand Down Expand Up @@ -457,6 +460,10 @@ __all__ = [
"FileSkillsSource",
"FileStoreEntry",
"FileSystemAgentFileStore",
"Filter",
"FilterGroup",
"FilterGroupOperator",
"FilterOperator",
"FilteringSkillsSource",
"FinalT",
"FinishReason",
Expand All @@ -471,13 +478,16 @@ __all__ = [
"FunctionalWorkflow",
"FunctionalWorkflowAgent",
"FunctionalWorkflowDefinition",
"GenerateVectors",
"GeneratedEmbeddings",
"GraphConnectivityError",
"HistoryProvider",
"InMemoryAgentFileStore",
"InMemoryCheckpointStorage",
"InMemoryCollection",
"InMemoryHistoryProvider",
"InMemorySkillsSource",
"InMemoryStore",
"InProcRunnerContext",
"IndexKind",
"InlineSkill",
Expand Down Expand Up @@ -507,6 +517,7 @@ __all__ = [
"MiddlewareTypes",
"OuterFinalT",
"OuterUpdateT",
"Param",
"RawAgent",
"ReleaseCandidateFeature",
"ResponseStream",
Expand Down
Loading
Loading