Skip to content

Code Repositories

Index source code so your assistants can read and understand how your product works. This is particularly useful for enabling non-technical users – like sales, customer success, or support teams – to ask questions about product functionality and get accurate answers derived from the actual code.

How It Works

Unlike web pages and facts, code knowledge uses a two-step process:

  1. Search – When a user asks a question, the assistant searches the indexed code chunks to find relevant files (using search_knowledge)
  2. Read – The assistant reads the full source files to understand the complete logic before answering (using read_code_file)

This means the assistant doesn’t just pattern-match on code snippets – it reads and comprehends the actual source code, much like a developer would.

Adding Code from GitHub

Provide a public GitHub repository URL and TeamWeb AI will download and index the source files.

  • GitHub URL – The repository URL (e.g., https://github.com/org/repo)
  • Context Label – A label for the codebase (e.g., “Product source code”, “Backend API”)
  • Branch – Optional branch or tag to index (defaults to the repository’s default branch)
  • Max Files – Maximum number of source files to index (1–2000, default 500)
  • Core – Whether to always include this source in context
  • Auto-Sync – Optionally set to Daily or Weekly to automatically re-index from GitHub

After adding a GitHub repository, TeamWeb AI downloads the archive and processes files in the background. You can re-index a GitHub repository at any time to pick up code changes. With auto-sync enabled, TeamWeb AI will automatically re-index on the configured schedule. Only files that have changed since the last indexing are re-embedded, making incremental updates efficient.

Uploading a ZIP File

If your code isn’t on GitHub, or you want to index a specific snapshot, upload a ZIP archive of the source code.

  • ZIP File – A .zip archive containing the source code
  • Context Label – A label for the codebase
  • Max Files – Maximum number of source files to index (1–2000, default 500)
  • Core – Whether to always include this source in context

To re-index a ZIP repository with updated code, click Re-upload on the repository card and upload a new ZIP file. Only changed files will be re-embedded.

What Gets Indexed

TeamWeb AI indexes files with the following extensions:

  • Python.py
  • JavaScript.js
  • TypeScript.ts
  • CSS.css
  • HTML.html
  • Jinja2 templates.j2

Files larger than 200KB are skipped, as are files inside common non-source directories like node_modules/, dist/, build/, .git/, and __pycache__/.

Code Chunking

Source files are split at logical boundaries for better search relevance:

  • Python – Split at function and class definitions
  • JavaScript/TypeScript – Split at function, class, and export boundaries
  • Other languages – Split at blank-line boundaries (between code blocks)

Each chunk includes the file path as context, so searches return results like [Product code - src/auth/login.py] making it clear where the code lives.

Viewing Indexed Files

After indexing completes, click View indexed files on a repository card to see all files that were processed. The summary shows how many files were indexed, how many were skipped, and the status of each file.

Example Use Cases

  • Sales: “Does our product support SSO?” – The assistant searches for authentication code, reads the relevant files, and explains the SSO capabilities.
  • Customer Success: “How does the billing retry logic work?” – The assistant finds the payment processing code and explains the retry strategy in plain English.
  • Support: “What happens when a user resets their password?” – The assistant traces the password reset flow through the codebase and explains each step.