Examples demonstrating the Auggie SDK's context modes and AI-powered code analysis.
-
Python 3.10+ - Required to run the examples
-
Auggie CLI - Required for FileSystem Context examples
npm install -g @augmentcode/auggie@prerelease
-
Authentication - Required for all examples
auggie login
This creates a session file at
~/.augment/session.jsonwith your API token.Alternatively, you can set environment variables:
export AUGMENT_API_TOKEN=your_token_here export AUGMENT_API_URL=https://staging-shard-0.api.augmentcode.com/
API-based indexing with semantic search and AI Q&A.
Run it:
python -m direct_contextLocal directory search via MCP protocol.
Important: The FileSystem Context indexes all files in the workspace directory. To avoid timeouts when indexing large directories (like node_modules/), consider adding a .gitignore or .augmentignore file that excludes them. The auggie CLI respects both .gitignore and .augmentignore patterns during indexing.
Run it:
python -m filesystem_contextREST API for semantic file search with AI summarization.
Run it:
python -m file_search_server .Then query the API:
curl "http://localhost:3000/search?q=python"HTTP server that enhances prompts with codebase context.
Run it:
python -m prompt_enhancer_server .Then enhance prompts:
curl -X POST http://localhost:3001/enhance \
-H "Content-Type: application/json" \
-d '{"prompt": "fix the login bug"}'Index GitHub repositories with incremental updates via GitHub Actions.
This is a more complex example that demonstrates production-ready repository indexing with GitHub Actions integration. It includes an install script for easy setup in your own repositories.
See github_action_indexer/README.md for setup and usage instructions.
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:
# .gitignore or .augmentignore
node_modules/
dist/
*.log
.DS_Store
__pycache__/
*.pycThe auggie CLI respects both .gitignore and .augmentignore patterns and will skip excluded files during indexing.
Problem: Error: API key is required for search_and_ask()
Cause: The SDK cannot find your authentication credentials.
Solution: Run auggie login to authenticate, or set the AUGMENT_API_TOKEN and AUGMENT_API_URL environment variables.