Skip to content

Commit ae1c170

Browse files
committed
docs: update dir documentation
Signed-off-by: Ramiz Polic <[email protected]>
1 parent 353b85e commit ae1c170

File tree

4 files changed

+190
-64
lines changed

4 files changed

+190
-64
lines changed

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Build
22
.build/
3+
venv/
4+
35
# Dependencies
46
.dep/
57

Diff for: README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ Markdown.
1818

1919
## Installation
2020

21-
To build the documentation locally, you need to install Taskfile.
21+
To build the documentation locally, you need to install required dependencies.
22+
23+
**Prerequisites**
24+
25+
- [Taskfile](https://taskfile.dev/)
26+
- [Python](https://www.python.org/downloads/)
27+
- [Golang](https://go.dev/doc/devel/release#go1.24.0)
2228

2329
### macOS
2430

Diff for: Taskfile.yml

+6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ tasks:
2828
deps:
2929
- deps/venv
3030
- deps/proto-diagrams
31+
preconditions:
32+
- which go
33+
- which python
3134
env:
3235
SOURCE_DIR: "{{.ROOT_DIR}}/docs"
3336
SCHEMA_DIR: "{{.ROOT_DIR}}/schema"
@@ -43,6 +46,9 @@ tasks:
4346
# Note that sometimes it crashes and goes into reload loop. Investigate or find alternative.
4447
run:
4548
desc: Run documentation website in live editing mode
49+
preconditions:
50+
- which go
51+
- which python
4652
watch: true
4753
sources:
4854
- 'docs/**/*'

Diff for: docs/pages/dir-howto.md

+175-63
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,242 @@
1+
# Getting started
12

2-
# Getting Started
3+
The Agent Directory (dir) allows publication, exchange and discovery of information about AI agents over a distributed peer-to-peer network.
4+
It leverages [OASF](https://github.com/agntcy/oasf) to describe agents and provides a set of APIs and tools to build, store, publish and discover agents across the network by their attributes and constraints.
5+
Directory also leverages [CSIT](https://github.com/agntcy/csit) for continuous system integration and testing across different versions, environments, and features.
36

47
## Features
58

6-
- _Standards_ - Defines standard schema for data representation and exchange.
7-
- _Dev Kit_ - Tooling to facilitate API interaction and generation of agent data models from different sources.
8-
- _Plugins_ - Supports model schema and build plugins to enrich agent data models for custom use-cases.
9-
- _Announce_ - Enables publication of records to the network.
10-
- _Discover_ - Listen and retreive records published on the network.
11-
- _Search_ - Supports searching of records across the network that satisfy given attributes and constraints.
12-
- _Security_ - Relies on well-known security principles to provide data provenance, integrity and ownership.
9+
- **Data Models** - Defines a standard schema for data representation and exchange.
10+
- **Dev Kit** - Provides CLI tooling to simplify development workflows and facilitate API interactions.
11+
- **Plugins** - Pluggable components to extend the build process of agent data models for custom use-cases.
12+
- **Announce** - Allows publication of agent data models to the network.
13+
- **Discover** - Listen, search, and retrieve agents across the network by their attributes and constraints.
14+
- **Security** - Relies on well-known security principles to provide data provenance, integrity and ownership.
1315

1416
## Prerequisites
1517

18+
To build the project and work with the code, you will need the following installed in your system
19+
1620
- [Taskfile](https://taskfile.dev/)
1721
- [Docker](https://www.docker.com/)
18-
- Golang
22+
- [Golang](https://go.dev/doc/devel/release#go1.24.0)
1923

20-
## Artifacts distribution
24+
Make sure Docker is installed with Buildx.
2125

22-
### Golang Packages
26+
## Development
2327

24-
See [API package](https://pkg.go.dev/github.com/agntcy/dir/api), [Server package](https://pkg.go.dev/github.com/agntcy/dir/server) and [CLI package](https://pkg.go.dev/github.com/agntcy/dir/cli).
28+
Use `Taskfile` for all related development operations such as testing, validating, deploying, and working with the project.
2529

26-
### Binaries
30+
### Clone the repository
2731

28-
See https://github.com/agntcy/dir/releases
32+
```bash
33+
git clone https://github.com/agntcy/dir
34+
cd dir
35+
```
2936

30-
### Container images
37+
### Initialize the project
38+
39+
This step will fetch all project dependencies and prepare the environment for development.
3140

3241
```bash
33-
docker pull ghcr.io/agntcy/dir-ctl:latest
34-
docker pull ghcr.io/agntcy/dir-apiserver:latest
42+
task deps
3543
```
3644

37-
### Helm charts
45+
### Make changes
46+
47+
Make the changes to the source code and rebuild for later testing.
3848

3949
```bash
40-
helm pull ghcr.io/agntcy/dir/helm-charts/dir:latest
50+
task build
4151
```
4252

43-
## Development
44-
45-
Use `Taskfile` for all related development operations such as testing, validating, deploying, and working with the project.
53+
### Test changes
4654

47-
To execute the test suite locally, run:
55+
The local testing pipeline relies on Golang to perform unit tests, and
56+
Docker to perform E2E tests in an isolated Kubernetes environment using Kind.
4857

4958
```bash
50-
task gen
51-
task build
59+
task test:unit
5260
task test:e2e
5361
```
5462

63+
## Artifacts distribution
64+
65+
All artifacts are tagged using the [Semantic Versioning](https://semver.org/) and follow the checked out source code tags.
66+
It is not advised to use artifacts with mismatching versions.
67+
68+
### Container images
69+
70+
All container images are distributed via [GitHub Packages](https://github.com/orgs/agntcy/packages?repo_name=dir).
71+
72+
```bash
73+
docker pull ghcr.io/agntcy/dir-ctl:v0.2.0
74+
docker pull ghcr.io/agntcy/dir-apiserver:v0.2.0
75+
```
76+
77+
### Helm charts
78+
79+
All helm charts are distributed as OCI artifacts via [GitHub Packages](https://github.com/agntcy/dir/pkgs/container/dir%2Fhelm-charts%2Fdir).
80+
81+
```bash
82+
helm pull oci://ghcr.io/agntcy/dir/helm-charts/dir --version v0.2.0
83+
```
84+
85+
### Binaries
86+
87+
All release binaries are distributed via [GitHub Releases](https://github.com/agntcy/dir/releases).
88+
89+
### SDKs
90+
91+
- **Golang** - [github.com/agntcy/dir/api](https://pkg.go.dev/github.com/agntcy/dir/api), [github.com/agntcy/dir/cli](https://pkg.go.dev/github.com/agntcy/dir/cli), [github.com/agntcy/dir/server](https://pkg.go.dev/github.com/agntcy/dir/server)
92+
5593
## Deployment
5694

57-
To deploy the Directory, you can use the provided `Taskfile` commands to start the necessary services and deploy the Directory server. Alternatively, you can deploy from a GitHub Helm chart release.
95+
Directory API services can be deployed either using the `Taskfile` or directly via released Helm chart.
5896

59-
### Local Deployment
97+
### Using Taskfile
6098

61-
To start a local OCI registry server for storage and the Directory server, use the following commands:
99+
This will start the necessary components such as storage and API services.
62100

63101
```bash
64-
task server:store:start
65102
task server:start
66103
```
67104

68-
These commands will set up a local environment for development and testing purposes.
105+
### Using Helm chart
106+
107+
This will deploy Directory services into an existing Kubernetes cluster.
108+
109+
```bash
110+
helm pull oci://ghcr.io/agntcy/dir/helm-charts/dir --version v0.2.0
111+
helm upgrade --install dir oci://ghcr.io/agntcy/dir/helm-charts/dir --version v0.2.0
112+
```
113+
114+
## Usage
115+
116+
This document defines a basic overview of main Directory features, components, and usage scenarios.
117+
118+
> Although the following example is shown for CLI-based usage scenario,
119+
there is an effort on exposing the same functionality via SDKs.
120+
121+
### Requirements
122+
123+
- Directory CLI client, distributed via [GitHub Releases](https://github.com/agntcy/dir/releases)
124+
- Directory API server, outlined in the [Deployment](#deployment) section.
69125

70-
### Remote Deployment
126+
### Build
71127

72-
To deploy the Directory into an existing Kubernetes cluster, use a released Helm chart from GitHub with the following commands:
128+
This example demonstrates the examples of a data model and how to build such models using provided tooling to prepare for publication.
129+
130+
Generate an example agent that matches the data model schema defined in [Agent Data Model](api/core/v1alpha1/agent.proto) specification.
73131

74132
```bash
75-
helm pull oci://ghcr.io/agntcy/dir/helm-charts/dir --version v0.1.3
76-
helm upgrade --install dir oci://ghcr.io/agntcy/dir/helm-charts/dir --version v0.1.3
133+
cat << EOF > model.json
134+
{
135+
"name": "my-agent",
136+
"skills": [
137+
{"category_name": "Text Generation"},
138+
{"category_name": "Fact Extraction"}
139+
]
140+
}
141+
EOF
77142
```
78143

79-
These commands will pull the latest version of the Directory Helm chart from the GitHub Container Registry and install or upgrade the Directory in your Kubernetes cluster. Ensure that your Kubernetes cluster is properly configured and accessible before running these commands. The `helm upgrade --install` command will either upgrade an existing release or install a new release if it does not exist.
144+
Alternatively, build the same agent data model using the CLI client.
145+
The build process allows additional operations to be performed,
146+
which is useful for agent model enrichment and other custom use-cases.
80147

81-
## Usage
148+
```bash
149+
# Define the build config
150+
cat << EOF > build.config.yml
151+
builder:
152+
# Base agent model path
153+
base-model: "model.json"
154+
155+
# Disable the LLMAnalyzer plugin
156+
llmanalyzer: false
82157
83-
The Directory CLI provides `build`, `push`, and `pull` commands to interact with the Directory server. Below are the details on how to run each command.
158+
# Disable the runtime plugin
159+
runtime: false
160+
EOF
84161

85-
To run these commands, you can either:
86-
* Download a released CLI binary with `curl -L -o dirctl https://github.com/agntcy/dir/releases/download/<release tag>/dirctl-$(uname | tr '[:upper:]' '[:lower:]')-$(uname -m)`
87-
* Use a binary compiled from source with `task cli:compile`
88-
* Use CLI module from source by navigating to the `cli` directory and running `go run cli.go <command> <args>`
162+
# Build the agent
163+
dirctl build . > built.model.json
89164

90-
### Build Command
165+
# Override above example
166+
mv built.model.json model.json
167+
```
168+
169+
### Store
91170

92-
The `build` command is used to compile and build the agent data model.
171+
This example demonstrates the interaction with the local storage layer.
172+
It is used as an content-addressable object store for Directory-specific models and serves both the local and network-based operations (if enabled).
93173

94-
Usage:
95174
```bash
96-
dirctl build [options]
175+
# push and store content digest
176+
dirctl push model.json > model.digest
177+
DIGEST=$(cat model.digest)
178+
179+
# pull
180+
dirctl pull $DIGEST
181+
182+
# lookup
183+
dirctl info $DIGEST
97184
```
98185

99-
Options:
100-
- `--config-file` : Path to the agent build configuration file. Please note that other flags will override the build configuration from the file. Supported formats: YAML. Example template: cli/build.config.yaml.
186+
### Announce
101187

102-
### Push Command
188+
This examples demonstrates how to publish the data to allow content discovery.
189+
To avoid stale data, it is recommended to republish the data periodically
190+
as the data across the network has TTL.
103191

104-
The `push` command is used to publish the built agent data model to the store. The input data model should be JSON formatted.
192+
Note that this operation only works for the objects already pushed to local storage layer, ie.
193+
you must first push the data before being able to perform publication.
105194

106-
Usage:
107195
```bash
108-
dirctl push [options]
196+
# Publish the data to your local data store.
197+
dirctl publish $DIGEST
198+
199+
# Publish the data across the network.
200+
dirctl publish $DIGEST --network
109201
```
110202

111-
Options:
112-
- `--from-file` : Read compiled data from JSON file, reads from STDIN if empty.
113-
- `--server-addr`: Directory Server API address (default "0.0.0.0:8888")
203+
If the data is not published to the network, it cannot be discovered by other peers.
204+
For published data, peers may try to reach out over network
205+
and request specific objects for verification and replication.
206+
Network publication may fail if you are not connected to any peers.
207+
208+
### Discover
114209

115-
Example usage with read from STDIN: `dirctl build <args> | dirctl push`.
210+
This examples demonstrates how to discover published data locally or across the network.
211+
This API supports both unicast- mode for routing to specific objects,
212+
and multicast mode for attribute-based matching and routing.
116213

117-
### Pull Command
214+
There are two modes of operation, a) local mode where the data is queried from the local data store, and b) network mode where the data is queried across the network.
118215

119-
The `pull` command is used to retrieve agent data model from the store. The output data model will be JSON formatted.
216+
Discovery is performed using full-set label matching, ie. the results always fully match the requested query.
217+
Note that it is not guaranteed that the data is available, valid, or up to date as results.
120218

121-
Usage:
122219
```bash
123-
dirctl pull [options]
220+
# Get a list of peers holding a specific agent data model
221+
dirctl list --digest $DIGEST
222+
223+
# Discover the agent data models in your local data store that can fully satisfy your search query.
224+
dirctl list "/skills/Text Generation"
225+
dirctl list "/skills/Text Generation" "/skills/Fact Extraction"
226+
227+
# Discover the agent data models across the network that can fully satisfy your search query.
228+
dirctl list "/skills/Text Generation" --network
229+
dirctl list "/skills/Text Generation" "/skills/Fact Extraction" --network
124230
```
125231

126-
Options:
127-
- `--digest` : Digest of the agent to pull.
128-
- `--server-addr`: Directory Server API address (default "0.0.0.0:8888")
232+
It is also possible to get an aggregated summary about the data held in your local data store or across the network.
233+
This is used for routing decisions when traversing the network.
234+
Note that for network search, you will not query your own data, but only the data of other peers.
129235

130-
Example usage in combination with other commands: `dirctl pull --digest $(dirctl build | dirctl push)`.
236+
```bash
237+
# Get a list of labels and basic summary details about the data you currently have in your local data store.
238+
dirctl list info
239+
240+
# Get a list of labels and basic summary details about the data you across the reachable network.
241+
dirctl list info --network
242+
```

0 commit comments

Comments
 (0)