---
title: "Get Template Configuration"
method: GET
path: "/agents/templates/{template}"
tags: ["/agents"]
---

# Get Template Configuration

`GET /agents/templates/{template}`

## Path parameters

- `template` string, required — Template for which to get config

## Response `200`

Successful Response

- GetAgentResponse — Response to GET Agent request
  - `name` string, required — Name of the agent
  - `description` string — Description of the agent
  - `datastore_ids` string[], required — The IDs of the datastore(s) associated with the agent
  - `template_name` string, required — The template used to create this agent.
  - `system_prompt` string — Instructions that your agent references when generating responses. Note that we do not guarantee that the system will follow these instructions exactly.
  - `filter_prompt` string — The prompt to an LLM which determines whether retrieved chunks are relevant to a given query and filters out irrelevant chunks. This prompt is applied per chunk.
  - `no_retrieval_system_prompt` string — Instructions on how the agent should respond when there are no relevant retrievals that can be used to answer a query.
  - `multiturn_system_prompt` string — Instructions on how the agent should handle multi-turn conversations.
  - `suggested_queries` string[] — These queries will show up as suggestions in the Contextual UI when users load the agent. We recommend including common queries that users will ask, as well as complex queries so users understand the types of complex queries the system can handle. The max length of all the suggested queries is 1000.
  - `agent_configs` AgentConfigs — Response to configs for different components
    - `retrieval_config` RetrievalConfig — Captures Retrieval configurations for an Agent
      - `top_k_retrieved_chunks` integer — The maximum number of retrieved chunks from the datastore.
      - `lexical_alpha` number — The weight of lexical search during retrieval. Must sum to 1 with semantic_alpha.
      - `semantic_alpha` number — The weight of semantic search during retrieval. Must sum to 1 with lexical_alpha.
    - `filter_and_rerank_config` FilterAndRerankConfig — Captures Filter and Rerank configurations for an Agent
      - `top_k_reranked_chunks` integer — The number of highest ranked chunks after reranking to be used
      - `reranker_score_filter_threshold` number — If the reranker relevance score associated with a chunk is below this threshold, then the chunk will be filtered out and not used for generation. Scores are between 0 and 1, with scores closer to 1 being more relevant. Set the value to 0 to disable the reranker score filtering.
      - `rerank_instructions` string — Instructions that the reranker references when ranking retrievals. Note that we do not guarantee that the reranker will follow these instructions exactly. Examples: "Prioritize internal sales documents over market analysis reports. More recent documents should be weighted higher. Enterprise portal content supersedes distributor communications." and "Emphasize forecasts from top-tier investment banks. Recent analysis should take precedence. Disregard aggregator sites and favor detailed research notes over news summaries."
      - `default_metadata_filters` union — Optional metadata filter which is applied while retrieving from every datastore linked to this agent.
        - BaseMetadataFilter — Defines a custom metadata filter. The expected input is a dict which can have different operators, fields and values. For example: {"field": "title", "operator": "startswith", "value": "hr-"} Use **lowercase** for `value` when not using `equals` operator. For document_id and date_created the query is built using direct query without nesting.
          - `field` string, required — Field name to search for in the metadata
          - `operator` 'equals' | 'containsany' | 'exists' | 'startswith' | 'gt' | 'gte' | 'lt' | 'lte' | 'notequals' | 'between' | 'wildcard', required
          - `value` union — The value to be searched for in the field. In case of exists operator, it is not needed.
            - string
            - integer
            - number
            - boolean
            - union[]
              - …
        - CompositeMetadataFilter — "Defines a custom metadata filter as a Composite MetadataFilter. Which can be be a list of filters or nested filters.
          - `filters` union[], required — Filters added to the query for filtering docs
            - union
              - …
          - `operator` 'AND' | 'OR' | 'AND_NOT'
      - `per_datastore_metadata_filters` object — Defines an optional custom metadata filter per datastore ID. Each entry in the dictionary should have a datastore UUID as the key, and the value should be a metadata filter definition. The filter will be applied in addition to filter(s) specified in `default_metadata_filters` and in the `documents_filters` field in the `/query` request during retrieval.
    - `generate_response_config` GenerateResponseConfig — Captures advance LLM configurations for an Agent
      - `max_new_tokens` integer — The maximum number of tokens the model can generate in a response.
      - `temperature` number — The sampling temperature, which affects the randomness in the response.
      - `top_p` number — A parameter for nucleus sampling, an alternative to `temperature` which also affects the randomness of the response.
      - `frequency_penalty` number — This parameter adjusts how the model treats repeated tokens during text generation.
      - `seed` integer — This parameter controls the randomness of how the model selects the next tokens during text generation.
      - `calculate_groundedness` boolean — This parameter controls generation of groundedness scores.
      - `avoid_commentary` boolean — Flag to indicate whether the model should avoid providing additional commentary in responses. Commentary is conversational in nature and does not contain verifiable claims; therefore, commentary is not strictly grounded in available context. However, commentary may provide useful context which improves the helpfulness of responses.
    - `global_config` GlobalConfig — Captures global configs
      - `enable_rerank` boolean — Enables reranking of retrieved chunks
      - `enable_filter` boolean — Enables filtering of retrieved chunks with a separate LLM
      - `enable_multi_turn` boolean — Enables multi-turn conversations. This feature is currently experimental and will be improved.
      - `should_check_retrieval_need` boolean — Enables checking if retrieval is needed for the query. This feature is currently experimental and will be improved.
    - `reformulation_config` ReformulationConfig — Captures Query Reformulation configurations for an Agent
      - `enable_query_expansion` boolean — Whether to enable query expansion.
      - `query_expansion_prompt` string — The prompt to use for query expansion.
      - `enable_query_decomposition` boolean — Whether to enable query decomposition.
      - `query_decomposition_prompt` string — The prompt to use for query decomposition.
    - `acl_config` ACLConfig — Captures ACL configurations for an Agent
      - `acl_active` boolean — Whether to enable ACL.
      - `acl_yaml` string — The YAML file to use for ACL.
    - `translation_config` TranslationConfig — Captures Translation configurations for an Agent
      - `translate_needed` boolean — Whether to enable translation for the agent's responses.
      - `translate_confidence` number — The confidence threshold for translation.
  - `agent_usages` AgentUsages — Total API request counts for the agent.
    - `query` integer, required — query request count
    - `tune` integer, required — tune request count
    - `eval` integer, required — eval request count

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/contextualai/apis/endpoints.md) · [All operations](https://skmtc.net/contextualai/apis/endpoints/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/contextualai/endpoints/versions/ca7f807eec8b/schema)
