Skip to content

Commit 1c0293d

Browse files
committed
docs: restructure docs
1 parent 81441b5 commit 1c0293d

8 files changed

Lines changed: 404 additions & 47 deletions

File tree

docs/concepts/sdk_concepts.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# SDK Concepts
2+
3+
## About the Client-Resource Architecture
4+
5+
The Deepset API SDK is designed around a client-resource pattern that reflects how the deepset platform organizes its services.
6+
7+
At the core is the `AsyncDeepsetClient`, which serves as your gateway to the platform. The client exposes resource classes
8+
for each platform component.
9+
10+
The resource classes themselves act as domain-specific interfaces.
11+
12+
Accessing resources through a shared client instance is easy by leveraging the built-in async context manager. Resources,
13+
and connections are cleaned up automatically, as soon as we exit the context.
14+
15+
This design enables the SDK to provide both type safety and operational clarity.
16+
Each resource class knows its domain deeply, while the client handles cross-cutting concerns like authentication and connection pooling.
17+
18+
## Understanding Resource Scoping
19+
20+
The platform distinguishes between two fundamental scoping patterns:
21+
22+
**Workspace-scoped resources** operate within specific project boundaries. This scoping exists because these resources often contain sensitive data, custom business logic, or project-specific configurations that shouldn't leak between environments:
23+
24+
- **Pipelines**: AI workflows containing your custom logic and data processing rules
25+
- **Indexes**: Document storage systems with your proprietary data
26+
- **Pipeline Templates**: Reusable configurations specific to your use cases
27+
- **Custom Components**: Your domain-specific Haystack components
28+
29+
**Global resources** operate at the platform level because they represent shared infrastructure or account-level concerns:
30+
31+
- **Workspaces**: Project organization and isolation boundaries
32+
- **Integrations**: Platform-wide service connections and credentials
33+
- **Secrets**: Centralized credential management across projects
34+
- **Users**: Account and identity management
35+
- **Haystack Service**: Shared component schemas and metadata
36+
37+
This scoping model enables both isolation (workspace resources) and efficiency (global resources), allowing teams to work independently while sharing common platform services.
38+
39+
## Why Asynchronous by Design
40+
41+
The SDK's async-first design reflects the reality of modern AI applications. Unlike traditional CRUD operations, AI workloads involve:
42+
43+
- **Long-running operations**: Pipeline deployments and large document indexing
44+
- **Streaming responses**: Real-time text generation and search results
45+
- **High concurrency needs**: Processing multiple queries simultaneously
46+
- **Variable response times**: AI operations can take seconds to minutes
47+
48+
Asynchronous operations allow your application to remain responsive during these long-running tasks. The async context manager pattern ensures proper resource cleanup, which is critical when dealing with HTTP connections and streaming responses.

docs/api_sdk.md renamed to docs/guides/api_sdk.md

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -397,48 +397,3 @@ if valid.valid:
397397
```
398398

399399

400-
## Concepts
401-
402-
### About the Client-Resource Architecture
403-
404-
The Deepset API SDK is designed around a client-resource pattern that reflects how the deepset platform organizes its services.
405-
This architectural choice stems from the need to provide both unified access and clear resource boundaries.
406-
407-
At the core is the `AsyncDeepsetClient`, which serves as your gateway to the platform. The client exposes resource classes
408-
for each platform component. This separation exists because each resource type has distinct lifecycles, permissions, and operational patterns.
409-
410-
The resource classes themselves act as domain-specific interfaces.
411-
412-
This design enables the SDK to provide both type safety and operational clarity. Each resource class knows its domain deeply, while the client handles cross-cutting concerns like authentication and connection pooling.
413-
414-
### Understanding Resource Scoping
415-
416-
The platform distinguishes between two fundamental scoping patterns:
417-
418-
**Workspace-scoped resources** operate within specific project boundaries. This scoping exists because these resources often contain sensitive data, custom business logic, or project-specific configurations that shouldn't leak between environments:
419-
420-
- **Pipelines**: AI workflows containing your custom logic and data processing rules
421-
- **Indexes**: Document storage systems with your proprietary data
422-
- **Pipeline Templates**: Reusable configurations specific to your use cases
423-
- **Custom Components**: Your domain-specific Haystack components
424-
425-
**Global resources** operate at the platform level because they represent shared infrastructure or account-level concerns:
426-
427-
- **Workspaces**: Project organization and isolation boundaries
428-
- **Integrations**: Platform-wide service connections and credentials
429-
- **Secrets**: Centralized credential management across projects
430-
- **Users**: Account and identity management
431-
- **Haystack Service**: Shared component schemas and metadata
432-
433-
This scoping model enables both isolation (workspace resources) and efficiency (global resources), allowing teams to work independently while sharing common platform services.
434-
435-
### Why Asynchronous by Design
436-
437-
The SDK's async-first design reflects the reality of modern AI applications. Unlike traditional CRUD operations, AI workloads involve:
438-
439-
- **Long-running operations**: Pipeline deployments and large document indexing
440-
- **Streaming responses**: Real-time text generation and search results
441-
- **High concurrency needs**: Processing multiple queries simultaneously
442-
- **Variable response times**: AI operations can take seconds to minutes
443-
444-
Asynchronous operations allow your application to remain responsive during these long-running tasks. The async context manager pattern ensures proper resource cleanup, which is critical when dealing with HTTP connections and streaming responses.

0 commit comments

Comments
 (0)