Skip to main content
Experimental API - Context Engine SDK is experimental and subject to breaking changes.

Available Examples

Direct Context

API-based indexing and search

FileSystem Context

Local directory search

File Search Server

REST API for code search

Prompt Enhancer Server

Context-aware prompt enhancement

GitHub Action Indexer

CI/CD repository indexing

Getting the Examples

All example code is available in the Auggie repository. To access the examples:
Each example is a complete, runnable application demonstrating different use cases of the Auggie SDK.

Prerequisites

Before running the examples:
  1. Runtime - One of the following:
    • TypeScript: Node.js 18+
    • Python: Python 3.10+
  2. Auggie CLI - Required for FileSystem Context examples
  3. Authentication - Required for all examples
    This creates a session file at ~/.augment/session.json with your API token. Alternatively, set the AUGMENT_SESSION_AUTH environment variable to the session JSON:

Setup

Install dependencies:

Simple Examples

Get started quickly with these basic examples that demonstrate core SDK functionality.

Direct Context

Demonstrates indexing files from any source and performing semantic searches with AI-powered question answering. Quick Start:
Or run directly:

FileSystem Context

Shows how to search a local directory using automatic file discovery via the MCP protocol. Prerequisites:
  • Auggie CLI must be installed and in your PATH
  • Authentication via auggie login or AUGMENT_SESSION_AUTH environment variable
  • A .gitignore or .augmentignore file in the workspace directory to exclude node_modules/ and other large directories
Important: The FileSystem Context indexes all files in the workspace directory. To avoid timeouts when indexing large directories (like node_modules/), make sure you have a .gitignore or .augmentignore file that excludes them. Quick Start:
Or run directly:

Developer Tools

Build production-ready applications with these server examples.

File Search Server

A REST API server that provides semantic file search with AI-powered summarization. Prerequisites: Auggie CLI must be installed and in your PATH. Quick Start:
Then query the API:
Or run directly:

Prompt Enhancer Server

An HTTP server that automatically enriches user prompts with relevant codebase context. Prerequisites: Auggie CLI must be installed and in your PATH. Quick Start:
Then enhance prompts:
Or run directly:

CI/CD Integration

Integrate the SDK into your continuous integration workflows.

GitHub Action Indexer

Automatically index your GitHub repositories with zero-question setup and incremental updates. Perfect for CI/CD workflows and keeping your codebase searchable. Key Features:
  • πŸ”„ Incremental indexing - Only processes changed files for efficiency
  • πŸ’Ύ Smart caching - Persists index state between runs
  • πŸš€ 30-second setup - From zero to running GitHub Action
Installation:
What It Does:
  1. Indexes your codebase automatically on every push
  2. Updates incrementally using GitHub’s Compare API
  3. Caches index state for fast subsequent runs
  4. Handles large repositories with optimized performance settings
Perfect For:
  • Keeping your codebase searchable and up-to-date
  • CI/CD workflows that need codebase understanding
  • Teams wanting automatic repository indexing
  • Projects with frequent commits (incremental updates are fast)
Try It Locally First:
πŸ“– Complete Setup Guides:

Troubleshooting

MCP Timeout in FileSystem Context

Problem: The FileSystem Context example times out during indexing. Cause: The workspace directory contains too many files (e.g., node_modules/ with 45,000+ files). Solution: Create a .gitignore or .augmentignore file in the workspace directory to exclude large directories:
The auggie CLI respects both .gitignore and .augmentignore patterns and will skip excluded files during indexing.

Authentication Errors

Problem: Error: API key is required for searchAndAsk() or ValueError: API credentials are required Cause: The SDK cannot find your authentication credentials. Solution: Run auggie login to authenticate, or set the AUGMENT_SESSION_AUTH environment variable to the session JSON from auggie token print.

Next Steps

API Reference

Complete API documentation

Quick Start

Back to quick start guide