Agent Catalog Configuration¶
Agent Catalog can be configured 1) on a per-instance-basis (for Catalog
and Span
instances),
2) globally using environment variables, or 3) globally using a .env
file.
Attention
Environment variables will always take priority over values loaded from a .env
file.
- pydantic model agentc_core.config.config.Config[source]¶
Bases:
EmbeddingModelConfig
,LocalCatalogConfig
,RemoteCatalogConfig
,ToolRuntimeConfig
,CommandLineConfig
,VersioningConfig
Show JSON schema
{ "title": "Config", "type": "object", "properties": { "catalog_id": { "default": "__LATEST__", "title": "Catalog Id", "type": "string" }, "verbosity_level": { "default": 0, "maximum": 2, "minimum": 0, "title": "Verbosity Level", "type": "integer" }, "with_interaction": { "default": true, "title": "With Interaction", "type": "boolean" }, "codegen_output": { "anyOf": [ { "format": "path", "type": "string" }, { "type": "null" } ], "default": null, "title": "Codegen Output" }, "tool_decorator": { "default": null, "title": "Tool Decorator" }, "refiner": { "default": null, "title": "Refiner" }, "secrets": { "anyOf": [ { "additionalProperties": { "format": "password", "type": "string", "writeOnly": true }, "type": "object" }, { "type": "null" } ], "title": "Secrets" }, "tool_model": { "$ref": "#/$defs/DataModelType", "default": "typing.TypedDict" }, "conn_string": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Conn String" }, "username": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Username" }, "password": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "title": "Password" }, "conn_root_certificate": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Conn Root Certificate" }, "bucket": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Bucket" }, "max_index_partition": { "default": 1024, "title": "Max Index Partition", "type": "integer" }, "index_partition": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Index Partition" }, "wait_until_ready_seconds": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": 5, "title": "Wait Until Ready Seconds" }, "ddl_create_index_interval_seconds": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": 1, "title": "Ddl Create Index Interval Seconds" }, "ddl_retry_attempts": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": 3, "title": "Ddl Retry Attempts" }, "ddl_retry_wait_seconds": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": 5, "title": "Ddl Retry Wait Seconds" }, "project_path": { "anyOf": [ { "format": "path", "type": "string" }, { "type": "null" } ], "default": null, "title": "Project Path" }, "catalog_path": { "anyOf": [ { "format": "path", "type": "string" }, { "type": "null" } ], "default": null, "title": "Catalog Path" }, "activity_path": { "anyOf": [ { "format": "path", "type": "string" }, { "type": "null" } ], "default": null, "title": "Activity Path" }, "embedding_model_name": { "default": "sentence-transformers/all-MiniLM-L12-v2", "title": "Embedding Model Name", "type": "string" }, "embedding_model_url": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Embedding Model Url" }, "embedding_model_auth": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Embedding Model Auth" }, "sentence_transformers_model_cache": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": ".model-cache", "title": "Sentence Transformers Model Cache" }, "sentence_transformers_retry_attempts": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": 3, "title": "Sentence Transformers Retry Attempts" }, "debug": { "default": false, "title": "Debug", "type": "boolean" } }, "$defs": { "DataModelType": { "enum": [ "pydantic.BaseModel", "pydantic_v2.BaseModel", "dataclasses.dataclass", "typing.TypedDict", "msgspec.Struct" ], "title": "DataModelType", "type": "string" } } }
- Config:
extra: str = ignore
env_prefix: str = AGENT_CATALOG_
env_file: str = .env
- Fields:
- Validators:
_use_verbosity_level_for_debug
»all fields
- field debug: bool = False¶
Whether or not to display debug messages from all Agent Catalog components.
By default, this value is False. If
AGENT_CATALOG_VERBOSITY_LEVEL
is set to 2, this value is set to True.- Validated by:
_catalog_and_activity_must_align_with_path
_use_verbosity_level_for_debug
- pydantic model agentc_core.config.config.RemoteCatalogConfig[source]¶
Show JSON schema
{ "title": "RemoteCatalogConfig", "type": "object", "properties": { "conn_string": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Conn String" }, "username": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Username" }, "password": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "title": "Password" }, "conn_root_certificate": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Conn Root Certificate" }, "bucket": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Bucket" }, "max_index_partition": { "default": 1024, "title": "Max Index Partition", "type": "integer" }, "index_partition": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Index Partition" }, "wait_until_ready_seconds": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": 5, "title": "Wait Until Ready Seconds" }, "ddl_create_index_interval_seconds": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": 1, "title": "Ddl Create Index Interval Seconds" }, "ddl_retry_attempts": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": 3, "title": "Ddl Retry Attempts" }, "ddl_retry_wait_seconds": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": 5, "title": "Ddl Retry Wait Seconds" } } }
- Config:
extra: str = ignore
env_prefix: str = AGENT_CATALOG_
env_file: str = .env
- Fields:
- Validators:
_certificate_path_must_be_valid_if_not_none
»conn_root_certificate
_conn_string_must_follow_supported_url_pattern
»conn_string
- field bucket: str | None = None¶
The name of the Couchbase bucket possessing the catalog.
This field must be specified with
conn_string
,username
, andpassword
.
- field conn_root_certificate: str | None = None¶
Path to the root certificate file for the Couchbase cluster.
This field is optional and only required if the Couchbase cluster is using a self-signed certificate. If specified, this field must be specified with
conn_string
,username
, andpassword
.- Validated by:
_certificate_path_must_be_valid_if_not_none
- field conn_string: str | None = None¶
Couchbase connection string that points to the catalog.
This Couchbase instance refers to the CB instance used with the
publish
command. If there exists no local catalog (e.g., this is deployed in a standalone environment), we will perform allfind
commands directly on the remote catalog. If this field AND$AGENT_CATALOG_PROJECT_PATH
are specified, we will issuefind
on both the remote and local catalog (with local catalog entries taking precedence).This field must be specified with
username
,password
, andbucket
.- Validated by:
_conn_string_must_follow_supported_url_pattern
- field ddl_create_index_interval_seconds: float | None = 1¶
Wait time (in seconds) between individual
CREATE INDEX
operations.This field is only used by the
init
command during index creation. Multiple index creation operations may raise a transient error from the Index Service. If you keep running into this issue, raise this value. By default, this value is 1 second.
- field ddl_retry_attempts: int | None = 3¶
Maximum number of attempts to retry DDL operations.
This field is only used by the
init
command during scope, collection, and index creation. If the number of attempts is exceeded, the command will fail. By default, this value is 3 attempts.
- field ddl_retry_wait_seconds: float | None = 5¶
Wait time (in seconds) between DDL operation retries.
This field is only used by the
init
command during scope, collection, and index creation. By default, this value is 5 seconds.
- field index_partition: int | None = None¶
The maximum number of index partitions across all nodes for your cluster.
This parameter is used by the Search service to build vector indexes on
init
. By default, this value is \(2 \times \text{number of FTS nodes in your cluster}\). More information on index partitioning can be found here.
- field max_index_partition: int = 1024¶
The maximum number of index partitions across all nodes for your cluster.
This parameter is used by the Search service to build vector indexes on
init
. By default, this value is 1024.
- field password: SecretStr | None = None¶
Password associated with the Couchbase instance possessing the catalog.
This field must be specified with
conn_string
,username
, andbucket
.
- field username: str | None = None¶
Username associated with the Couchbase instance possessing the catalog.
This field must be specified with
conn_string
,password
, andbucket
.
- field wait_until_ready_seconds: float | None = 5¶
Maximum wait time before timing out when connecting to a Couchbase cluster.
If you have a slow network connection, you may want to increase this value. By default, this value is 5 seconds.
- pydantic model agentc_core.config.config.LocalCatalogConfig[source]¶
Show JSON schema
{ "title": "LocalCatalogConfig", "type": "object", "properties": { "project_path": { "anyOf": [ { "format": "path", "type": "string" }, { "type": "null" } ], "default": null, "title": "Project Path" }, "catalog_path": { "anyOf": [ { "format": "path", "type": "string" }, { "type": "null" } ], "default": null, "title": "Catalog Path" }, "activity_path": { "anyOf": [ { "format": "path", "type": "string" }, { "type": "null" } ], "default": null, "title": "Activity Path" } } }
- Config:
extra: str = ignore
env_prefix: str = AGENT_CATALOG_
env_file: str = .env
- Fields:
- Validators:
_catalog_and_activity_must_align_with_path
»all fields
- field activity_path: Path | None = None¶
Location of the activity folder.
By default, this value is
$AGENT_CATALOG_ACTIVITY_PATH/.agent-activity
.- Validated by:
_catalog_and_activity_must_align_with_path
- field catalog_path: Path | None = None¶
Location of the catalog folder.
By default, this value is
$AGENT_CATALOG_PROJECT_PATH/.agent-catalog
.- Validated by:
_catalog_and_activity_must_align_with_path
- field project_path: Path | None = None¶
Location of the project root.
If specified, we expect the
.agent-catalog
and.agent-activity
folders to exist under this directory. If not specified, the project path is the parent folder of the working Git repository root. A typical project structure is as follows:MY_PROJECT |- .agent-catalog |- .agent-activity |- .git
To directly specify the catalog or activity paths, specify values for the
$AGENT_CATALOG_CATALOG_PATH
and/or$AGENT_CATALOG_ACTIVITY_PATH
fields.- Validated by:
_catalog_and_activity_must_align_with_path
- pydantic model agentc_core.config.config.EmbeddingModelConfig[source]¶
Show JSON schema
{ "title": "EmbeddingModelConfig", "type": "object", "properties": { "conn_string": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Conn String" }, "username": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Username" }, "password": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "title": "Password" }, "conn_root_certificate": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Conn Root Certificate" }, "bucket": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Bucket" }, "max_index_partition": { "default": 1024, "title": "Max Index Partition", "type": "integer" }, "index_partition": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Index Partition" }, "wait_until_ready_seconds": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": 5, "title": "Wait Until Ready Seconds" }, "ddl_create_index_interval_seconds": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": 1, "title": "Ddl Create Index Interval Seconds" }, "ddl_retry_attempts": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": 3, "title": "Ddl Retry Attempts" }, "ddl_retry_wait_seconds": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": 5, "title": "Ddl Retry Wait Seconds" }, "project_path": { "anyOf": [ { "format": "path", "type": "string" }, { "type": "null" } ], "default": null, "title": "Project Path" }, "catalog_path": { "anyOf": [ { "format": "path", "type": "string" }, { "type": "null" } ], "default": null, "title": "Catalog Path" }, "activity_path": { "anyOf": [ { "format": "path", "type": "string" }, { "type": "null" } ], "default": null, "title": "Activity Path" }, "embedding_model_name": { "default": "sentence-transformers/all-MiniLM-L12-v2", "title": "Embedding Model Name", "type": "string" }, "embedding_model_url": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Embedding Model Url" }, "embedding_model_auth": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Embedding Model Auth" }, "sentence_transformers_model_cache": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": ".model-cache", "title": "Sentence Transformers Model Cache" }, "sentence_transformers_retry_attempts": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": 3, "title": "Sentence Transformers Retry Attempts" } } }
- Config:
extra: str = ignore
env_prefix: str = AGENT_CATALOG_
env_file: str = .env
- Fields:
- Validators:
- field embedding_model_auth: str | None = None¶
The authentication token for the endpoint specified by
embedding_model_url
.For endpoints hosted by OpenAI, this is the API key. For endpoints hosted on Capella, this is your JWT.
- Validated by:
_catalog_and_activity_must_align_with_path
- field embedding_model_name: str = 'sentence-transformers/all-MiniLM-L12-v2'¶
The name of the embedding model that Agent Catalog will use when indexing and querying tools and prompts.
By default, the
sentence-transformers/all-MiniLM-L12-v2
model is used.- Validated by:
_catalog_and_activity_must_align_with_path
- field embedding_model_url: str | None = None¶
The base URL of an OpenAI-client-compatible endpoint.
This field is optional, but if specified we will assume that the model specified by
embedding_model_name
is accessible by this endpoint.- Validated by:
_catalog_and_activity_must_align_with_path
- field sentence_transformers_model_cache: str | None = '.model-cache'¶
The path to the folder where sentence-transformer embedding models will be cached.
By default, this is
$AGENT_CATALOG_PROJECT_PATH/.model-cache
. For OpenAI embedding models, this field is ignored.- Validated by:
_catalog_and_activity_must_align_with_path
- field sentence_transformers_retry_attempts: int | None = 3¶
The number of times to retry fetching a sentence-transformers model.
On the first attempt, we will always try to fetch the model from the cache. For all subsequent attempts, we will try to fetch the model from HuggingFace. If this field is set to 1, we will error out if the model is not found in the cache. By default, this value is 3.
- Validated by:
_catalog_and_activity_must_align_with_path
- pydantic model agentc_core.config.config.ToolRuntimeConfig[source]¶
Show JSON schema
{ "title": "ToolRuntimeConfig", "type": "object", "properties": { "codegen_output": { "anyOf": [ { "format": "path", "type": "string" }, { "type": "null" } ], "default": null, "title": "Codegen Output" }, "tool_decorator": { "default": null, "title": "Tool Decorator" }, "refiner": { "default": null, "title": "Refiner" }, "secrets": { "anyOf": [ { "additionalProperties": { "format": "password", "type": "string", "writeOnly": true }, "type": "object" }, { "type": "null" } ], "title": "Secrets" }, "tool_model": { "$ref": "#/$defs/DataModelType", "default": "typing.TypedDict" } }, "$defs": { "DataModelType": { "enum": [ "pydantic.BaseModel", "pydantic_v2.BaseModel", "dataclasses.dataclass", "typing.TypedDict", "msgspec.Struct" ], "title": "DataModelType", "type": "string" } } }
- Config:
extra: str = ignore
env_prefix: str = AGENT_CATALOG_
env_file: str = .env
- Fields:
- field codegen_output: Path | TemporaryDirectory | PathLike | None = None¶
Location to save generated Python stubs to, if desired.
On
find_tools()
, tools are dynamically generated and served as annotated Python callables. By default, this code is never written to disk. If this field is specified, we will write all generated files to the given output directory and serve the generated Python callables from these files with a "standard import".
- field refiner: Callable | None = <function ToolRuntimeConfig.<lambda>>¶
A Python function to post-process results (reranking, pruning, etc...) yielded by the catalog.
By default, we perform a strict top-K nearest neighbor search for relevant results. This function serves to perform any additional reranking and pruning before the code generation occurs. This function should accept a list of
agentc_core.catalog.SearchResult
instances (a model with the fieldsentry
anddelta
) and return a list ofagentc_core.catalog.SearchResult
instances.We offer an experimental post-processor to cluster closely related results (using delta as the loss function) and subsequently yield the closest cluster (see
agentc_core.provider.refiner.ClosestClusterRefiner
).
- field secrets: dict[str, SecretStr] | None [Optional]¶
A map of identifiers to secret values (e.g., Couchbase usernames, passwords, etc...).
Field DescriptionSome tools require access to values that cannot be hard-coded into the tool themselves (for security reasons). As an example, SQL++ tools require a connection string, username, and password. Instead of capturing these raw values in the tool metadata, tool descriptors mandate the specification of a map whose values are secret keys. These identifiers are read either from the environment or from this
secrets
field.secrets: - couchbase: conn_string: MY_CB_CONN_STRING username: MY_CB_USERNAME password: MY_CB_PASSWORD
To map the secret keys to values explicitly, users will specify their secrets using this field (secrets).
provider = agentc.Catalog(secrets={ "CB_CONN_STRING": "couchbase//23.52.12.254", "CB_USERNAME": "admin_7823", "CB_PASSWORD": os.getenv("THE_CB_PASSWORD"), "CB_CERTIFICATE": "path/to/cert.pem", })
- field tool_decorator: Callable[[ToolResult], T] | None = None¶
A Python decorator (function) to apply to each result yielded by
agentc.catalog.Catalog.find_tools()
.By default, yielded results are callable and possess type annotations + documentation strings, but some agent frameworks may ask for tools whose type is tailored to their own framework. As an example, in LangChain, vanilla Python functions must be converted to
langchain_core.tools.BaseTool
instances. To avoid having to "box" these tools yourself, we accept a callback to perform this boxing on your behalf.
- field tool_model: DataModelType = DataModelType.TypingTypedDict¶
The target model type for the generated (schema) code for tools.
Field DescriptionBy default, we generate
TypedDict
models and attach these as type hints to the generated Python functions. Other options include Pydantic (V2 and V1) models and dataclasses, though these may not be supported by all agent frameworks.
- pydantic model agentc_core.config.config.CommandLineConfig[source]¶
Show JSON schema
{ "title": "CommandLineConfig", "type": "object", "properties": { "verbosity_level": { "default": 0, "maximum": 2, "minimum": 0, "title": "Verbosity Level", "type": "integer" }, "with_interaction": { "default": true, "title": "With Interaction", "type": "boolean" } } }
- Config:
extra: str = ignore
env_prefix: str = AGENT_CATALOG_
env_file: str = .env
- Fields:
- field verbosity_level: int = 0¶
Verbosity level of the agentc command line tool.
By default, this value is 0. If
AGENT_CATALOG_DEBUG
exists, this value is set to 2.- Constraints:
ge = 0
le = 2
- field with_interaction: bool = True¶
Whether to enable the interaction mode for the agentc command line tool.
By default, this value is True. Set this value to False to raise errors when the command line tool requires user input (e.g., when developing scripts).
- pydantic model agentc_core.config.config.VersioningConfig[source]¶
Show JSON schema
{ "title": "VersioningConfig", "type": "object", "properties": { "catalog_id": { "default": "__LATEST__", "title": "Catalog Id", "type": "string" } } }
- Config:
extra: str = ignore
env_prefix: str = AGENT_CATALOG_
env_file: str = .env
- Fields:
- field catalog_id: str = '__LATEST__'¶
The snapshot version to find the tools and prompts for.
By default, we use the latest snapshot version if the repo is clean. This snapshot version is retrieved directly from Git (if the repo is clean). If the repo is dirty, we will fetch all tools and prompts from the local catalog (by default). If snapshot is specified at search time (i.e., with
find_tools()
orfind_prompts()
), we will use that snapshot version instead.