# CCPA Source: https://docs.contextual.ai/admin-setup/ccpa # GDPR Source: https://docs.contextual.ai/admin-setup/gdpr # HIPAA Source: https://docs.contextual.ai/admin-setup/hipaa # LLMs.txt Source: https://docs.contextual.ai/admin-setup/llms-txt Helping LLMs index Contextual AI content more efficiently Contextual AI documentation is provided in the llms.txt format — a standardized, LLM-friendly structure that makes it easy for large language models to parse and reference. ## Available Formats We provide two versions of our documentation: * [llms.txt](/llms.txt): A concise overview containing brief descriptions of key features and direct links to detailed documentation sections. * [llms-full.txt](/llms-full.txt): A comprehensive version that includes the same structure as llms.txt but with expanded details for each section. # Overview Source: https://docs.contextual.ai/admin-setup/overview Everything You Need to Get Up & Running with Contextual AI This section provides the core tools and guidance to configure, secure, and manage your Contextual AI environment. Start here to establish a reliable, governed foundation for building and running contextual AI workflows. ### [RBAC](/admin-setup/rbac) Manage access with fine-grained, role-based permissions that control who can view, modify, and administer your Contextual AI resources. Use RBAC to enforce least privilege, streamline collaboration, and maintain strong governance across teams. ### [Pricing & Billing](/admin-setup/pricing-billing) View and manage your organization’s subscription details, usage, and invoicing. This section explains how Contextual AI tracks consumption and helps you stay aligned with your plan as your workloads grow. ### [Security & Compliance](/admin-setup/soc2) Learn how Contextual AI protects your data through enterprise-grade security controls, encryption, governance policies, and compliance certifications. This section outlines the safeguards that keep your contextual workloads secure and audit-ready. ### [LLMs.txt](/admin-setup/llms-txt) Configure the `LLMs.txt` file to declare which models your organization uses, define model access rules, and ensure consistent behavior across environments. This section covers the file format, best practices, and how Contextual AI interprets these settings. # Pricing & Billing Source: https://docs.contextual.ai/admin-setup/pricing-billing Pricing overview and how to manage billing in your workspace ## Pricing Overview Contextual AI offers two pricing options: * **On-Demand**: Pay-as-you-go pricing with \$25 in free credits to start. No commitments or minimums. * **Enterprise**: Custom pricing with guaranteed throughput, SLAs, VPC deployment, and dedicated support. We also offer **Component APIs** (Parse, Rerank, Generate, LMUnit) with usage-based pricing for teams integrating with existing architectures. See complete pricing details, feature comparison, and enterprise options *** ## Managing Your Billing ### Monitoring Usage To view your usage statistics: 1. Click on **Usage** in the sidebar The usage page shows a month-by-month breakdown of your spend across components and endpoints. ### Adding Payment Methods To link a payment method: 1. Navigate to the **Billing** page in your workspace 2. Click on **Payment Methods** in the **Learn More** section 3. Click the **+New** button 4. Fill out the card or bank information, then click **Next** 5. Fill out your billing address, then click **Save Payment Method** To remove a payment method: 1. Locate it in the list of payment methods 2. Click the menu icon 3. Click **Remove Payment Method** ### Adding Credits To top-up your credits: 1. Navigate to the **Billing** page in your workspace 2. Add a valid credit card under **Payment Methods** if you haven't already 3. Click **Add Credits** and fill out the form 4. Click **Next** and confirm the payment *** For enterprise pricing or questions, contact [sales@contextual.ai](mailto:sales@contextual.ai) # Role-Based Access Control (RBAC) Source: https://docs.contextual.ai/admin-setup/rbac Define custom roles and permission bundles across agents, datastores, and more. *********Contextual AI is excited to introduce Role-Based Access Control (RBAC). RBAC is exclusive to customers on our Provisioned Throughput plan. Please contact your account team for more information.********* Admins can now define custom roles with tailored permission bundles across key objects — including Agents, Datastores, Billing, and other administrative features. Permissions can be scoped to specific Agents or Datastores, enabling finer-grained governance so every team member has the right level of access for their role. **Groups** make access management even simpler: add multiple users to a Group, then assign that Group to a Role. ## Roles ### Navigating to the Roles Page First, click `Settings` under `Admin` in the side-panel. Screenshot 2025-11-12 at 2.23.28 PM.png Next, click `Roles` under `Access Control`. Untitled 2.001.jpeg ### Default Roles Your tenant comes with three default roles: * `Admin`: Default role with full access to agents, datastores, and workspace settings. * `User`: Default role that every new user is automatically assigned to. This role **does not** come with any access to agents or datastores. * `Power User`: Default role that grants read access to all agents and datastores. By default, all new users are given the `User` role. They won't be able to access agents or datastores until they’re assigned a Role with higher-level permissions. Screenshot 2025-11-12 at 4.00.25 PM.png ### Creating a Custom Role You can create custom roles to meet your governance needs. Here are examples of custom roles you can create: * **Billing Admin** – Access to billing and usage features * **Data Ingestor** – Manage and ingest documents within specific Datastores * **Agent User** – Query and interact with designated Agents * **Agent Admin** – Maintain and optimize designated Agents First, click "New Role" in the **Roles** page. Screenshot 2025-11-12 at 2.36.20 PM.png Second, input a Role Name and Description. Click "Create role". Screenshot 2025-11-12 at 2.48.07 PM.png ### Configuring Role Permissions After creating a Role, you will be automatically directed to the Role page. The first tab is for you to configure permissions. Click “Add Permission” to associate a permission with the Role. Screenshot 2025-11-12 at 2.49.20 PM.png You will need to select what type of object you want to grant access to. You have three options: * `Agents`: Select this to give permissions on an agent * `Datastores`: Select this to give permissions on a Datastore * `Admin Tools`: Select this to give access to admin functions like billing and [annotating feedback](/how-to-guides/feedback). Screenshot 2025-11-12 at 2.54.03 PM.png You can then configure permissions relevant to the object type you selected. #### Configuring Agent Permissions On the left, you’ll see a **list of available permissions**. Each defines what actions the Role can take. * `Query Agents`: This permission will let assigned users query the agent. * `Manage Agents`: This permission will let assigned users query the agent and edit its configs. It is a superset of `Query Agents`. * `Create Agents`: This permission will let assigned users create an agent. On the **right**, you’ll see the **objects** these permissions apply to. * For `Query Agents` and `Manage Agents`, you can select specific agents or select `All Agents`. * The`Create Agents` permission will apply globally. Screenshot 2025-11-12 at 3.00.35 PM.png **Important:** To query data from an agent’s linked datastores, a user must have both (i) `Query Agents` or `Manage Agents` and (ii) `Read Documents` (or higher) on the specific datastores. This ensures that when an agent is linked to multiple datastores, users can only query the ones they are permitted to access. Example: * `Agent_1` is linked to `Datastore_1` and `Datastore_2`. * The user has `Query Agents` on `Agent_1` and `Read Documents` on `Datastore_1` only. * As a result, only documents from `Datastore_1` will be retrieved. #### Configuring Datastore Permissions On the left, you’ll see a **list of available permissions**. Each defines what actions the Role can take. * `Read Documents`: This permission will let assigned users see the datastore and read documents inside. * `Manage Documents`: This permission will let assigned users read documents, as well as upload/delete them. It is a superset of `Read Documents`. * `Manage Datastores`: This permission will let assigned users manage documents, as well as edit the datastore configs. It is a superset of `Manage Documents`. * `Create Datastores`: This permission will let assigned users create a datastore. On the **right**, you’ll see the **objects** these permissions apply to. * For `Read Documents` , `Manage Documents` and `Manage Datastores`, you can select specific datastores or select `All Datastores`. * The`Create Datastores` permission will apply globally. Screenshot 2025-11-12 at 3.04.27 PM.png **Important:** To query data from an agent’s linked datastores, a user must have both (i) `Query Agents` or `Manage Agents` and (ii) `Read Documents` (or higher) on the specific datastores. This ensures that when an agent is linked to multiple datastores, users can only query the ones they are permitted to access. #### Configuring Admin Permissions On the left, you’ll see a **list of available permissions**. Each defines what actions the Role can take. * `Create Agents`: This permission will let assigned users create an agent. * `Create Datastores`: This permission will let assigned users create a datastore. * `Manage Billing & Usage`: This permission will let assigned users view and configure the `Billing` page. * `Manage Feedback Annotation`: This permission will let assigned users [view and annotate agent-level feedback](/how-to-guides/feedback). All these permissions apply globally. Screenshot 2025-11-12 at 3.11.26 PM.png ### Review your Permissions Review all the permissions that you have provisioned for the Role. You can add more permissions or remove existing ones by clicking on the three dots beside each permission and clicking "Remove". Screenshot 2025-11-12 at 3.13.23 PM.png ### Assigning a User to a Role To assign a user to the Role, click the `Assigned Users` tab in the Roles Page. Screenshot 2025-11-12 at 3.14.24 PM.png Next, click "Assign Users". You'll be able to select multiple users to add to the role. Click "Confirm". Screenshot 2025-11-12 at 3.15.16 PM.png Third, review the users you've added. You can add more users or remove existing ones by clicking on the three dots beside a user and clicking "Remove". Screenshot 2025-11-12 at 3.16.16 PM.png **You’re all set!** The assigned users now have the access defined in this Role. ### Dealing with Role Conflicts If a user is assigned to two roles with different permissions on the same object, we will take the **union of permissions**. Example: * User is assigned to `Role A` which is given `Query Agents` on `All Agents` * User is also assigned to `Role B` which is given the higher-level `Manage Agents` on `Agent A`. * Outcome: * User will have `Manage Agents` on `Agent A` * User will have `Query Agents` on every other agent. ### Managing Roles After creating a Role, you can return to its configuration page at any time. To do so, navigate to the **Roles** page and click on the Role you want to edit. Screenshot 2025-11-12 at 3.30.02 PM.png You can also delete a Role by clicking on the three dots beside it and clicking "Delete". Screenshot 2025-11-12 at 3.26.12 PM.png ### Creating Agents and Datastores If a user has created an Agent or Datastore, an owner Role will automatically be created with `Manage Agent` or `Manage Datastore` permissions. The user will automatically be assigned to that Role. Screenshot 2025-11-12 at 3.45.49 PM.png ## Groups ### Navigating to the Groups page Groups can help simplify access management. You can add multiple users to a Group and assign the Group to a Role. First, click `Settings` under `Admin` in the side-panel. Screenshot 2025-11-12 at 2.23.28 PM.png Next, click "Groups" under "Access Control". Untitled 4.001.jpeg ### Creating a Group Click "New Group". Screenshot 2025-11-12 at 3.36.38 PM.png Fill in Group Name and Description Screenshot 2025-11-12 at 3.37.52 PM.png Click "Create group". You'll be automatically redirected to the Group page. ### Assigning Users to the Group Click the tab "Assigned Users". Screenshot 2025-11-12 at 3.40.01 PM.jpg Click "Assign Users" and select the users you want to include in the Group. Click "Confirm". Screenshot 2025-11-12 at 3.39.02 PM.png Review the users you have added. You can add more users to the Group or remove existing users by clicking the three dots and clicking "Remove". Screenshot 2025-11-12 at 3.39.32 PM.png ### Associating a Group with a Role Navigate to the first tab: "Roles". Screenshot 2025-11-12 at 3.43.47 PM.png Click "Add Roles". You can select roles to associate with your Group. Screenshot 2025-11-12 at 3.41.42 PM.png Click "Add Roles". You can add more roles or remove existing ones by clicking on the three dots and clicking "Remove". Screenshot 2025-11-12 at 3.46.40 PM.png **You're set!** Members of the Group now have have the access defined in the attached Roles. ### Managing a Group After creating a Group, you can return to its configuration page at any time. To do so, navigate to the **Groups** page and click on the Group you want to edit. Screenshot 2025-11-12 at 3.48.21 PM.png You can also delete a Group by clicking on the three dots beside it and clicking "Delete". Screenshot 2025-11-12 at 3.48.37 PM.png ## User Management You can view the roles and groups associated with each user. First, navigate to `Members` in the `Access Control` tab. You will see the list of members in your workspace. Screenshot 2025-11-24 at 11.53.27 AM.png To see the **roles** assigned to the user, click the `Expand` button in the `Roles` column. You will see (i) the assigned roles, (ii) the permissions included in each role, and (iii) whether it was assigned directly to the user or inherited via group membership. You can also open up the Role Page with the top-left button. Screenshot 2025-11-24 at 11.57.04 AM.png To see the **groups** that the user belongs to, click the `Expand` button in the `Groups` column. You will see (i) the user's groups and (ii) the roles associated with each group. You can also open up the Group Page with the top-left button. Screenshot 2025-11-24 at 12.03.25 PM.png # SOC 2 Source: https://docs.contextual.ai/admin-setup/soc2 Contextual AI SOC 2 Compliance ## Overview Contextual AI is **SOC 2 Type II certified**, demonstrating that our security controls and operational practices meet the highest standards for protecting enterprise data. ![Alt Text](https://cdn.sanity.io/images/aw1pcv4c/production/1676425030178745ab94dfe0a96604369d93aa9b-5760x3240.png?w=3840\&fm=webp\&q=75\&dpr=2) This certification verifies that our systems, processes, and safeguards operate effectively over time—not just at a single point of audit. *** ## What SOC 2 Type II Means SOC 2 Type II evaluates how well an organization upholds the **Trust Service Criteria**: * **Security** * **Availability** * **Confidentiality** An independent auditor verified that Contextual AI maintains strong, continuously monitored controls across all three criteria. *** ## Security at Every Layer ### Proven Security Controls Our compliance audit confirms consistent adherence to stringent policies and processes governing data handling, infrastructure, and operations. ### Data Protection * **Encryption in transit:** TLS 1.2+ * **Encryption at rest:** AES-256 * **Key management:** Cloud-native KMS services with restricted access ### Deployment Options Choose the environment that fits your organization’s security posture: * **SaaS** (fully managed) * **VPC** (private cloud) * **On-premises** (self-managed) ### Authentication & Access * Enterprise **SSO** with **SAML** or **OIDC** * **Role-based access control (RBAC)** for fine-grained permissions *** ## Core Security Controls | Category | Description | | ------------------------- | ---------------------------------------------------------------------------------------------- | | **Application Security** | Continuous SAST/SCA scanning, dependency monitoring, and vulnerability management | | **Business Continuity** | Kubernetes-based orchestration, automated failover, distributed infrastructure | | **Monitoring & Response** | Real-time detection via centralized security data lake and defined incident-response playbooks | | **Bug Bounty Program** | Ongoing responsible-disclosure program with independent security researchers | *** ## Continuous Compliance * SOC 2 Type II is one component of our broader compliance framework. * Contextual AI is hosted on **Google Cloud Platform**, which maintains its own certifications: SOC 2, SOC 3, PCI DSS, ISO/IEC 27017, and CSA STAR. * We continuously evaluate and update controls to address evolving security and privacy requirements for enterprise AI systems. *** ## Learn More * [SOC 2 Announcement](https://contextual.ai/blog/contextual-ai-is-soc-2-type-2-certified) * [Security Overview](https://contextual.ai/security) * [Trust Center](https://trust.contextual.ai/resources) – Request a copy of our SOC 2 Type II report * [Contact Support](https://contextual.ai/contact-us) for compliance or security-related inquiries # Get Metrics Source: https://docs.contextual.ai/api-reference/agents-query/get-metrics /api-reference/openapi.json get /agents/{agent_id}/metrics Returns usage and user-provided feedback data. This information can be used for data-driven improvements and optimization. # Get Retrieval Info Source: https://docs.contextual.ai/api-reference/agents-query/get-retrieval-info /api-reference/openapi.json get /agents/{agent_id}/query/{message_id}/retrieval/info Return metadata of the contents used to generate the response for a given message. # Provide Feedback Source: https://docs.contextual.ai/api-reference/agents-query/provide-feedback /api-reference/openapi.json post /agents/{agent_id}/feedback Provide feedback for a generation or a retrieval. Feedback can be used to track overall `Agent` performance through the `Feedback` page in the Contextual UI, and as a basis for model fine-tuning. # Query Source: https://docs.contextual.ai/api-reference/agents-query/query /api-reference/openapi.json post /agents/{agent_id}/query/acl Start a conversation with an `Agent` and receive its generated response, along with relevant retrieved data and attributions. # Query Source: https://docs.contextual.ai/api-reference/agents-query/query-1 /api-reference/openapi.json post /agents/{agent_id}/query Start a conversation with an `Agent` and receive its generated response, along with relevant retrieved data and attributions. # Copy Agent Source: https://docs.contextual.ai/api-reference/agents/copy-agent /api-reference/openapi.json post /agents/{agent_id}/copy Copy an existing agent with all its configurations and datastore associations. The copied agent will have "[COPY]" appended to its name. # Create Agent Source: https://docs.contextual.ai/api-reference/agents/create-agent /api-reference/openapi.json post /agents Create a new `Agent` with a specific configuration. This creates a specialized RAG `Agent` which queries over one or multiple `Datastores` to retrieve relevant data on which its generations are grounded. Retrieval and generation parameters are defined in the provided `Agent` configuration. > Note that self-serve users are currently required to create agents through our UI. Otherwise, they will receive the following message: "This endpoint is disabled as you need to go through checkout. Please use the UI to make this request." # Delete Agent Source: https://docs.contextual.ai/api-reference/agents/delete-agent /api-reference/openapi.json delete /agents/{agent_id} Delete a given `Agent`. This is an irreversible operation. Note: `Datastores` which are associated with the `Agent` will not be deleted, even if no other `Agent` is using them. To delete a `Datastore`, use the `DELETE /datastores/{datastore_id}` API. # Edit Agent Source: https://docs.contextual.ai/api-reference/agents/edit-agent /api-reference/openapi.json put /agents/{agent_id} Modify a given `Agent` to utilize the provided configuration. Fields not included in the request body will not be modified. # Get Agent Metadata Source: https://docs.contextual.ai/api-reference/agents/get-agent-metadata /api-reference/openapi.json get /agents/{agent_id}/metadata Get metadata and configuration of a given `Agent`. # Get Template Configuration Source: https://docs.contextual.ai/api-reference/agents/get-template-configuration /api-reference/openapi.json get /agents/templates/{template} # List Agent Composer Templates Source: https://docs.contextual.ai/api-reference/agents/list-agent-composer-templates /api-reference/openapi.json get /agents/templates/acl Retrieve a list of all available Agent Composer Templates. # List Agents Source: https://docs.contextual.ai/api-reference/agents/list-agents /api-reference/openapi.json get /agents Retrieve a list of all `Agents`. # List Templates Source: https://docs.contextual.ai/api-reference/agents/list-templates /api-reference/openapi.json get /agents/templates Retrieve a list of all available Templates. # Reset Agent Source: https://docs.contextual.ai/api-reference/agents/reset-agent /api-reference/openapi.json put /agents/{agent_id}/reset Reset a given `Agent` to default configuration. # Save Template Source: https://docs.contextual.ai/api-reference/agents/save-template /api-reference/openapi.json post /agents/{agent_id}/template # Get Agent Composer Step Usage Source: https://docs.contextual.ai/api-reference/billing/get-agent-composer-step-usage /api-reference/openapi.json get /billing/usages/acl Get Agent Composer step-level usage data for a specific month. This API returns daily usages of advance queries grouped by steps. The data is used for visualization purposes to show users which Agent Composer steps were executed and their associated costs and token consumption. Note: The costs returned here are already included in the ACL_COST entry from the daily_usages table and should not be double-counted in billing. Args: request: Request object containing year, month, and optional resource_id user_context: User context with tenant admin permissions Returns: Agent Composer step usage data aggregated by step and date # Get Balance Source: https://docs.contextual.ai/api-reference/billing/get-balance /api-reference/openapi.json get /billing/balance Get the remaining balance for a tenant # Get Billing Metadata Source: https://docs.contextual.ai/api-reference/billing/get-billing-metadata /api-reference/openapi.json get /billing/metadata Non admin endpoint for getting the billing metadata for a tenant. # Get Billing Mode History Source: https://docs.contextual.ai/api-reference/billing/get-billing-mode-history /api-reference/openapi.json get /billing/billing_mode/history Get the billing mode history for a tenant for a specific month. Args: request: Request object containing year and month with validation user_context: User context with tenant admin permissions Returns: Billing mode history records for the specified month and year Returns at least one entry which is the mode of the first date of the given month, with potential mode changes in the middle of the month. If no record found, defaults to LEGACY mode. # Get Earliest Usage Date Endpoint Source: https://docs.contextual.ai/api-reference/billing/get-earliest-usage-date-endpoint /api-reference/openapi.json get /billing/usages/earliest_date Get the earliest usage date for a tenant # Get Monthly Usage Endpoint Source: https://docs.contextual.ai/api-reference/billing/get-monthly-usage-endpoint /api-reference/openapi.json get /billing/usages/monthly Get monthly usage data for a tenant with validation for year and month parameters. Args: request: Request object containing year and month with validation user_context: User context with tenant admin permissions resource_id: Optional[UUID]. If provided, get usage data for a specific resource. Otherwise, get aggregated usage data across all resources. Returns: Monthly usage records for the specified month and year # Get Top Up History Endpoint Source: https://docs.contextual.ai/api-reference/billing/get-top-up-history-endpoint /api-reference/openapi.json get /billing/balance/top-ups Get the top-up history for a tenant. Paginated. # Get Content Metadata Source: https://docs.contextual.ai/api-reference/contents/get-content-metadata /api-reference/openapi.json get /datastores/{datastore_id}/contents/{content_id}/metadata # Get Document Contents Source: https://docs.contextual.ai/api-reference/contents/get-document-contents /api-reference/openapi.json get /datastores/{datastore_id}/contents # Delete Document Source: https://docs.contextual.ai/api-reference/datastores-documents/delete-document /api-reference/openapi.json delete /datastores/{datastore_id}/documents/{document_id} Delete a given document from its `Datastore`. This operation is irreversible. # Edit Chunk Content Source: https://docs.contextual.ai/api-reference/datastores-documents/edit-chunk-content /api-reference/openapi.json put /datastores/{datastore_id}/chunks/{content_id}/content Edit the content of a specific chunk in a datastore. This operation updates the chunk's text content and regenerates its embeddings. # Get Document Metadata Source: https://docs.contextual.ai/api-reference/datastores-documents/get-document-metadata /api-reference/openapi.json get /datastores/{datastore_id}/documents/{document_id}/metadata Get details of a given document, including its `name` and ingestion job `status`. # Get Parse Results Source: https://docs.contextual.ai/api-reference/datastores-documents/get-parse-results /api-reference/openapi.json get /datastores/{datastore_id}/documents/{document_id}/parse Get the parse results that are generated during ingestion for a given document. Retrieving parse results for existing documents ingested before the release of this endpoint is not supported and will return a 404 error. # Ingest Document Source: https://docs.contextual.ai/api-reference/datastores-documents/ingest-document /api-reference/openapi.json post /datastores/{datastore_id}/documents Ingest a document into a given `Datastore`. Ingestion is an asynchronous task. Returns a document `id` which can be used to track the status of the ingestion job through calls to the `GET /datastores/{datastore_id}/documents/{document_id}/metadata` API. This `id` can also be used to delete the document through the `DELETE /datastores/{datastore_id}/documents/{document_id}` API. `file` must be a PDF, HTML, DOC(X), PPT(X), PNG, JPG, or JPEG file. The filename must end with one of the following extensions: `.pdf`, `.html`, `.htm`, `.mhtml`, `.doc`, `.docx`, `.ppt`, `.pptx`, `.png`, `.jpg`, `.jpeg`. # List Documents Source: https://docs.contextual.ai/api-reference/datastores-documents/list-documents /api-reference/openapi.json get /datastores/{datastore_id}/documents Get list of documents in a given `Datastore`, including document `id`, `name`, and ingestion job `status`. Performs `cursor`-based pagination if the number of documents exceeds the requested `limit`. The returned `cursor` can be passed to the next `GET /datastores/{datastore_id}/documents` call to retrieve the next set of documents. # Update Document Metadata Source: https://docs.contextual.ai/api-reference/datastores-documents/update-document-metadata /api-reference/openapi.json put /datastores/{datastore_id}/documents/{document_id}/metadata Post details of a given document that will enrich the chunk and be added to the context or just for filtering. If Just for filtering, start with "_" in the key. # Create Datastore Source: https://docs.contextual.ai/api-reference/datastores/create-datastore /api-reference/openapi.json post /datastores Create a new `Datastore`. A `Datastore` is a collection of documents. Documents can be ingested into and deleted from a `Datastore`. A `Datastore` can be linked to one or more `Agents`, and conversely, an `Agent` can be associated with one or more `Datastores` to ground its responses with relevant data. This flexible many-to-many relationship allows `Agents` to draw from multiple sources of information. This linkage of `Datastore` to `Agent` is done through the `Create Agent` or `Edit Agent` APIs. > Note that self-serve users are currently required to create datastores through our UI. Otherwise, they will receive the following message: "This endpoint is disabled as you need to go through checkout. Please use the UI to make this request." # Delete Datastore Source: https://docs.contextual.ai/api-reference/datastores/delete-datastore /api-reference/openapi.json delete /datastores/{datastore_id} Delete a given `Datastore`, including all the documents ingested into it. This operation is irreversible. This operation will fail with status code 400 if there is an active `Agent` associated with the `Datastore`. # Edit Datastore Configuration Source: https://docs.contextual.ai/api-reference/datastores/edit-datastore-configuration /api-reference/openapi.json put /datastores/{datastore_id} # Get Datastore Metadata Source: https://docs.contextual.ai/api-reference/datastores/get-datastore-metadata /api-reference/openapi.json get /datastores/{datastore_id}/metadata Get the details of a given `Datastore`, including its name, create time, and the list of `Agents` which are currently configured to use the `Datastore`. # List Datastores Source: https://docs.contextual.ai/api-reference/datastores/list-datastores /api-reference/openapi.json get /datastores Retrieve a list of `Datastores`. Performs `cursor`-based pagination if the number of `Datastores` exceeds the requested `limit`. The returned `cursor` can be passed to the next `GET /datastores` call to retrieve the next set of `Datastores`. # Reset Datastore Source: https://docs.contextual.ai/api-reference/datastores/reset-datastore /api-reference/openapi.json put /datastores/{datastore_id}/reset Reset the give `Datastore`. This operation is irreversible and it deletes all the documents associated with the datastore. # Create Schema Source: https://docs.contextual.ai/api-reference/extract/create-schema /api-reference/openapi.json post /extract/schemas Create a new extraction schema. Creates a JSON Schema that defines the structure of data to extract from documents. The schema must conform to our supported subset of JSON Schema 2020-12 features. Supported Schema Features: Basic Types: 1. `string`: Text data with optional constraints (`minLength`, `maxLength`, `pattern`, `enum`) 2. `integer`: Whole numbers with optional constraints (`minimum`, `maximum`, `enum`) 3. `number`: Decimal numbers with optional constraints (`minimum`, `maximum`, `enum`) 4. `boolean`: True/false values 5. `null`: Null values (often used with `anyOf` for optional fields) Complex Types: 1. `object`: Key-value pairs with defined properties 2. `array`: Lists of items with defined item schemas 3. `anyOf`: Union types (e.g., string or null for optional fields) String Formats: Supported formats: `date-time`, `time`, `date`, `duration`, `email`, `hostname`, `ipv4`, `ipv6`, `uuid`, `uri` Schema Structure: 1. Root schema must be an `object` type 2. Use `$defs` for reusable schema components 3. Use `$ref` to reference definitions 4. Arrays must have `items` schema defined Constraints: 1. Maximum 10 leaf nodes per array (prevents overly complex schemas) 2. No circular references in `$ref` definitions 3. String formats must be from the supported list Example Schemas: Simple Company Schema: ```json { "type": "object", "properties": { "company_name": { "type": "string", "description": "The name of the company exactly as it appears in the document" }, "form_type": { "type": "string", "enum": ["10-K", "10-Q", "8-K", "S-1"], "description": "The type of SEC form" }, "trading_symbol": { "type": "string", "description": "The trading symbol of the company" }, "zip_code": { "type": "integer", "description": "The zip code of the company headquarters" } }, "required": ["company_name", "form_type", "trading_symbol", "zip_code"] } ``` Complex Resume Schema: ```json { "type": "object", "properties": { "personalInfo": { "type": "object", "properties": { "fullName": {"type": "string"}, "contact": { "type": "object", "properties": { "emails": { "type": "array", "items": {"type": "string", "format": "email"} }, "phones": { "type": "array", "items": {"type": "string"} } } } }, "required": ["fullName"] }, "workExperience": { "type": "array", "items": { "type": "object", "properties": { "jobTitle": {"type": "string"}, "company": {"type": "string"}, "startDate": {"type": "string"}, "endDate": {"type": ["string", "null"]}, "isCurrent": {"type": "boolean"} }, "required": ["jobTitle", "company", "startDate"] } } }, "required": ["personalInfo", "workExperience"] } ``` Schema with References: ```json { "type": "object", "properties": { "algorithms": { "type": "array", "items": {"$ref": "#/$defs/algorithm"} } }, "$defs": { "algorithm": { "type": "object", "properties": { "name": {"type": "string"}, "description": {"type": "string"} }, "required": ["name"] } } } ``` Best Practices: 1. Use descriptive field names that clearly indicate what data should be extracted 2. Add detailed descriptions to help the AI understand what to extract 3. Use `enum` for known values (e.g., form types, status values) 4. Make fields optional by using `anyOf` with `null` or omitting from `required` 5. Use arrays for lists of similar items (e.g., work experience, education) 6. Keep schemas focused - avoid overly complex nested structures 7. Test with sample documents to ensure the schema captures the expected data # Delete Document Source: https://docs.contextual.ai/api-reference/extract/delete-document /api-reference/openapi.json delete /extract/documents/{document_id} Delete a document. # Delete Schema Source: https://docs.contextual.ai/api-reference/extract/delete-schema /api-reference/openapi.json delete /extract/schemas/{schema_id} Delete a schema. # Get Document Source: https://docs.contextual.ai/api-reference/extract/get-document /api-reference/openapi.json get /extract/documents/{document_id} Get document information by ID. # Get Job Results Source: https://docs.contextual.ai/api-reference/extract/get-job-results /api-reference/openapi.json get /extract/jobs/{job_id}/results Get the results of a completed extraction job. # Get Job Status Source: https://docs.contextual.ai/api-reference/extract/get-job-status /api-reference/openapi.json get /extract/jobs/{job_id} Get the status of an extraction job. For running jobs with a Temporal workflow, returns accumulated results and failed subtrees from workflow queries. For completed/failed jobs or jobs without workflow, these fields are empty. # Get Schema Source: https://docs.contextual.ai/api-reference/extract/get-schema /api-reference/openapi.json get /extract/schemas/{schema_id} Get schema information by ID. # List Documents Source: https://docs.contextual.ai/api-reference/extract/list-documents /api-reference/openapi.json get /extract/documents List documents for structured extraction. # List Jobs Source: https://docs.contextual.ai/api-reference/extract/list-jobs /api-reference/openapi.json get /extract/jobs List extraction jobs. # List Schemas Source: https://docs.contextual.ai/api-reference/extract/list-schemas /api-reference/openapi.json get /extract/schemas List schemas with optional search. # Resume Streaming Extraction Source: https://docs.contextual.ai/api-reference/extract/resume-streaming-extraction /api-reference/openapi.json get /extract/jobs/{job_id}/stream Resume streaming events for an existing extraction job. This endpoint: 1. Validates the job exists and is still processing 2. Queries Temporal workflow for current state (accumulated_results) 3. Sends current state as initial event 4. Streams new events going forward # Start Extraction Job Source: https://docs.contextual.ai/api-reference/extract/start-extraction-job /api-reference/openapi.json post /extract/jobs Start a new structured extraction job. Extracts structured data from a PDF document using AI models based on a JSON Schema. The `document_id` and `schema_id` must be valid UUIDs of previously uploaded documents and created schemas. How It Works: 1. Document Processing: The system analyzes the PDF document and splits it into manageable sections 2. Schema Analysis: Your JSON schema is parsed and validated for supported features 3. Extraction: The pipeline processes each section and extracts data according to your schema 4. Validation: Extracted data is validated against your schema to ensure constraints and requirements are met 5. Results: Structured data is returned in the format defined by your schema Supported Models: 1. `gemini-2.5-flash`: Fast, cost-effective model for most use cases (default) 2. `gemini-2.5-pro`: More powerful model for complex extractions Configuration Options: Basic Settings: 1. `model`: AI model to use for extraction 2. `max_num_concurrent_requests`: Number of parallel processing requests (1-20) 3. `validate_response_schema`: Whether to validate extracted data against schema Advanced Settings: 1. `per_key_attribution`: Enable detailed reasoning and confidence scores for each field 2. `temperature`: Control randomness in AI responses (0.0-2.0) 3. `seed`: Set random seed for reproducible results 4. `enable_thinking`: Show AI reasoning process 5. `n_max_retries`: Maximum retry attempts for failed requests Streaming Mode (`stream=true`): When `stream=true`, the endpoint returns an SSE stream instead of a job ID. Results are streamed as subtrees complete, enabling real-time progress visibility in the frontend. - Response: SSE stream (`text/event-stream`) with events: `start`, `subtree_result`, `subtree_error`, `agentic_array_progress` - Job records are still created and results persisted (retrievable via `GET /jobs/{job_id}`) - Always durable: Uses Temporal workflow—job continues running even if client disconnects - Automatic retries: Temporal handles activity failures and retries automatically - Use case: Interactive frontend UI where users want real-time extraction progress SSE Event Types: 1. `start`: Emitted once with `job_id`, `total_subtrees`, and `start_time` 2. `subtree_result`: Emitted per successful subtree with `extracted_result`, `attributions`, `usage_metadata` 3. `subtree_error`: Emitted per failed subtree with `error_message` and `error_type` See `STREAMING-DESIGN.md` for full protocol specification. Job Lifecycle: 1. `pending`: Job is queued and waiting to start 2. `processing`: AI is actively extracting data from the document 3. `completed`: Extraction finished successfully with results 4. `failed`: Extraction failed due to an error 5. `cancelled`: Job was cancelled before completion Monitoring Progress: Use the `GET /jobs/{job_id}` endpoint to check job status and progress: 1. `completion_percentage`: Overall progress (0-100) 2. `current_step`: Current processing stage 3. `fields_processed`: Number of schema fields completed 4. `total_fields`: Total number of schema fields to process Getting Results: Once a job is completed, use `GET /jobs/{job_id}/results` to retrieve: 1. `results`: Extracted data conforming to your schema 2. `metadata`: Processing information, costs, and performance metrics 3. `attributions`: (if enabled) Reasoning and confidence scores for each field Example Request: ```json { "document_id": "123e4567-e89b-12d3-a456-426614174000", "schema_id": "987fcdeb-51a2-43d1-b456-426614174000", "config": { "model": "gemini-2.5-flash", "per_key_attribution": true, "temperature": 0.1, "enable_thinking": true "additional_instructions": "Extract information only about company X. Do not include information about company Y." } } ``` Example Response: ```json { "job_id": "456e7890-e89b-12d3-a456-426614174000", "status": "pending", "created_at": "2025-01-11T18:35:00Z", "estimated_completion": "2025-01-11T18:40:00Z" } ``` Error Handling: Document and schema validation occurs before job creation for both streaming and non-streaming paths: - `400`: Bad Request (invalid `document_id` or `schema_id` format) - `404`: Not Found (document or schema not found) - `422`: Unprocessable Entity (invalid schema definition) - `429`: Too Many Requests (user has exceeded concurrency limit of 5 active jobs) - `500`: Internal Server Error (processing error) # Update Job Results Source: https://docs.contextual.ai/api-reference/extract/update-job-results /api-reference/openapi.json put /extract/jobs/{job_id}/results Update the results of a completed extraction job. # Update Schema Source: https://docs.contextual.ai/api-reference/extract/update-schema /api-reference/openapi.json put /extract/schemas/{schema_id} Update an existing schema. # Upload Document Source: https://docs.contextual.ai/api-reference/extract/upload-document /api-reference/openapi.json post /extract/documents/upload Upload a document for structured extraction. Uploads a PDF document that can be used for structured data extraction. Only PDF files are supported. Supported File Types: 1. PDF files only (`.pdf` extension) 2. Maximum file size: 50MB (recommended) 3. Documents are processed and validated upon upload Document Processing: 1. File size and page count are automatically calculated 2. Document is validated for PDF format and readability 3. Metadata is extracted and stored for future reference 4. Document is stored securely and can be referenced by ID Usage: After uploading, you'll receive a `document_id` that can be used with: 1. `POST /jobs` endpoint to start extraction jobs 2. `GET /documents/{document_id}` to retrieve document information 3. `DELETE /documents/{document_id}` to remove the document Example Response: ```json { "document_id": "123e4567-e89b-12d3-a456-426614174000", "file_name": "financial_report.pdf", "file_size": 2048576, "page_count": 45, "uploaded_at": "2025-01-11T18:35:00Z", "status": "uploaded" } ``` # Generate Source: https://docs.contextual.ai/api-reference/generate/generate /api-reference/openapi.json post /generate Generate a response using Contextual's Grounded Language Model (GLM), an LLM engineered specifically to prioritize faithfulness to in-context retrievals over parametric knowledge to reduce hallucinations in Retrieval-Augmented Generation and agentic use cases. The total request cannot exceed 32,000 tokens. See our [blog post](https://contextual.ai/blog/introducing-grounded-language-model/) and [code examples](https://colab.research.google.com/github/ContextualAI/examples/blob/main/03-standalone-api/02-generate/generate.ipynb). Email [glm-feedback@contextual.ai](mailto:glm-feedback@contextual.ai) with any feedback or questions. # LMUnit Source: https://docs.contextual.ai/api-reference/lmunit/lmunit /api-reference/openapi.json post /lmunit Given a `query`, `response`, and a `unit_test`, return the response's `score` on the unit test on a 5-point continuous scale. The total input cannot exceed 7000 tokens. See a code example in [our blog post](https://contextual.ai/news/lmunit/). Email [lmunit-feedback@contextual.ai](mailto:lmunit-feedback@contextual.ai) with any feedback or questions. >🚀 Obtain an LMUnit API key by completing [this form](https://contextual.ai/request-lmunit-api/) # Parse File Source: https://docs.contextual.ai/api-reference/parse/parse-file /api-reference/openapi.json post /parse Parse a file into a structured Markdown and/or JSON. Files must be less than 300MB and 2000 pages. We use LibreOffice to convert DOC(X) and PPT(X) files to PDF, which may affect page count. See our [blog post](https://contextual.ai/blog/document-parser-for-rag) and [code examples](https://github.com/ContextualAI/examples/blob/main/03-standalone-api/04-parse/parse.ipynb). Email [parse-feedback@contextual.ai](mailto:parse-feedback@contextual.ai) with any feedback or questions. # Parse List Jobs Source: https://docs.contextual.ai/api-reference/parse/parse-list-jobs /api-reference/openapi.json get /parse/jobs Get list of parse jobs, sorted from most recent to oldest. Returns all jobs from the last 30 days, or since the optional `uploaded_after` timestamp. # Parse Result Source: https://docs.contextual.ai/api-reference/parse/parse-result /api-reference/openapi.json get /parse/jobs/{job_id}/results Get the results of a parse job. Parse job results are retained for up to 30 days after job creation. Fetching results for a parse job that is older than 30 days will return a 404 error. # Parse Status Source: https://docs.contextual.ai/api-reference/parse/parse-status /api-reference/openapi.json get /parse/jobs/{job_id}/status Get the status of a parse job. Parse job results are retained for up to 30 days after job creation. Fetching a status for a parse job that is older than 30 days will return a 404 error. # Rerank Source: https://docs.contextual.ai/api-reference/rerank/rerank /api-reference/openapi.json post /rerank Rank a list of documents according to their relevance to a query primarily and your custom instructions secondarily. We evaluated the model on instructions for recency, document type, source, and metadata, and it can generalize to other instructions as well. The reranker supports multilinguality. The total request cannot exceed 400,000 tokens. The combined length of the query, instruction and any document with its metadata must not exceed 8,000 tokens. See our [blog post](https://contextual.ai/blog/introducing-instruction-following-reranker/) and [code examples](https://colab.research.google.com/github/ContextualAI/examples/blob/main/03-standalone-api/03-rerank/rerank.ipynb). Email [rerank-feedback@contextual.ai](mailto:rerank-feedback@contextual.ai) with any feedback or questions. # Get Users Source: https://docs.contextual.ai/api-reference/users/get-users /api-reference/openapi.json get /users Retrieve a list of `users`. # Invite Users Source: https://docs.contextual.ai/api-reference/users/invite-users /api-reference/openapi.json post /users Invite users to the tenant. This checks if the user is already in the tenant and if not, creates the user. We will return a list of user emails that were successfully created (including existing users). # Remove User Source: https://docs.contextual.ai/api-reference/users/remove-user /api-reference/openapi.json delete /users Delete a given `user`. # Update User Source: https://docs.contextual.ai/api-reference/users/update-user /api-reference/openapi.json put /users Modify a given `User`. Fields not included in the request body will not be modified. # Get Consent Source: https://docs.contextual.ai/api-reference/workspaces/get-consent /api-reference/openapi.json get /workspaces/consent Retrieve the current consent status for the workspace. # Update Consent Source: https://docs.contextual.ai/api-reference/workspaces/update-consent /api-reference/openapi.json put /workspaces/consent Update the consent status for the workspace. # Auto & Manual Syncing Source: https://docs.contextual.ai/connectors/auto-manual-syncing Detailed instructions on how to set up Auto & Manual Syncing ## Overview You can enable or disable **auto-syncing** at the top of your Datastore. When enabled, data changes are synced every 3 hours and permission updates every hour. **Note:** Box connectors automatically sync every 24 hours due to rate limits in the Box API. Please contact [connectors@contextual.ai](mailto:connectors@contextual.ai) if you need faster syncing. Please note that changes may not appear immediately. Contextual AI relies on the upstream data source’s API (for example, SharePoint), and updates are only pulled once the API confirms that changes have been made. Screenshot 2025-09-08 at 7.01.51 PM.png You can also trigger a **manual sync** to pull in changes. Screenshot 2025-09-08 at 7.01.55 PM.png Possible sync status indicators include: * **Syncing metadata:** We are syncing file metadata, users, and groups. We will need to sync metadata before we can begin ingestion. * **Processing:** We are ingesting any document or metadata changes. * **Synced / Green checkmark:** The sync has completed successfully. * **Partially Synced:** Some documents failed in the sync. To correct this issue, wait for 10-15 minutes and retrigger a manual sync. The failed documents will be retried. * **Failed:** All documents failed in the sync. Make sure that you have sufficient credits and retry with a manual sync after waiting for 10-15 minutes. If your sync still fails, please contact [connectors@contextual.ai](mailto:connectors@contextual.ai) for further assistance. # Box Source: https://docs.contextual.ai/connectors/box Connect your Box documents to Contextual AI ## Connecting Box Log in through the Contextual AI UI and follow these steps to configure Box as a data source. ### 1. Set Data Source Name & Type * Click **Datastores** in the left-hand pane, followed by the **Create** button in the top right. * Give your datastore a unique name, then select **Third-Party Connection** as the method for adding content to your datastore. Click the **Next** button. * On the **Connection Setup** page, you can **set up auto top-off** to automatically add credits when low, or click **Skip for now** to bypass this step. **Note:** Auto top-off is recommended in [On Demand mode](https://docs.contextual.ai/user-guides/billing) to prevent ingestions from failing halfway if you use up your balance. ### 2. Review Access Levels & Set Account Type * Click the **Connect** button next to **Box**. * Confirm Contextual AI's read/write access levels and review the end user terms. Click **Next** to continue. * Select your **Account Type**: **Admin account (read-only)** - You are setting up a connection for your organization and have admin access to your data source. **User account (read-only)** - You are setting up a personal connection or do not have admin access to your data source. Please [refer to this link](https://help.merge.dev/articles/9280406-why-are-specific-scopes-needed-for-file-storage-integrations) for a full list of permissions you need for admin authorization. * Click **Open window** to grant access to your Box account. ### 3. Grant Access & Sync Settings * Review the access permissions that will be granted from your Box account. * Click **Grant Access to Box** to continue. ### 4. Configure Sync Settings Contextual AI offers two ways to sync your data. You can choose to sync all your files or only specific folders in Box. #### Sync Options * **Share all files** - Grants access to all your content in Box. * **Share specific files** - Restricts access to only the folders you select. To share specific folders: * Hover over the folder and check the box to select it. * You can click into a folder to view its contents, but note that **only folders**—not individual files—can be selected. * Select one or multiple folders as needed. * Click **Confirm** to finalize your selections, then click **Next** once setup is complete. * You can review or edit your connection (for example, to choose a different folder) on the confirmation page. Click **Finish setup** to continue. ### 5. Create Datastore & Start Sync You’re now ready to start syncing your data. Click **Create** to initialize your connection and create your datastore. You’ll be redirected to your **Datastore** page, where the **Syncing Metadata** status will appear. During this stage, Contextual AI syncs your file metadata, users, and groups. This process is typically quick but may take a few hours if you have a large number of files, users, or groups. Once metadata syncing is complete, ingestion will begin automatically and the status will update to **Processing**. **Note:** You can begin using your datastore while syncing continues, but you’ll only have access to the documents that have already been ingested. You can check the progress bar to track how many documents remain to be processed. Once all documents finish ingesting, you’ll see a **green checkmark** indicating that your datastore is ready to use. # Confluence Source: https://docs.contextual.ai/connectors/confluence Connect your Confluence documents to Contextual AI ## Connecting Confluence Log in through the Contextual AI UI and follow these steps to configure Confluence as a data source. ### 1. Set Data Source Name & Type * Click **Datastores** in the left-hand pane, followed by the **Create** button in the top right. * Give your datastore a unique name, then select **Third-Party Connection** as the method for adding content to your datastore. Click the **Next** button. * On the **Connection Setup** page, you can **set up auto top-off** to automatically add credits when low, or click **Skip for now** to bypass this step. **Note:** Auto top-off is recommended in [On Demand mode](https://docs.contextual.ai/user-guides/billing) to prevent ingestions from failing halfway if you use up your balance. ### 2. Review Access Levels, Set Account Type & Confluence Site * Click the **Connect** button next to **Confluence**. * Confirm Contextual AI's read/write access levels and review the end user terms. Click **Next** to continue. * On the **Enter additional information** screen, enter the URL of your Confluence site and click **Next**. * On the **Connect Confluence** screen, click the **Open window** button. * Log in to your Confluence account. Review the requested permissions click **Accept** to continue. * Click the **Next** button to install the Forge app and proceed to the next step. ### 3. Grant Access & Sync Settings * Select the level of access to grant from your Confluence account: * **Share specific content** — Restricts access to only the content you select. * **Share all content** — Grants access to all your content in Confluence. * Click the **Finish setup** button on the **Success!** page. ### 4. Create Datastore & Start Sync You’re now ready to start syncing your data. Click **Create** to initialize your connection and create your datastore. You’ll be redirected to your **Datastore** page, where the **Syncing Metadata** status will appear. During this stage, Contextual AI syncs the contents of your Confluence site. This process is typically quick but may take some time if you have a large site. Once metadata syncing is complete, ingestion will begin automatically and the status will update to **Processing**. **Note:** You can begin using your datastore while syncing continues, but you’ll only have access to the documents that have already been ingested. You can check the progress bar to track the status of the sync. Once the contents of your Confluence site finishes ingesting, you’ll see a **green checkmark** indicating that your datastore is ready to use. # Entitlements Enforcement Source: https://docs.contextual.ai/connectors/entitlements-enforcement Using your Connector with Entitlements Enforcement ## Using your Connector with Entitlements Enforcement To use your connected Datastore, simply link it to an Agent and start querying. All original datasource entitlements are automatically enforced. If you do not have access to a document in the source system, two restrictions will apply: 1. The document will not be used to generate a response to the your query. 2. On the **Datastore** page, the document will be displayed as **Private Document**. You'll only be able to view documents that you have access to. Screenshot 2025-09-08 at 6.56.01 PM.png # Global Datastores Source: https://docs.contextual.ai/connectors/global-datastores Pre-built datastores available to all users for testing and demos ## Overview When you create a new Contextual AI account, you automatically have access to several **global datastores**—pre-built knowledge bases you can use immediately to test agents, run demos, or explore the platform without uploading your own documents. These datastores are read-only and available to all users. ## Available Global Datastores 7,546 docs · 41.3 GB 497 docs · 4.8 GB 7 docs · 59.1 MB 1,786 docs · 50.7 MB 54 docs · 82 MB ## Using Global Datastores ### In the Platform UI 1. Go to **Datastores** in the left navigation 2. Global datastores are marked with a **Demo** badge 3. When creating an agent, select any global datastore from the dropdown ### In Agent Composer YAML Reference a global datastore by its ID in your YAML configuration: ```yaml theme={null} nodes: search: type: SearchStep config: datastores: - input_mapping: query: __inputs__#query ``` ### Via API Use the datastore ID when creating or configuring agents: ```shell theme={null} curl --request POST \ --url https://api.contextual.ai/v1/agents \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{ "name": "My Demo Agent", "datastore_ids": ["78f6bb93-04a5-4883-95f4-d681da6eee23"] }' ``` ## Example Agents See these demos built on global datastores: * [Raspberry Pi Agent](/examples/raspberry-pi-agent) — Technical support and troubleshooting for Raspberry Pi hardware * [Rocket Science Agent](/examples/rocket_science) — Root cause analysis for rocket engine anomalies * [Material Science Agent](/examples/material-science-agent) — Research assistant using arXiv materials papers; explains in ELI5 style * [Test Program Generation](/examples/test-automation) — Generate OpenTAP test programs and instrument drivers # Google Drive Source: https://docs.contextual.ai/connectors/google-drive Connect your Google Drive documents to Contextual AI ## Connecting Google Drive Log in through the Contextual AI UI and follow these steps to configure Google Drive as a data source. ### 1. Set Data Source Name & Type * Click **Datastores** in the left-hand pane, followed by the **Create** button in the top right. * Give your datastore a unique name, then select **Third-Party Connection** as the method for adding content to your datastore. Click the **Next** button. * On the **Connection Setup** page, you can **set up auto top-off** to automatically add credits when low, or click **Skip for now** to bypass this step. **Note:** Auto top-off is recommended in [On Demand mode](https://docs.contextual.ai/user-guides/billing) to prevent ingestions from failing halfway if you use up your balance. ### 2. Review Access Levels & Set Account Type * Click the **Connect** button next to **Google Drive**. * Confirm Contextual AI's read/write access levels and review the end user terms. Click **Next** to continue. * Select your **Account Type**: **Admin account (read-only)** - You are setting up a connection for your organization and have admin access to your data source. **User account (read-only)** - You are setting up a personal connection or do not have admin access to your data source. Please [refer to this link](https://help.merge.dev/articles/9280406-why-are-specific-scopes-needed-for-file-storage-integrations) for a full list of permissions you need for admin authorization. * Click **Open window** to authorize your account. ### 3. Authorize Connection & Sync Settings * In the pop-up window, select the account for authorizing the connection. * Click **Continue** to authorize the connection. ### 4. Configure Sync Settings Contextual AI offers two ways to sync your data. You can choose to sync all your files or only specific folders in Google Drive. #### Sync Options * **Share all files** - Grants access to all content in your Google Drive. * **Share specific folders** - Restricts access to only the folders you select. To share specific folders: * Hover over the folder and check the box to select it. * You can click into a folder to view its contents, but note that **only folders**—not individual files—can be selected. * Select one or multiple folders as needed. * Click **Confirm** to finalize your selections, then click **Next** once setup is complete. You can review or edit your connection (for example, to choose a different folder) on the confirmation page. Click **Finish** to continue. ### 5. Create Datastore & Start Sync You’re now ready to start syncing your data. Click **Create** to initialize your connection and create your datastore. You’ll be redirected to your **Datastore** page, where the **Syncing Metadata** status will appear. During this stage, Contextual AI syncs your file metadata, users, and groups. Once metadata syncing is complete, ingestion will begin automatically and the status will update to **Processing**. **Note:** The syncing process is typically quick, but may take a few hours if you have a large number of files, users, or groups.

You can begin using your datastore while syncing continues, but you’ll only have access to the documents that have already been ingested.
You can check the progress bar to track how many documents remain to be processed. Once all documents finish ingesting, you’ll see a **green checkmark** indicating that your datastore is ready to use. # Local File Upload Source: https://docs.contextual.ai/connectors/local-file-upload Upload your documents to Contextual AI ## Uploading Your Local File Log in through the Contextual AI UI and follow these steps to upload a local file to use as a data source. ### 1. Set Data Source Name & Type * Click **Datastores** in the left-hand pane, followed by the **Create** button in the top right. * Give your datastore a unique name, then click the **local file upload button** (the left panel) as the method for adding content to your datastore. Click the **Next** button. ### 2. Upload & Process Your File * On the **Datastores** page, click the **Upload** button. * Drag and drop or select the file to upload, and click the **Start Uploading** button. * After Contextual AI finishes processing your file, go back to the **Datasources** page. You should see your newly-created datasource with the previously uploaded file. # Microsoft OneDrive Source: https://docs.contextual.ai/connectors/microsoft-onedrive Connect your Microsoft OneDrive documents to Contextual AI ## Connecting Microsoft OneDrive You can sync your OneDrive data via the Contextual AI SharePoint connector. **Note:** Before getting started, ensure that you are a Super Admin. [Follow this guide](https://contextualai.integrations.guide/articles/10744024) to configure Super Admin permissions in SharePoint. Log in through the Contextual AI UI and follow these steps to configure OneDrive as a data source. ### 1. Set Data Source Name & Type * Click **Datastores** in the left-hand pane, followed by the **Create** button in the top right. * Give your datastore a unique name, then select **Third-Party Connection** as the method for adding content to your datastore. Click the **Next** button. * On the **Connection Setup** page, you can **set up auto top-off** to automatically add credits when low, or click **Skip for now** to bypass this step. **Note:** Auto top-off is recommended in [On Demand mode](https://docs.contextual.ai/user-guides/billing) to prevent ingestions from failing halfway if you use up your balance. ### 2. Review Access Levels & Set Account Type * Click the **Connect** button next to **SharePoint**. * Confirm Contextual AI's read/write access levels and review the end user terms. Click **Next** to continue. * Select your **Account Type**: **Admin account (read-only)** - You are setting up a connection for your organization and have admin access to your data source. **User account (read-only)** - You are setting up a personal connection or do not have admin access to your data source. Please [refer to this link](https://help.merge.dev/articles/9280406-why-are-specific-scopes-needed-for-file-storage-integrations) for a full list of permissions you need for admin authorization. * Click **Open window** to authorize your account. ### 3. Configure Sync Settings Contextual AI offers two ways to sync your data. You can choose to sync all your files or only specific folders. #### Sync Options * **Share all files** - Grants access to all content. This includes OneDrive folders within SharePoint sites and an individual user’s OneDrive folders. * **Share specific folders** - Restricts access to only the folders you select. You can pick specific OneDrive folders within SharePoint sites, but not an individual user’s OneDrive folders. Once you've selected and configured your sync option, click **Confirm** to finalize your selections, then click **Next** once setup is complete. Click **Finish setup** to continue. On the next page, click **Create** to initialize your connection and create your datastore. You’ll be redirected to your **Datastore** page, where the **Syncing Metadata** status will appear. During this stage, Contextual AI syncs your file metadata, users, and groups. Once metadata syncing is complete, ingestion will begin automatically and the status will update to **Processing**. You can check the progress bar to track how many documents remain to be processed. **Note:** The syncing process is typically quick, but may take a few hours if you have a large number of files, users, or groups.

You can begin using your datastore while syncing continues, but you’ll only have access to the documents that have already been ingested.
Once all documents finish ingesting, you’ll see a **green checkmark** indicating that your datastore is ready to use. # Microsoft SharePoint Source: https://docs.contextual.ai/connectors/microsoft-sharepoint Connect your Microsoft SharePoint documents to Contextual AI ## Connecting Microsoft SharePoint Log in through the Contextual AI UI and follow these steps to configure SharePoint as a data source. You can sync OneDrive data via the SharePoint connector. For detailed instructions, please see [Connecting to OneDrive via Sharepoint](#connecting-to-onedrive-via-sharepoint) ### 1. Set Data Source Name & Type * Click **Datastores** in the left-hand pane, followed by the **Create** button in the top right. * Give your datastore a unique name, then select **Third-Party Connection** as the method for adding content to your datastore. Click the **Next** button. * On the **Connection Setup** page, you can **set up auto top-off** to automatically add credits when low, or click **Skip for now** to bypass this step. **Note:** Auto top-off is recommended in [On Demand mode](https://docs.contextual.ai/user-guides/billing) to prevent ingestions from failing halfway if you use up your balance. ### 2. Review Access Levels & Set Account Type * Click the **Connect** button next to **SharePoint**. * Confirm Contextual AI's read/write access levels and review the end user terms. Click **Next** to continue. * Select your **Account Type**: Admin account (read-only)\*\* - You are setting up a connection for your organization and have admin access to your data source. User account (read-only)\*\* - You are setting up a personal connection or do not have admin access to your data source. Please [refer to this link](https://help.merge.dev/articles/9280406-why-are-specific-scopes-needed-for-file-storage-integrations) for a full list of permissions you need for admin authorization. * Click **Open window** to authorize your account. ### 3. Configure Sync Settings Contextual AI offers two ways to sync your data. You can choose to sync all your files or only specific folders in Sharepoint. #### Sync Options * **Share all files** - Grants access to all content in Sharepoint. * **Share specific folders** - Restricts access to only the folders you select. To share specific folders: * Hover over the folder and check the box to select it. * You can click into a folder to view its contents, but note that **only folders**—not individual files—can be selected. * Select one or multiple folders as needed. * Click **Confirm** to finalize your selections, then click **Next** once setup is complete. * Click **Finish setup** to continue. On the next page, click **Create** to initialize your connection and create your datastore. You’ll be redirected to your **Datastore** page, where the **Syncing Metadata** status will appear. During this stage, Contextual AI syncs your file metadata, users, and groups. Once metadata syncing is complete, ingestion will begin automatically and the status will update to **Processing**. You can check the progress bar to track how many documents remain to be processed. **Note:** The syncing process is typically quick, but may take a few hours if you have a large number of files, users, or groups.

You can begin using your datastore while syncing continues, but you’ll only have access to the documents that have already been ingested.
Once all documents finish ingesting, you’ll see a **green checkmark** indicating that your datastore is ready to use. # Overview Source: https://docs.contextual.ai/connectors/overview Connecting your data to Contextual AI Contextual AI data connectors enable you to seamlessly integrate data from third-party sources. Key features include: * **Full ingestion and indexing** - Data is ingested and indexed through our advanced pipeline, ensuring optimal performance and speed compared to live search. * [Entitlements enforcement](#using-your-connector-with-entitlements-enforcement) - Permissions from your upstream data sources are automatically synced and enforced within the Contextual platform. Users without access to a document cannot see it in the Datastore or query against it. * [Auto and manual syncing](#auto--manual-syncing) - Data updates are synced every 3 hours, while permissions are refreshed every hour to maintain freshness. You can also trigger a manual sync at any time to capture changes. * **Folder-level selection** - Sync only the folders you need. ### Supported Data Sources Contextual AI currently supports the following data sources: * [Box:](box) PDF files, Word documents, PowerPoint presentations, Markdown files, plain text files * [Confluence:](confluence) PDF files, Word documents, PowerPoint presentations, Markdown files, plain text files * [Google Drive:](google-drive) Google Docs, Google Slides, PDF files, Word documents, PowerPoint presentations, Markdown files, plain text files * [OneDrive:](microsoft-onedrive) PDF files, Word documents, PowerPoint presentations, Markdown files, plain text files * [Sharepoint:](microsoft-sharepoint) PDF files, Word documents, PowerPoint presentations, Markdown files, plain text files **Coming Soon:** Support for Dropbox and Salesforce

Please email [connectors@contextual.ai](mailto:connectors@contextual.ai) for connector-related questions or feedback.
# 3GPP Spec Explorer Source: https://docs.contextual.ai/examples/3gpp-spec-explorer AI agent to search and reason over 3GPP specifications (Release 19 and others) ## Overview This agent lets you search and reason over a large knowledge base of 3GPP specifications—PDF and Word documents across multiple releases, including Release 19. Ask about information elements (IEs), mobility, registration, requirements, and more; answers are grounded in the actual specs. **Built with [Agent Composer](/quickstarts/agent-composer)**, Contextual AI's framework for production-ready AI agents. ## The Knowledge Base The agent is connected to a datastore of 3GPP standards (e.g. Series 36 LTE, 38 NR, and others). The documents were obtained from the 3GPP archive using the [download\_3gpp](https://pypi.org/project/download_3gpp/) CLI and ingested for search and retrieval. ## What the Agent Does You can ask natural-language questions such as: * **IEs and parameters**: "What is the purpose of IE X in the RRC connection setup?" * **Mobility**: "What are the handover requirements for NR in Release 19?" * **Registration**: "Describe the registration procedure for 5G NR." * **Requirements**: "What does the spec say about timing for TAU?" The agent retrieves relevant chunks from the specs and synthesizes answers with citations to the source documents. ## Try the Demo Search the 3GPP spec yourself ## Learn More * [Contextual AI Demos](/examples/overview-demos) — All live demos in one place * [Agent Composer Documentation](/quickstarts/agent-composer) * [Prompt Builder Quickstart](/quickstarts/prompt-builder) * [Agent Composer YAML Guide](/how-to-guides/agent-composer-yaml) # 3GPP Wireless Log Analysis Agent Source: https://docs.contextual.ai/examples/3gpp-wireless-log-analysis AI agent for automated root cause analysis of 3GPP LTE-style device and eNB logs ## Overview This agent performs automated root cause analysis on 3GPP LTE-style device logs: eNB/RRH events, error codes, handovers, and CPRI/HARQ/BLER-style signals. It cross-references logs against a debug reference guide to decode sub-codes, correlate events across subsystems, and produce RCA reports—work that would otherwise require a senior wireless engineer to manually sift through thousands of timestamped entries. **Powered by the [Device Log Analysis](/how-to-guides/agent-composer-templates#device-log-analysis-enterprise) template** in [Agent Composer](/quickstarts/agent-composer)—available for Enterprise customers; [request a demo](https://contextual.ai/request-a-demo) for access. ## Try the Demo Analyze 3GPP wireless logs yourself 3GPP Wireless samples are preloaded—pick a suggested query and run the analysis. Running on the production DLA template. Demo queries are cached and sped up for demonstration purposes. ## The Problem When a device or network incident occurs, engineers must manually sift through thousands of timestamped log entries containing cryptic error codes, protocol abbreviations, and vendor-specific identifiers. Root cause analysis requires: * Decoding error codes against reference documentation * Correlating events across subsystems (eNB-SYS, eNB-MAC, eNB-PHY, eNB-RRC, eNB-S1AP, eNB-X2AP, UE-MAC/UE-RRC) * Building timelines to establish causality between failures (e.g. CPRI degradation → handover failures → call drops) * Identifying patterns across multiple failure events * Distinguishing symptoms from root causes ## How It Works ### In production **What you do:** Upload a **log file** and optionally **additional context** (e.g. a debug reference guide), then ask a query—for example *"Why did the calls drop?"*. **What happens automatically:** A multi-agent implementation takes over. The system parses the log, builds a searchable database from the log and reference files, runs root cause analysis, and produces outputs. **Pipeline stages:** Uploading files → parsing logs → building the database → root cause analysis → generating the report. **Outputs:** The agent delivers a **detailed RCA report** (executive summary, timeline, decoded errors, recommended actions) and can generate **visualizations** (causation timelines, degradation charts). **Auditable:** Every step is visible—tasks, trajectory, intermediate artifacts, and the final report—so teams can review the analysis and act on findings. ### In this demo 3GPP Wireless files are **preloaded**; choose a suggested query and run the analysis. ## Example Questions Suggested queries in the demo: * "Why did the calls drop?" * "When did this problem start?" * "Was there a problem with RRH:1?" ## Output Example outputs from the three suggested queries: **"Why did the calls drop?"** — Full-day RCA timeline across 5 correlated metrics: CPRI fronthaul BER on RRH:2, sector temperature, SCTP heartbeat to MME, PSU voltage sag, and handover failures / radio link failures: eNB 4325 call drop RCA timeline — CPRI BER, thermal, SCTP, PSU, and handover failures over a full day Zoomed into the critical 6-minute onset window (17:09–17:15), the agent pinpoints the cascade: CPRI BER spike triggers DRX misalignment, thermal breach forces TX power reduction, S1/SCTP path degrades, and handover failures begin: Critical failure onset window — cascade from CPRI spike through thermal breach to call drops **"When did this problem start?"** — Hourly ERROR and WARN event counts pinpoint the problem onset at 17:10:01, with zero errors in the preceding 8 hours: Hourly ERROR and WARN event counts — problem start identified at 17:10:01 CPRI link quality on RRH:2 and HARQ retransmission rate show the degradation building before the threshold breach: CPRI link quality and HARQ retransmission rate — RRH:2 degradation trend PRB utilization and handover failure counts confirm the downstream impact: PRB utilization and handover failures — downstream service degradation **"Was there a problem with RRH:1?"** — Side-by-side BER comparison of RRH:1 (healthy, green) vs RRH:2 (root cause, escalating orange/red) confirms the fault is isolated to RRH:2: CPRI BER timeline — RRH:1 healthy vs RRH:2 root cause comparison BLER and HARQ comparison reinforces that RRH:1 operated normally while RRH:2 degraded: BLER and HARQ comparison — RRH:1 vs RRH:2 The **final RCA report** includes: * **Executive summary** — Root cause (e.g. CPRI fronthaul degradation on RRH:2), secondary factors (DRX misalignment, SCTP/MME, backhaul jitter), and impact (UE counts by failure type: RLF, RRC reject, NAS attach reject) * **Detailed timeline** — Phased chronology with decoded log lines (early degradation → threshold breach → handover failures → thermal throttle → congestion and rejects), so reviewers can follow the sequence event-by-event * **Error analysis by UE** — Grouped tables (e.g. handover failure → RLF call drops, RRC reject due to congestion, NAS attach reject with cause codes) with timestamps and preceding causes * **Technical explanation** — Root cause deep dive and cascade effects (e.g. CPRI BER progression, RF/UL BLER, thermal throttle, ANR staleness and HO prep failure, SCTP/MME overload) with supporting tables * **Answer to original question** — Direct answer to the query (e.g. call drop mechanism: CPRI → RF degradation → thermal throttle → HO failures → T304 expiry → RLF) and optional mechanism diagram * **Attached visualizations** — References to the generated timeline visuals (system health, call drop causality) * **Recommended actions** — Prioritized table (e.g. CRITICAL / HIGH / MEDIUM) with action and rationale for each ## 3GPP Wireless sample files in the demo * **Device log** (`3gpp_wireless_device_log.txt`) — eNB/UE failure log (eNB-SYS, eNB-MAC, eNB-PHY, eNB-RRC, eNB-S1AP, eNB-X2AP, UE-MAC/UE-RRC); severity, tags, codes (e.g. `RACH_INIT`, `RRC_CONN_REQ`, `CPRI_LINK_DEGRADED_0xE1`, `VNDR_THERMAL_0x4F2A`) decoded against the matching reference. * **Debug reference guide** (`3gpp_wireless_debug_rules.txt`) — eNB debug reference ("3GPP LTE eNB Debug Reference Guide"): RRC/NAS, EMM/ESM, S1AP/X2AP, timers, RSRP/RSRQ, vendor diagnostics—paired with the log above. ## Learn More * [Device Log Analysis (overview)](/examples/device-log-analysis) — General DLA template and all three sample datasets * [ATE Board Validation](/examples/ate-log-analysis) — Board validation / tester logs * [Mazda Infotainment](/examples/mazda-infotainment-log-analysis) — Infotainment crash logs * [Getting Started with the Contextual AI Platform](/quickstarts/getting-started) * [Agent Composer Templates](/how-to-guides/agent-composer-templates) — Basic Search, Agentic Search, and Device Log Analysis (Enterprise) * [Request a demo](https://contextual.ai/request-a-demo) # ATE Board Validation Agent Source: https://docs.contextual.ai/examples/ate-log-analysis AI agent for automated root cause analysis of ATE board validation failure logs ## Overview This agent performs automated root cause analysis on ATE (Automated Test Equipment) board validation failure logs. It cross-references multi-site test logs against a debug reference guide to decode error codes, trace fault propagation across test phases, and identify whether failures are board defects or tester artifacts—work that would otherwise require a hardware validation engineer to manually correlate hundreds of timestamped events across power, memory, PCIe, and signal integrity subsystems. **Powered by the [Device Log Analysis](/how-to-guides/agent-composer-templates#device-log-analysis-enterprise) template** in [Agent Composer](/quickstarts/agent-composer)—available for Enterprise customers; [request a demo](https://contextual.ai/request-a-demo) for access. ## Try the Demo Analyze board validation logs yourself ATE samples preloaded—pick a suggested query and run the analysis. Running on the production DLA template. Demo queries are cached and sped up for demonstration purposes. ## The Problem When a board validation session fails, engineers must determine whether the fault lies with the device under test (DUT), the tester hardware, or a transient environmental condition. ATE logs contain: * Per-site parallel test events across multiple DUT sockets * Power rail telemetry (VDDQ, VCCIN, VCCIO, VPP, VCCSA) sampled throughout each test phase * DDR5 training sequences with per-phase margin measurements * PCIe link training LTSSM states and equalization results * Signal integrity eye measurements, insertion loss, jitter, and skew * Voltage regulator diagnostics including temperature, efficiency, and ripple * Tester HAL artifacts (e.g. multi-site inrush coupling transients) that must be distinguished from real faults Without tooling, a failure like "SITE:2 DDR5 training fail" requires manually correlating voltage telemetry, thermal readings, retry logs, and VR diagnostics across hundreds of lines to determine the actual root cause. ## How It Works ### In production **What you do:** Upload an **ATE failure log** and optionally a **debug reference guide**, then ask a query—for example *"Why did SITE:2 fail?"*. **What happens automatically:** A multi-agent implementation takes over. The system parses the log, builds a searchable database from the log and reference files, runs root cause analysis across all test phases and sites, and produces outputs. **Pipeline stages:** Uploading files → parsing logs → building the database → root cause analysis → generating the report. **Outputs:** The agent delivers a **detailed RCA report** covering executive summary, per-site timeline, decoded errors, voltage/thermal trajectory, and prioritized recommended actions. It can also generate **visualizations** such as VDDQ voltage sag charts and multi-site comparison tables. **Auditable:** Every step is visible—tasks, trajectory, intermediate artifacts, and the final report—so validation teams can review the analysis and act on findings. ### In this demo Sample ATE files are **preloaded**; choose a suggested query and run the analysis. ## Example Questions Suggested queries in the demo: * "Why did SITE:2 fail?" * "When did this problem first appear?" * "Is this a device failure or a tester failure?" ## Output Example outputs from the three suggested queries: **"Why did SITE:2 fail?"** — VDDQ voltage regulator telemetry for the final test session: output voltage sagging to the spec minimum, output current climbing toward the limit, junction temperature spiking above the warning threshold, and efficiency degrading — all four panels confirm a single failing component: SITE:2 VDDQ voltage regulator telemetry — voltage sag, current spike, temperature, and efficiency **"When did this problem first appear?"** — Long-horizon view showing the VDDQ output capacitor ESR ratio climbing over time, with voltage holding nominal until the final test session where it drops to the spec minimum as temperature rises: SITE:2 VDDQ ESR ratio, output voltage, and VR temperature over time **"Is this a device failure or a tester failure?"** — Zoomed into the critical failure window, VOUT drops from 1.089V to just above the 1.045V spec minimum, IOUT climbs to 7.5A, and junction temperature crosses the 85°C warning threshold — all on a single DUT while other sites remain nominal, confirming a board defect: VDDQ critical failure window — VOUT sag, IOUT climb, and junction temperature for DUT PCB-2025-08142 SITE:2 The **final RCA report** includes: * **Executive summary** — Which site(s) failed, root cause (e.g. VDDQ voltage regulator degradation), and yield impact * **Fault timeline** — Chronological sequence showing voltage sag progression, training retry escalation, and cascade into secondary failures * **Per-site comparison** — Side-by-side pass/fail status and key metrics (VDDQ voltage, VR temperature, DDR5 eye width) across all 4 test sites * **Root cause chain** — Causal trace from the originating hardware fault through each downstream failure (e.g. VDDQ sag → DDR5 training fail → PCIe Gen fallback → bin FAIL) * **Tester artifact analysis** — Identifies HAL transient events (e.g. `HAL_VDDQ_COUPLE_0x0B`) and correctly classifies them as non-causal measurement artifacts rather than real faults * **Recommended actions** — Prioritized table with action and rationale (e.g. replace VDDQ output capacitor on failed DUT, retest on same tester to confirm tester health) ## ATE sample files in the demo * **Device log** (`ate_device_log_30mb.txt`) — A timestamped multi-site board validation log with entries from subsystems including ATE-SYS, ATE-HAL, ATE-PWR, ATE-FPGA, DUT-VR, DUT-THERM, and per-site test events (SITE-1 through SITE-4). Each line includes severity (INFO/WARN/ERROR), subsystem tags, and synthetic diagnostic codes. * **Debug reference guide** (`ate_debug_rules.txt`) — An ATE board validation debug reference covering power rail specifications, DDR5 training sequence codes, PCIe link training codes, voltage regulator diagnostic codes, signal integrity measurement codes, test bin definitions, HAL artifact classifications, and common root cause patterns. ## Learn More * [Device Log Analysis (overview)](/examples/device-log-analysis) — General DLA template and all three sample datasets * [3GPP Wireless](/examples/3gpp-wireless-log-analysis) — LTE-style eNB/device logs * [Mazda Infotainment](/examples/mazda-infotainment-log-analysis) — Infotainment crash logs * [Getting Started with the Contextual AI Platform](/quickstarts/getting-started) * [Agent Composer Templates](/how-to-guides/agent-composer-templates) — Basic Search, Agentic Search, and Device Log Analysis (Enterprise) * [Request a demo](https://contextual.ai/request-a-demo) # Device Log Analysis Agent Source: https://docs.contextual.ai/examples/device-log-analysis AI agent for automated root cause analysis of device logs (wireless, ATE, infotainment) ## Overview **Powered by the [Device Log Analysis](/how-to-guides/agent-composer-templates#device-log-analysis-enterprise) template** in [Agent Composer](/quickstarts/agent-composer)—Enterprise; [request a demo](https://contextual.ai/request-a-demo). Root cause analysis (RCA) for device logs. The agent parses logs, cross-references debug rules, and generates RCA reports—work that would otherwise take a senior engineer hours manually. **Demo log files are synthetic** (created for this demo); download them from the live demo and try the same workflow in your own environment. The **[live demo](https://demo.contextual.ai/log-analysis)** includes **three sample datasets**—each is a log plus matching debug reference for a different scenario. Run one of the suggested queries (or your own). For more Agent Composer demos beyond DLA, see **[Contextual AI Demos](/examples/overview-demos)**. **Demo behavior:** Refreshing the page will clear your progress. For this demo, queries are cached and sped up (production DLA template). ## Try the Demo Analyze device logs yourself ## Sample datasets in the demo The live demo offers **three** preloaded options—each is a **pair** of synthetic files (device log + debug reference). Use the links below for scenario-specific example questions, example outputs, and file descriptions. LTE-style eNB/RRH logs, handovers, CPRI/HARQ/BLER. Example: "Why did the calls drop?" Multi-site test logs, VR telemetry, DDR5/PCIe. Example: "Why did SITE:2 fail?" CMU crash logs, format-string-style bugs. Example: "Why did my car stereo restart?" ## The Problem When a device or network incident occurs, engineers must manually sift through thousands of timestamped log entries containing cryptic error codes, protocol abbreviations, and vendor-specific identifiers. Root cause analysis requires: * Decoding error codes against reference documentation * Correlating events across subsystems * Building timelines to establish causality between failures * Identifying patterns across multiple failure events * Distinguishing symptoms from root causes ## How It Works ### In production **What you do:** Upload a **log file** and optionally **additional context** (e.g. a debug reference guide), then ask a query—for example *"Why did the call drop?"*. **What happens automatically:** A multi-agent implementation takes over. The system breaks the work into **tasks**, shows **trajectory** as agents run, **parses** the logs, **builds searchable databases** from the log and reference files, runs root cause analysis, and produces outputs. **Pipeline stages:** Uploading files → parsing logs → building the database → root cause analysis → generating the report. **Outputs:** The agents can **generate Python scripts** (e.g. custom parsers) that run in a secure **VM**, produce **visuals** (causation timelines, degradation charts), and deliver a **detailed RCA report** (executive summary, timeline, decoded errors, recommended actions). **Auditable:** You specify the output (report, artifacts, visuals). Every step—tasks, trajectory, intermediate artifacts, and final report—is visible so teams can review and learn from the analysis. ### In this demo **Three** demo datasets are **preloaded** (3GPP Wireless, ATE Board Validation, Mazda Infotainment). Each is a device log plus matching debug reference. See the dataset pages above for suggested queries and example outputs. ## Output Each scenario produces a **detailed RCA report** and optional **visualizations**. Report content varies by domain but typically includes an executive summary, fault or session timeline, decoded errors, root cause chain, and prioritized recommended actions. For concrete example outputs and screenshots: * **[3GPP Wireless](/examples/3gpp-wireless-log-analysis#output)** — Call drop causality, system health timelines, BER/BLER/HARQ comparisons * **[ATE Board Validation](/examples/ate-log-analysis#output)** — VDDQ voltage/thermal charts, per-site comparison, tester artifact analysis * **[Mazda Infotainment](/examples/mazda-infotainment-log-analysis#output)** — Incident timeline, crash sequence, format string vulnerability walkthrough ## Sample files in the demo Each of the three datasets is a **pair** of synthetic files: a timestamped **device log** and a **debug reference guide**. The live demo loads all three so you can compare scenarios. For file names and contents per dataset: * **[3GPP Wireless](/examples/3gpp-wireless-log-analysis#3gpp-wireless-sample-files-in-the-demo)** — `3gpp_wireless_device_log.txt`, `3gpp_wireless_debug_rules.txt` * **[ATE Board Validation](/examples/ate-log-analysis#ate-sample-files-in-the-demo)** — `ate_device_log_30mb.txt`, `ate_debug_rules.txt` * **[Mazda Infotainment](/examples/mazda-infotainment-log-analysis#mazda-sample-files-in-the-demo)** — `mazda_device_log_30mb.txt`, `mazda_debug_rules.txt` ## Learn More * [Contextual AI Demos](/examples/overview-demos) — Other live demos (spec search, materials, test automation, and more) * [Getting Started with the Contextual AI Platform](/quickstarts/getting-started) * [Example: Device Log Analysis (Enterprise)](/quickstarts/why-contextual-ai#example-device-log-analysis-enterprise) — How multi-source root cause analysis fits the platform * [Agent Composer Templates](/how-to-guides/agent-composer-templates) — Basic Search, Agentic Search, and Device Log Analysis (Enterprise) * [Request a demo](https://contextual.ai/request-a-demo) # Documentation Agent Source: https://docs.contextual.ai/examples/documentation_agent The agent powering agentic search on this site: try it in the search bar ## Where to find it The documentation agent powers the chat experience on this very site. You can use it in two places: * **Top:** The search bar at the top of the page ("Ask Contextual AI...") — type your question and send. * **Right:** The chat panel persists on the right after you run your first query — use it to run multi-turn conversations. When you ask a question, **Mintlify's built-in search** first surfaces **keyword-based results** so you get quick, relevant links. In parallel, the **agent runs the longer-running task**: it retrieves across the documentation, runs multi-step research (Agentic Search), and streams back a detailed, cited answer. You get both instant keyword hits and a synthesized response. **GitHub repo:** The sync code for keeping a Contextual AI datastore in sync with your docs is public: [ContextualAI/datastore-sync](https://github.com/ContextualAI/datastore-sync)—see the section below for an overview. ## Why this agent ### (and why not generic LLMs or basic RAG) **Use cases:** This is the kind of agent we use for **customer engineering** and **self-serve users**. We believe that **all docs need agents**, and **all websites need agents**, because people would rather prompt than search for info. If you ask a **generic LLM** and point it at the docs page, you tend to get **more general, less relevant** responses (based on qualitative review). Our agent gives **very specific, detailed** answers; the docs provided to it **more precisely constrain** the information it can use. In short: it's a **better docs agent**, and you can set one up for yourself in **hours**. Compared with web search, **basic RAG** or no citations: * **Citations are key** — People often want to **read the source doc** after the initial response: to verify, go deeper, or share the link. This agent cites every factual claim and adds a References section with doc URLs. * **Multi-step retrieval** — Single-shot RAG can miss context or mix in irrelevant chunks; Agentic Search does breadth-then-depth over the docs and produces more precise answers. * **Grounded generation** — Responses are generated only from retrieved content, reducing hallucination. We've already seen users rely on it for **troubleshooting** and support-style questions—before we had even written about it—because they can trust the references and follow them into the docs. ## Challenges we solved with this agent Running a docs agent well comes with a few realities we've designed for: * **Multimodal content** — Documentation often has important information in **images** (diagrams, screenshots, UI). Our pipeline handles multimodal content state-of-the-art: we parse and index both text and images so the agent can retrieve and use information from figures, screenshots, and diagrams, not just body text. * **Keeping the agent up to date** — Docs change **many times a day**. The agent must stay in sync with the latest content. You can do that with [Contextual AI connectors](/connectors/overview) (e.g. Confluence, SharePoint, Google Drive), or—for GitHub-backed docs—with the **code we wrote and share**: [**datastore-sync**](https://github.com/ContextualAI/datastore-sync). It syncs your repo (and optionally your website) into a Contextual AI datastore via webhooks and incremental updates so the agent always has fresh content. * **Citations** — As above: citations aren't just for trust; they let users **open the source** and read the full doc after the initial response. * **Repo vs. web:** Unlike searching docs via the web, our documentation lives in our **GitHub repo** and we sync only what's published (e.g. pages in nav, `docs.json`). We may have **outdated or unlisted pages** in the repo that still exist but aren't findable on the site—our agent **won't surface those**, because they're not in the synced datastore. LLMs that use web search can sometimes surface those older or hidden pages; our agent deliberately reflects only the docs we publish, so answers stay aligned with what we actually ship. ## How it works 1. **Your documentation as data:** These docs are ingested into a Contextual AI datastore, chunked and indexed. They're kept in sync so when content is updated, the agent has the latest info (here, via sync code we share; see below). 2. **Keyword search + agent:** Mintlify's built-in search returns keyword-based results immediately. The agent then runs the [Agentic Search](/how-to-guides/agent-composer-templates#agentic-search) template—multi-turn research over the datastore—and streams a response with citations and a References section. 3. **Grounded generation:** Answers are generated only from the research step, with citations in `[n]()` format and links to the documentation URLs. ## Try it Use the search bar at the top and ask a question about Contextual AI. ## Build your own: sync + agent We share the building blocks so you can run a documentation agent on your own content. ### datastore-sync Open-source repo that keeps a Contextual AI datastore in sync with your docs (and optionally your website). We use it for this site: [**ContextualAI/datastore-sync**](https://github.com/ContextualAI/datastore-sync). * **GitHub docs sync:** Automatically syncs MDX/MD and OpenAPI specs from a GitHub repo (e.g. Mintlify docs). Incremental sync (commit SHAs, tree diffs), published-content filtering via `docs.json`, and OpenAPI parsing into per-endpoint markdown with human-readable URLs. Compiles MDX to clean PDFs before ingestion for better RAG quality. * **Website sync (optional):** Firecrawl-based sync for other website content, with sitemap crawling and diffing (agent using this section coming soon) * **State:** Redis-backed state (or local JSON in dev); Vercel-ready with webhook endpoints (e.g. `POST /sync/github` for GitHub push events). Use it to feed an agent with your published documentation so it stays up to date as you push changes. ## Next steps * [Agent Composer Documentation](/quickstarts/agent-composer) — Create and configure agents in the UI. * [Agentic Search](/how-to-guides/agent-composer-templates#agentic-search) — Template used by this documentation agent. * [Connectors](/connectors/overview) — Keep datastores in sync with Confluence, SharePoint, Drive, and more. * [Template Catalog](/examples/templates-catalog) — Other templates (Basic Search, Enterprise, etc.). # Material Science Agent Source: https://docs.contextual.ai/examples/material-science-agent AI agent for materials research, properties analysis, and material selection—explains like you're 5 (ELI5) ## Overview This agent assists with material science research—answering questions about thermal properties, strength characteristics, synthesis methods, and application recommendations by drawing on thousands of arXiv research papers. It explains concepts in **ELI5** (“explain like I’m 5”) style: simple, clear, and accessible. **Built with [Agent Composer](/quickstarts/agent-composer)** using the Agentic Search template. ## The Problem Materials researchers spend hours searching through academic papers to find relevant property data, synthesis methods, or application guidance. Common challenges: * Finding specific material properties across thousands of papers * Understanding synthesis conditions and experimental parameters * Comparing materials for specific applications * Staying current with the latest research ## What the Agent Does Ask the agent about material properties, and it uses multi-step reasoning to: 1. Search across 7,500+ arXiv materials science papers 2. Identify relevant research and experimental data 3. Synthesize findings from multiple sources 4. Return verified answers with citations to source papers ## Example Questions * **ELI5**: "Explain quantum magnets like I'm 5" * **Property lookup**: "What are the thermal conductivity properties of graphene oxide composites?" * **Synthesis guidance**: "How do I synthesize high-purity titanium dioxide nanoparticles?" * **Material comparison**: "Compare the mechanical properties of carbon fiber vs glass fiber reinforced polymers" * **Application research**: "What materials are best suited for high-temperature battery electrodes?" ## Try the Demo Try the Material Science agent ## Learn More * [Agent Composer Documentation](/quickstarts/agent-composer) * [Global Datastores](/connectors/global-datastores) — This demo uses the arXiv Materials Science datastore # Mazda Infotainment Log Analysis Agent Source: https://docs.contextual.ai/examples/mazda-infotainment-log-analysis AI agent for automated root cause analysis of Mazda Connect infotainment system crash logs ## Overview This agent performs automated root cause analysis on Mazda Connect infotainment system logs. It cross-references CMU (Car Media Unit) event logs against a debug reference guide to decode crash sequences, identify software faults, and trace the root cause of system restarts—including subtle failure modes like format string vulnerabilities triggered by podcast metadata. **Powered by the [Device Log Analysis](/how-to-guides/agent-composer-templates#device-log-analysis-enterprise) template** in [Agent Composer](/quickstarts/agent-composer)—available for Enterprise customers; [request a demo](https://contextual.ai/request-a-demo) for access. ## Try the Demo Analyze infotainment logs yourself Mazda samples preloaded—pick a suggested query and run the analysis. Running on the production DLA template. Demo queries are cached and sped up for demonstration purposes. ## The Problem When an embedded vehicle system crashes repeatedly, engineers must determine whether the root cause is a hardware fault, a software bug, corrupted storage, or an external data input triggering unexpected behavior. Mazda Connect CMU logs contain: * Boot diagnostics (ROM CRC, RAM test, NAND mount, crash log presence) * Podcast feed sync events including RSS fetch, metadata parse, and format string scanning * Watchdog timer heartbeats and timeout sequences * Per-subsystem events across CMU-SYS, CMU-POD, CMU-META, CMU-RSS, CMU-AUDIO, CMU-BT, CMU-NAV, CMU-DISP * Crash dumps, reboot reason codes, and NAND storage error logs * Recovery and workaround sequences Without tooling, a repeating crash on podcast sync—where the failure mechanism is a C printf format string specifier buried in a show title—requires deep familiarity with both the CMU firmware architecture and the specific `%n` conversion specifier behavior to diagnose correctly. ## The Real Story In 2014–2016, thousands of Mazda owners discovered their car stereos were stuck in a reboot loop. The culprit turned out to be a podcast: "99% Invisible," hosted by Roman Mars. The infotainment system's podcast player was written in C and used `printf()` to display show titles on screen. The title "99% Invisible" contains a percent sign. In C, `printf()` treats `%` as the start of a special formatting instruction. When the software tried to display the title, it didn't just show the text — it tried to interpret `% In...` as a format code. Specifically, the sequence `%In` means: * `%` — start of a format specifier * ` ` — space flag (valid modifier) * `I` — length modifier (valid) * `n` — write the number of bytes printed so far to a memory address The `%n` specifier is dangerous because it writes data to a pointer. The software didn't supply a pointer — it was null (0x00000000). Writing to a null pointer causes an immediate crash: a segmentation fault (SIGSEGV). The system's watchdog timer detected the crash, rebooted... and immediately crashed again trying to sync the same feed. This happened every time the car started, producing an infinite reboot loop. The fix: a developer created an alternate podcast feed with the title "99 Percent Invisible" — spelling out the percent sign to avoid triggering the bug. This story was covered on Reply All Episode #140 and [99% Invisible Episode #350](https://99percentinvisible.org/episode/the-roman-mars-mazda-virus/). ## How It Works ### In production **What you do:** Upload a **CMU event log** and optionally a **debug reference guide**, then ask a query—for example *"Why did my car stereo restart?"*. **What happens automatically:** A multi-agent implementation takes over. The system parses the log, builds a searchable database from the log and reference files, runs root cause analysis, and produces outputs. **Pipeline stages:** Uploading files → parsing logs → building the database → root cause analysis → generating the report. **Outputs:** The agent delivers a **detailed RCA report** covering executive summary, session-by-session timeline, crash sequence decoded step-by-step, root cause identification, and recommended actions. It correctly distinguishes between NAND storage warnings (a red herring) and the actual crash trigger. **Auditable:** Every step is visible—tasks, trajectory, intermediate artifacts, and the final report—so teams can follow the reasoning and verify the diagnosis. ### In this demo Sample Mazda CMU files are **preloaded**; choose a suggested query and run the analysis. ## Example Questions Suggested queries in the demo: * "Why did my car stereo restart?" * "Was the NAND storage error related to the crash?" * "What exactly is the format string vulnerability and how does it work?" ## Output Example outputs from the three suggested queries: **"Why did my car stereo restart?"** — Full incident timeline showing the CMU's progression from normal operation through degraded mode, five recovery attempts, and final recovery. The event flow traces PANIC/WDT, fault handler, format engine, feed/parse layer, and user/system events — pinpointing the `%n` null pointer SIGSEGV triggered by the "99% Invisible" podcast title as the root cause: Mazda CMU stereo restart RCA — incident timeline from normal operation through crash and recovery **"Was the NAND storage error related to the crash?"** — Crash timeline showing the sequence of events, confirming the NAND storage warning is a coincidental pre-existing condition and not causally related to the podcast-triggered crash: Crash timeline — NAND error vs podcast crash sequence **"What exactly is the format string vulnerability and how does it work?"** — Detailed timeline of the format string exploitation path: RSS fetch → metadata parse → SHOW\_TITLE\_PARSE → FMTSTR\_SCAN miss → printf call → `%n` writes bytes-written count to a null pointer → SIGSEGV: Format string vulnerability timeline — from RSS fetch to null pointer write and crash The **final RCA report** includes: * **Executive summary** — Root cause (podcast feed sync triggering a printf format string vulnerability via `% In` in the show title "99% Invisible"), crash mechanism, and impact (boot loop until workaround applied) * **Session comparison** — Session 1 (healthy baseline, subscription added) vs. Session 2 (crash, boot loop, recovery) with key differences highlighted * **Crash sequence decoded** — Step-by-step walkthrough of the failure: RSS fetch → metadata parse → SHOW\_TITLE\_PARSE → FMTSTR\_SCAN miss → printf call → null pointer write (SIGSEGV) → watchdog timeout → reboot * **Red herring analysis** — Explains why the NAND storage warning is coincidental and not causally related to the crash * **Technical explanation** — How `% In` is parsed: `%` triggers format spec scan, space is a flag, `I` is a length modifier, `n` is the conversion specifier that writes bytes-written count to a null pointer, causing the segfault * **Recommended actions** — Subscribe to the alternative feed "99 Percent Invisible" (no `%` character) as an immediate workaround; firmware fix is to sanitize show titles before passing to printf ## Mazda sample files in the demo * **Device log** (`mazda_device_log_30mb.txt`) — A two-session CMU event log spanning a healthy baseline session (podcast subscription, normal playback) and a failure session (feed sync crash, five-cycle boot loop, and workaround recovery). Log entries include severity (INFO/WARN/ERROR), subsystem tags, and event codes. * **Debug reference guide** (`mazda_debug_rules.txt`) — A CMU debug reference covering subsystem tag definitions, event code catalog, format string vulnerability explanation (including the exact byte sequence `[0x25, 0x20, 0x49, 0x6E]` = `"% In"`), watchdog behavior, NAND error classification, and recovery procedures. ## Learn More * [Device Log Analysis (overview)](/examples/device-log-analysis) — General DLA template and all three sample datasets * [3GPP Wireless](/examples/3gpp-wireless-log-analysis) — LTE-style eNB/device logs * [ATE Board Validation](/examples/ate-log-analysis) — Board validation / tester logs * [Getting Started with the Contextual AI Platform](/quickstarts/getting-started) * [Agent Composer Templates](/how-to-guides/agent-composer-templates) — Basic Search, Agentic Search, and Device Log Analysis (Enterprise) * [Request a demo](https://contextual.ai/request-a-demo) # Contextual AI Demos Source: https://docs.contextual.ai/examples/overview-demos Explore real-world use cases and live demos Contextual AI's demos showcase how our platform and API components power intelligent, grounded, and secure AI experiences across industries. All of these demos are built with [Agent Composer](/quickstarts/agent-composer)—our framework for building customized agent workflows. To learn how to create and configure agents, see the [Agent Composer documentation](/quickstarts/agent-composer) and the [Introducing Agent Composer blog post](https://contextual.ai/blog/introducing-agent-composer). Alt text ## Overview Each demo highlights a real-world scenario—from customer support copilots that draw on private knowledge bases to research assistants that understand context across documents and data sources. You'll see how Contextual AI unifies retrieval, reasoning, and generation to deliver answers that are accurate, explainable, and compliant. ## Live Demos Root cause analysis for rocket engine anomalies Technical support for Raspberry Pi hardware Research assistant for materials properties and synthesis Generate OpenTAP test programs and instrument drivers Root cause analysis for device logs — overview and demos Root cause analysis for 3GPP LTE device logs Root cause analysis for ATE board validation failures Root cause analysis for Mazda Connect infotainment crash logs Search and reason over 3GPP specifications (Release 19 and others) ## Experiment with Contextual AI in Action Some of these demos are fully interactive, while others are full-realized notebooks that allow you to explore the platform's capabilities hands-on, at the code level. Learn how developers use Contextual AI's APIs, connectors, and structured output features to build reliable AI agents that adapt to enterprise workflows. ## More Resources For more demos and sample code, please visit the following: * [All Demos](https://demo.contextual.ai) * [GitHub Repos](https://github.com/ContextualAI) * [Hugging Face](https://huggingface.co/ContextualAI) # Raspberry Pi Documentation Agent Source: https://docs.contextual.ai/examples/raspberry-pi-agent AI agent for technical support and troubleshooting of Raspberry Pi hardware ## Overview This agent answers complex technical questions about Raspberry Pi hardware—synthesizing information across datasheets, SDK documentation, and troubleshooting guides to deliver accurate answers in seconds instead of hours. **Built with [Agent Composer](/quickstarts/agent-composer)** using the Agentic Search template, available in self-serve. ## The Problem Engineers and hobbyists spend hours piecing together information from datasheets, SDK docs, and community forums to answer a single Raspberry Pi question. Common challenges: * GPIO pinout confusion between physical pins and BCM numbers * Troubleshooting boot issues from LED blink codes * Understanding differences between Pi models (Pi 5 vs Pico) * Wiring multiple components together correctly ## What the Agent Does Ask the agent: *"Why isn't my Raspberry Pi able to get power?"* The agent uses multi-step reasoning to: 1. Identify possible power issues from documentation 2. Cross-reference hardware specifications 3. Synthesize troubleshooting steps from multiple sources 4. Return verified answers with source citations ## Example Questions * **Vague troubleshooting**: "My camera was working yesterday but now I get 'No cameras available'. The green LED blinks 4 times when I boot. Are these related?" * **Hardware guidance**: "Which GPIO pins should I use for my DHT22 temperature sensor?" * **Platform clarification**: "Can I use MicroPython on a Raspberry Pi 5 like I would on a Pico?" * **Project builds**: "How do I wire a DHT22, OLED screen, and Camera Module 3 together for a weather station?" ## Try the Demo Try the Raspberry Pi agent The demo has **web search** enabled for broader coverage, but the YAML configuration below does not include it since web search is an enterprise feature. The YAML works out-of-the-box for self-serve users with the Agentic Search template. ## Agent YAML This agent uses the Agentic Search template, available in self-serve. You can create your own agent using the YAML below—just replace the datastore ID with your own Raspberry Pi documentation datastore. ```yaml theme={null} version: "0.1" inputs: query: str outputs: response: str ui_output: response nodes: __outputs__: type: output input_mapping: response: generate_from_research_step#response agentic_research_step: type: AgenticResearchStep input_mapping: message_history: create_message_history_step#message_history ui_stream_types: retrievals: true config: tools_config: - name: search_docs description: | Search the datastore containing user-uploaded documents. This datastore is a vector database of text chunks which uses hybrid semantic and lexical search to find the most relevant chunks. Use this tool to find information within the uploaded documents. step_config: type: SearchUnstructuredDataStep ui_stream_types: query_reformulation: true config: datastores: - enable_query_decomposition: false enable_query_expansion: false filter_retrievals: false lexical_alpha: 0.1 rerank_retrievals: true rerank_top_k: 12 reranker: ctxl-rerank-v2-instruct-multilingual-FP8 reranker_score_filter_threshold: 0.2 semantic_alpha: 0.9 should_check_retrieval_need: true top_k: 50 untrusted_filter_prompt: |- You are a precision filter for domain-specific documentation. Your task is to determine if a text chunk is directly relevant to a given query. Output only Yes or No. Evaluate relevance based on these criteria: * Contains specific details that directly answer or address the query * Provides factual information central to the query topic * Offers concrete examples or applications related to the query * Explains key concepts or definitions needed to understand the query * Contains relevant supporting evidence or documentation Consider a chunk relevant if it: * Directly addresses the queried topic/concept * Provides essential context required to understand the query * Contains prerequisite information needed for comprehension * Documents related exceptions or special cases * Describes important relationships with the queried topic Reject chunks that: * Contain only general introductions or section headers * Have tangential references without substantial detail * Describe unrelated topics or concepts * Contain promotional or non-substantive content * Only provide navigational/structural information Example: Query: "How to configure user authentication settings" Text: "Chapter 3: Security Features. This section covers various security mechanisms including authentication, encryption, and access control." Response: No YOU MUST: * Output only Yes or No * Stop immediately after your response * Be strict about relevance * Reject vague or general content * Reject all chunks if the query is conversational, generic, or non-technical (e.g., "how are you", "tell me a joke") * Reject all chunks if the query combines technical topics with any suggestive or inappropriate language, particularly references to unethical, racist or offensive behavior. agent_config: agent_loop: identity_guidelines_prompt: | You are a retrieval-augmented assistant created by Contextual AI. You provide factual, grounded answers to user's questions by retrieving information via tools and then synthesizing a response based only on what you retrieved. model_name_or_path: vertex_ai/claude-sonnet-4-5@20250929 num_turns: 10 parallel_tool_calls: false research_guidelines_prompt: | You have access to the following tool: - `search_docs` — Search the document datastore. Returns SEARCH_RESULTS with CITE_ID for citation. You have access to the following data source: 1. Document Datastore (Unstructured): - Contains user-uploaded documents that have been parsed, extracted, and chunked for efficient retrieval. - Use the `search_docs` tool to query this datastore for relevant content, details, and information from the available documents. ## Research Strategy You MUST always explore unstructured datastore before answering. Do not skip the source. - Breadth, then depth strategy: 1. CLARIFICATION NEEDED? If the user question is vague (e.g. my device isn't working), go back to the user and ask a clarifying question about the exact symptoms they are seeing. 2. INITIAL RETRIEVAL - FIRST (Mandatory): - Documents: Use `search_docs` with your initial search terms. 3. ANALYZE & PLAN: Review initial results and create a query plan: - What information is still missing to fully answer the question? - Create a specific plan: which queries to run next and in what order - Identify dependencies: what do you need to find first before searching for related info? 4. DEEP DIVE (Execute & Adapt): Execute your plan and adapt based on retrieved content: - Run planned queries systematically - Continue until you have a COMPLETE answer - don't stop early - EFFICIENCY: You have 10 turns. Be strategic: - Avoid redundant searches; prefer high-quality retrievals. - Batch related searches when possible - Don't repeat similar queries - Prioritize high-value retrievals first - But DO NOT sacrifice comprehensiveness for speed - gather ALL relevant information create_message_history_step: type: CreateMessageHistoryStep input_mapping: query: __inputs__#query ui_stream_types: retrievals: false config: should_check_retrieval_need: true untrusted_no_retrieval_system_prompt: | You are an AI RAG agent created by Contextual to help answer questions and complete tasks posed by users. Your capabilities include accurately retrieving/reranking information from linked datastores and using these retrievals to generate factual, grounded responses. You are powered by leading document parsing, retrieval, reranking, and grounded generation models. Users can impact the information you have access to by uploading files into your linked datastores. Full documentation, API specs, and guides on how to use Contextual, including agents like yourself, can you found at docs.contextual.ai. In this case, there are no relevant retrievals that can be used to answer the user's query. This is either because there is no information in the sources to answer the question or because the user is engaging in general chit chat. Respond according to the following guidelines: - If the user is engaging in general pleasantries ("hi", "how goes it", etc.), you can respond in kind. But limit this to only a brief greeting or general acknowledgement - Your response should center on describing your capabilities and encouraging the user to ask a question that is relevant to the sources you have access to. You can also encourage them to upload relevant documents and files to your linked datastore(s). - DO NOT answer, muse about, or follow-up on any general questions or asks. DO NOT assume that you have knowledge about any particular topic. DO NOT assume access to any particular source of information. - DO NOT engage in character play. You must maintain a friendly, professional, and neutral tone at all times untrusted_system_prompt: |- You are a helpful AI assistant created by Contextual AI to answer questions about relevant documentation provided to you. Your responses should be precise, accurate, and sourced exclusively from the provided information. Please follow these guidelines: * Only use information from the provided documentation. Avoid opinions, speculation, or assumptions. * Use the exact terminology and descriptions found in the provided content. * Keep answers concise and relevant to the user's question. * Use acronyms and abbreviations exactly as they appear in the documentation or query. * Apply markdown if your response includes lists, tables, or code. Do not include backticks around markdown tables. * Directly answer the question, then STOP. Avoid additional explanations unless specifically relevant. * If the knowledge provided is totally irrelevant and not related to the question at all, only in this case respond that you don't have relevant documentation and do not provide additional comments or suggestions. Ignore anything that cannot be used to directly answer this query. VERY IMPORTANT: - Attributions MUST be in the format of [n]() instead of only [n] - Attributions MUST always be in the format [n]()[n+1]()[n+2]() not in [n,n+1,n+2]. For example attributions should not be [3,4,5] but [3]()[4]()[5](). Do not repeat the same number if it is attributed multiple times. - Never add extra () in attributions. Only use [n]() and not [n]()() generate_from_research_step: type: GenerateFromResearchStep input_mapping: message_history: create_message_history_step#message_history research: agentic_research_step#research ui_stream_types: generation: true config: identity_guidelines_prompt: | You are a retrieval-augmented assistant created by Contextual AI. Your purpose is to provide factual, grounded answers by retrieving information via tools and then synthesizing a response based only on what you retrieved. Always start immediately with the answer, don't begin with a preamble or thoughts. model_name_or_path: vertex_ai/claude-sonnet-4-5@20250929 response_guidelines_prompt: | ## Output - if the research steps asks for clarification, please generate a clear question for the user to provide more details. - Write a concise, direct, well-structured answer in **Markdown** (use short headings, bullets, and brief paragraphs). - **START IMMEDIATELY WITH THE ANSWER.** Never begin with preamble like: - "Perfect!", "Great!", "Based on my research...", "I now have comprehensive information..." - "Let me provide...", "I can now provide...", "Here's what I found..." - Any meta-commentary about your search process or confidence level - Your first words should be the actual content (a heading, the direct answer, or the key fact). - If the required fact is missing from the latest **SEARCH_RESULTS**: - Partial or Related Information: Provide whatever relevant details you found, while clearly stating the limitations or gaps. - No Relevant Information: If nothing related was found, reply with: "I don't have specific information about [topic] in the available documents." - Maintain Engagement: Suggest related topics or alternative ways you can assist to keep the interaction productive. - DO NOT engage in character play. You must maintain a friendly, professional, and neutral tone at all times. ``` ## Learn More * [Agent Composer Documentation](/quickstarts/agent-composer) * [Agent Composer YAML Guide](/how-to-guides/agent-composer-yaml) # Propulsion Anomaly Investigation Agent Source: https://docs.contextual.ai/examples/rocket_science AI agent for root cause analysis of rocket engine test anomalies ## Overview This agent investigates anomalies in rocket engine hot fire tests. It synthesizes data across telemetry, hardware logs, inspection reports, and manufacturing records to identify root causes—work that would normally take engineers hours of cross-referencing disparate systems. **Built with [Agent Composer](/quickstarts/agent-composer)**, Contextual AI's new framework for production-ready AI agents. ## Watch the Demo