### Install Dependencies and Start Development Server Source: https://github.com/airweave-ai/airweave/blob/main/connect/README.md Install project dependencies using npm and start the development server. The application will be accessible at http://localhost:3000. ```bash npm install npm run dev ``` -------------------------------- ### Install and Build MCP Server from Source Source: https://github.com/airweave-ai/airweave/blob/main/mcp/README.md For developers building from source. Installs dependencies, builds the project, and starts the server. ```bash cd mcp npm install npm run build npm run start ``` -------------------------------- ### Install Dependencies and Run Server Source: https://github.com/airweave-ai/airweave/blob/main/examples/webhook-demo/README.md Installs project dependencies and starts the FastAPI development server. Access the UI at http://localhost:8000. ```bash cd examples/webhook-demo pip install -r requirements.txt uvicorn app:app --port 8000 ``` -------------------------------- ### Install and Setup Pre-commit Hooks Source: https://github.com/airweave-ai/airweave/blob/main/CONTRIBUTING.md Install the pre-commit package and set up the hooks to automatically check code before committing. ```bash pip install pre-commit pre-commit install ``` -------------------------------- ### Start Temporal Services for Development (Alternative) Source: https://github.com/airweave-ai/airweave/blob/main/backend/airweave/domains/temporal/README.md An alternative command to start Temporal services specifically for development environments. ```bash # Or for development docker-compose -f docker/docker-compose.dev.yml up -d ``` -------------------------------- ### Install llama-index and airweave tools Source: https://github.com/airweave-ai/airweave/blob/main/fern/docs/pages/framework-integrations/llamaindex.mdx Install the necessary packages for LlamaIndex and the Airweave integration. ```bash pip install llama-index llama-index-tools-airweave ``` -------------------------------- ### Install Dependencies Source: https://github.com/airweave-ai/airweave/blob/main/fern/docs/pages/framework-integrations/vercel-ai-sdk.mdx Install the necessary packages for Vercel AI SDK and Airweave integration. ```bash npm install ai @ai-sdk/openai @airweave/vercel-ai-sdk ``` -------------------------------- ### Install Airweave SDK Source: https://github.com/airweave-ai/airweave/blob/main/examples/intro_to_airweave.ipynb Install the Airweave SDK using pip. This command should be run once. ```python # First, pip install the Airweave SDK (run this once): %pip install airweave-sdk ``` -------------------------------- ### Install Frontend Dependencies Source: https://github.com/airweave-ai/airweave/blob/main/frontend/README.md Installs project dependencies using npm or bun. Ensure Node.js v18+ is installed. ```sh git clone https://github.com/airweave-ai/airweave cd airweave/frontend npm install # or bun install ``` -------------------------------- ### Start Development Server and Open Test Harness Source: https://github.com/airweave-ai/airweave/blob/main/connect/README.md Start the development server and then open `public/test-parent.html` in your browser to test iframe communication. This HTML file simulates a parent application embedding the Connect widget. ```bash # Start the dev server npm run dev # Open test-parent.html in your browser # It simulates a parent application embedding the Connect widget ``` -------------------------------- ### Install Airweave SDK Source: https://github.com/airweave-ai/airweave/blob/main/fern/docs/pages/quickstart.mdx Install the Airweave SDK for Python or Node.js using pip or npm. ```bash pip install airweave-sdk ``` ```bash npm install @airweave/sdk ``` -------------------------------- ### Install Backend Dependencies Source: https://github.com/airweave-ai/airweave/blob/main/CLAUDE.md Install Python dependencies for the backend using Poetry. This should be run after cloning the repository. ```bash cd backend poetry install ``` -------------------------------- ### Install @airweave/connect-react Source: https://github.com/airweave-ai/airweave/blob/main/connect/packages/react/README.md Install the connect-react package using npm. ```bash npm install @airweave/connect-react ``` -------------------------------- ### Install Frontend Dependencies Source: https://github.com/airweave-ai/airweave/blob/main/CLAUDE.md Install Node.js dependencies for the frontend using npm. This should be run after cloning the repository. ```bash cd frontend npm install ``` -------------------------------- ### Install Vanilla JS Connect Package Source: https://github.com/airweave-ai/airweave/blob/main/fern/docs/pages/connect.mdx Install the vanilla JavaScript package for the Airweave Connect widget. ```bash npm install @airweave/connect-js ``` -------------------------------- ### Clone and Start Airweave Locally Source: https://github.com/airweave-ai/airweave/blob/main/README.md Use these commands to clone the Airweave repository and start the services locally. Requires Docker and docker-compose. The script handles environment setup, secret generation, and service startup. ```bash git clone https://github.com/airweave-ai/airweave.git cd airweave ./start.sh ``` -------------------------------- ### Install Dependencies Source: https://github.com/airweave-ai/airweave/blob/main/mcp/README.md Install project dependencies using npm. ```bash npm install ``` -------------------------------- ### Install Airweave CLI from Source Source: https://github.com/airweave-ai/airweave/blob/main/fern/docs/pages/cli.mdx Clone the repository and install the Airweave CLI from source using Poetry. This is useful for development or if you need the latest unreleased features. ```bash git clone https://github.com/airweave-ai/cli.git cd cli poetry install poetry run airweave --help ``` -------------------------------- ### Connector YAML Configuration Example Source: https://github.com/airweave-ai/airweave/blob/main/monke/README.md Example of a connector's YAML configuration file, specifying 'composio' as the authentication mode and providing the necessary account and auth config IDs. ```yaml auth_mode: composio composio_config: account_id: ca_xxx auth_config_id: ac_xxx ``` -------------------------------- ### Start Temporal Services for Local Development Source: https://github.com/airweave-ai/airweave/blob/main/backend/airweave/domains/temporal/README.md Ensures Temporal is running locally, which is part of the docker-compose setup for development. ```bash docker-compose -f docker/docker-compose.dev.yml up -d ``` -------------------------------- ### Start Temporal Services for Production Source: https://github.com/airweave-ai/airweave/blob/main/backend/airweave/domains/temporal/README.md Starts the Temporal server and worker using the main docker-compose configuration. ```bash # From project root docker-compose -f docker/docker-compose.yml up -d ``` -------------------------------- ### Copy .env file Source: https://github.com/airweave-ai/airweave/blob/main/monke/README.md Use this command to create a local environment file from the example. ```bash cp monke/.env.example monke/.env ``` -------------------------------- ### Install Airweave SDKs Source: https://github.com/airweave-ai/airweave/blob/main/README.md Install the Airweave SDK for Python or TypeScript using pip or npm. ```bash pip install airweave-sdk # Python ``` ```bash npm install @airweave/sdk # TypeScript ``` -------------------------------- ### Start Development Server Source: https://github.com/airweave-ai/airweave/blob/main/frontend/README.md Launches the development server for local testing. The server typically runs on http://localhost:5173. ```sh npm run dev # or bun run dev ``` -------------------------------- ### Install MCP Server Globally with npm Source: https://github.com/airweave-ai/airweave/blob/main/mcp/README.md Installs the MCP server globally using npm. After installation, you can run the server command directly. ```bash npm install -g airweave-mcp-search airweave-mcp-search ``` -------------------------------- ### Install Airweave CLI Source: https://github.com/airweave-ai/airweave/blob/main/README.md Install the Airweave CLI using pip. ```bash pip install airweave-cli ``` -------------------------------- ### Test Configuration Example Source: https://github.com/airweave-ai/airweave/blob/main/monke/README.md Example YAML configuration file defining test parameters, including entity count, rate limiting, and deletion strategy. ```yaml name: github connector_type: github config_fields: entity_count: 5 # How many test entities to create rate_limit_delay_ms: 1000 # API rate limiting test_branch: monke-test # GitHub-specific config deletion: partial_delete_count: 2 # Delete 2 entities first verify_partial_deletion: true # Then verify they're gone ``` -------------------------------- ### Install Test Dependencies Source: https://github.com/airweave-ai/airweave/blob/main/backend/tests/e2e/README.md Installs all necessary Python packages for running the tests. Ensure you are in the project's root directory. ```bash pip install -r requirements.txt ``` -------------------------------- ### Install Airweave Skills using CLI Source: https://github.com/airweave-ai/airweave/blob/main/fern/docs/pages/skills.mdx Install both Airweave skills at once or individually using the skills CLI. The CLI detects your AI assistant and places the skill files in the correct location. ```bash npx skills add airweave-ai/skills ``` ```bash npx skills add airweave-ai/skills --skill airweave-setup ``` ```bash npx skills add airweave-ai/skills --skill airweave-search ``` -------------------------------- ### Started Event Source: https://github.com/airweave-ai/airweave/blob/main/fern/docs/pages/search.mdx Emitted once when the search begins. Includes request details and initial parameters. ```json { "type": "started", "request_id": "req-abc123", "tier": "agentic", "collection_readable_id": "my-collection", "query": "What authentication methods do we support?", "thinking": true, "filter": null, "limit": null } ``` -------------------------------- ### Development Installation Script for MCP Source: https://github.com/airweave-ai/airweave/blob/main/mcp/README.md A script for developers to install dependencies, build, and test the MCP project from source. Requires Node.js 20+. ```bash git clone https://github.com/airweave-ai/airweave.git cd airweave/mcp ./install.sh ``` -------------------------------- ### Run Frontend Development Server Source: https://github.com/airweave-ai/airweave/blob/main/CLAUDE.md Start the Vite development server for the frontend. The application will be accessible at http://localhost:8080. ```bash npm run dev ``` -------------------------------- ### Install and Run Airweave MCP Search Server Source: https://github.com/airweave-ai/airweave/blob/main/mcp/README.md Install the Airweave MCP Search server using npx and run it. This command is typically used for local development or direct integration with desktop AI clients. ```bash npx airweave-mcp-search ``` -------------------------------- ### Verify Docker Installation Source: https://github.com/airweave-ai/airweave/blob/main/README.md Before starting Airweave, verify that Docker is installed and running by checking its version and system info. ```bash docker --version docker info ``` -------------------------------- ### Initialize Development Environment with Docker Source: https://github.com/airweave-ai/airweave/blob/main/CONTRIBUTING.md Run the start script to set up the initial development environment using Docker Compose. ```bash ./start.sh ``` -------------------------------- ### Run Airweave Quickstart Tutorial with Interactive Input Source: https://github.com/airweave-ai/airweave/blob/main/examples/README.md Execute the Python tutorial script and enter your Airweave API key when prompted. This method allows for interactive API key entry during script execution. ```bash python quickstart_tutorial.py # Enter your API key when prompted ``` -------------------------------- ### Verify Airweave CLI Installation Source: https://github.com/airweave-ai/airweave/blob/main/fern/docs/pages/cli.mdx Check the installed version of the Airweave CLI to confirm the installation was successful. ```bash airweave --version ``` -------------------------------- ### Run Airweave Quickstart Tutorial with Self-Hosted Instance Source: https://github.com/airweave-ai/airweave/blob/main/examples/README.md Configure both the Airweave API key and the base URL for a self-hosted Airweave instance as environment variables before running the Python tutorial script. ```bash export AIRWEAVE_API_KEY="your-api-key-here" export AIRWEAVE_BASE_URL="http://localhost:8001" python quickstart_tutorial.py ``` -------------------------------- ### Install Airweave CLI with npm Source: https://github.com/airweave-ai/airweave/blob/main/fern/docs/pages/cli.mdx Install the Airweave CLI globally using npm. This method installs the Python CLI as a dependency. ```bash npm install -g @airweave/cli ``` -------------------------------- ### Environment Configuration Examples Source: https://github.com/airweave-ai/airweave/blob/main/backend/airweave/analytics/README.md Configure analytics by setting environment variables. Ensure `ANALYTICS_ENABLED` is true and specify the `ENVIRONMENT` for proper filtering in PostHog. ```bash # Production environment (.env.prod) ANALYTICS_ENABLED=true ENVIRONMENT=prd # Development environment (.env.dev) ANALYTICS_ENABLED=true ENVIRONMENT=dev # Local development (.env.local) ANALYTICS_ENABLED=false ENVIRONMENT=local # Testing (.env.test) ANALYTICS_ENABLED=false ENVIRONMENT=test ``` -------------------------------- ### Container Partial Override Example Source: https://github.com/airweave-ai/airweave/blob/main/backend/airweave/architecture-refactor.md Demonstrates how to create a container with a real event bus and a fake publisher for specific testing scenarios. ```python from airweave.core.container import Container from airweave.core.protocols.event_bus import InMemoryEventBus # Assuming test_container is already defined as in the previous example # container_with_real_bus = test_container.replace(event_bus=InMemoryEventBus()) ``` -------------------------------- ### Build Frontend for Production Source: https://github.com/airweave-ai/airweave/blob/main/CLAUDE.md Create a production-ready build of the frontend application. This optimizes assets for deployment. ```bash npm run build ``` -------------------------------- ### Start Model Context Protocol Server Source: https://github.com/airweave-ai/airweave/blob/main/CONTRIBUTING.md Run the MCP server for local development and testing of source integrations. Ensure LOCAL_CURSOR_DEVELOPMENT is set to true in your .env file. ```python python .cursor/mcp/sync_test/server.py ``` -------------------------------- ### Start Airweave Backend Only Source: https://github.com/airweave-ai/airweave/blob/main/README.md To start only the backend services without the frontend, use the --skip-frontend flag. ```bash ./start.sh --skip-frontend ``` -------------------------------- ### Configure Direct Credentials Source: https://github.com/airweave-ai/airweave/blob/main/monke/README.md For local development, set core settings and direct connector tokens. All connector tokens should be prefixed with MONKE_. ```bash # Core settings AIRWEAVE_API_URL=http://localhost:8001 OPENAI_API_KEY=sk-... # Connector-specific tokens (all use MONKE_ prefix) MONKE_GITHUB_PERSONAL_ACCESS_TOKEN=ghp_... MONKE_GITHUB_REPO_NAME=owner/repo MONKE_NOTION_ACCESS_TOKEN=secret_... MONKE_ASANA_PERSONAL_ACCESS_TOKEN=1/... MONKE_STRIPE_API_KEY=sk_test_... # ... see .env.example for more ``` -------------------------------- ### Install Ollama LLM for LlamaIndex Source: https://github.com/airweave-ai/airweave/blob/main/fern/docs/pages/framework-integrations/llamaindex.mdx Install the necessary package to use Ollama models with LlamaIndex. This is required for local model integration. ```bash pip install llama-index-llms-ollama ``` -------------------------------- ### Example Conventional Commit Message Source: https://github.com/airweave-ai/airweave/blob/main/CONTRIBUTING.md An example illustrating the conventional commit message format, specifying a new feature for the sources component. ```bash feat(sources): add support for Notion API ``` -------------------------------- ### Initialize MCP Server via HTTP POST Source: https://github.com/airweave-ai/airweave/blob/main/fern/docs/pages/mcp-server.mdx Initialize a connection to the hosted MCP server using a POST request. This example demonstrates the required headers and JSON payload for the `initialize` method over Streamable HTTP. ```bash curl -X POST https://mcp.airweave.ai/mcp \ -H "Content-Type: application/json" \ -H "Accept: text/event-stream" \ -H "X-API-Key: your-api-key" \ -H "X-Collection-Readable-ID: your-collection-id" \ -d '{"jsonrpc": "2.0", "method": "initialize", "params": {"protocolVersion": "2025-03-26", "capabilities": {}, "clientInfo": {"name": "my-client", "version": "1.0.0"}}, "id": 1}' ``` -------------------------------- ### Start All Services with Docker Source: https://github.com/airweave-ai/airweave/blob/main/CLAUDE.md Use this script to start all Airweave services locally using Docker. Options are available to skip the frontend or restart services. ```bash ./start.sh ./start.sh --skip-frontend ./start.sh --restart ./start.sh --destroy ``` -------------------------------- ### Example Claude Desktop Queries Source: https://github.com/airweave-ai/airweave/blob/main/mcp/README.md Examples of natural language queries that can be used with the Airweave MCP server in Claude Desktop to search for specific information. ```text # "Search for customer feedback about pricing" # "Find the most recent documents about API changes" # "Show me support tickets from the last week" ``` -------------------------------- ### Clone and Setup Airweave Repository Source: https://github.com/airweave-ai/airweave/blob/main/fern/docs/pages/add-new-source.mdx Clone the Airweave repository and set up your development environment using the provided script. ```bash git clone https://github.com/YOUR_USERNAME/airweave.git cd airweave ./start.sh ``` -------------------------------- ### Concrete Domain Event Example Source: https://github.com/airweave-ai/airweave/blob/main/backend/airweave/architecture-refactor.md An example of a concrete domain event that inherits from `BaseDomainEvent`, narrows the `event_type` using a specific enum, and adds domain-specific fields. ```python class SyncLifecycleEvent(BaseDomainEvent): event_type: SyncEventType # narrowed from str sync_id: UUID sync_job_id: UUID collection_id: UUID source_connection_id: UUID source_type: str = "" # ... metrics, error, etc. ``` -------------------------------- ### Run Backend Development Server Source: https://github.com/airweave-ai/airweave/blob/main/CLAUDE.md Start the FastAPI development server for the backend. This command enables hot-reloading for rapid development. ```bash poetry run uvicorn airweave.main:app --host 0.0.0.0 --port 8001 --reload ``` -------------------------------- ### Webhook Delivery Example Source: https://github.com/airweave-ai/airweave/blob/main/fern/docs/pages/webhooks/overview.mdx This is an example of an HTTP POST request that Airweave sends to your webhook endpoint when a sync completes. Your server should respond with a 200 OK status to acknowledge receipt. ```http POST /webhooks/airweave HTTP/1.1 Host: your-server.com Content-Type: application/json svix-id: msg_2xKvB8LPqM4nRst svix-timestamp: 1705329000 svix-signature: v1,g0hM9SsE+OTPJTGt/tmIKtSyZlE3uFJELVlNIOLJ1OE= { "event_type": "sync.completed", "sync_id": "440e8400-e29b-41d4-a716-446655440099", "sync_job_id": "550e8400-e29b-41d4-a716-446655440000", "collection_id": "770e8400-e29b-41d4-a716-446655440002", "collection_readable_id": "sales-data-ab123", "collection_name": "Sales Data", "source_connection_id": "660e8400-e29b-41d4-a716-446655440001", "source_type": "salesforce", "entities_inserted": 42, "entities_updated": 10, "entities_deleted": 3, "entities_skipped": 120, "chunks_written": 215, "timestamp": "2025-01-15T14:30:00Z" } ``` -------------------------------- ### Centralized Protocols Example Source: https://github.com/airweave-ai/airweave/blob/main/backend/airweave/architecture-refactor.md Shows how protocols are organized by capability rather than scattered across domains. Domains import from these centralized protocols, and adapters implement them. ```python core/protocols/ ├── messaging.py # EventPublisher, StatePublisher ├── storage.py # FileStorage, CredentialStore ├── sources.py # Source ├── destinations.py # Destination └── embeddings.py # Embedder ``` -------------------------------- ### API Validation Error Example Source: https://github.com/airweave-ai/airweave/blob/main/fern/docs/pages/auth-providers/pipedream.mdx This JSON shows an example error response when the Pipedream provider does not support the specified source. This indicates a configuration mismatch between the provider and the intended source application. ```json { "detail": "Source 'github' does not support 'pipedream' as an auth provider. Supported providers: []" } ``` -------------------------------- ### Run E2E Tests Source: https://github.com/airweave-ai/airweave/blob/main/backend/tests/README.md Instructions for setting up and executing End-to-End tests. Ensure you are in the `tests/e2e` directory, install dependencies, and create a `.env.test` file with your credentials before running `pytest`. ```bash cd tests/e2e pip install -r requirements.txt # Create .env.test with your credentials # Run tests pytest smoke/ ``` -------------------------------- ### List Collections Source: https://github.com/airweave-ai/airweave/blob/main/fern/docs/pages/framework-integrations/pipedream.mdx Get all collections in your organization. ```APIDOC ## List Collections ### Description Get all collections in your organization. ### Parameters #### Query Parameters - **skip** (integer) - Optional - Number of collections to skip (default: 0) - **limit** (integer) - Optional - Maximum collections to return (default: 50) ``` -------------------------------- ### Complete Example - Combining Advanced Search Features Source: https://github.com/airweave-ai/airweave/blob/main/examples/search_concepts.ipynb Demonstrates a comprehensive search using multiple advanced features together, including AI query expansion, hybrid search, structured filtering, recency bias, score threshold, AI reranking, and pagination. Requires proper filter imports and valid data. ```python print("🚀 COMPLETE EXAMPLE") print("=" * 50) print("Example 14: Advanced search with all features") try: # Import the required filter classes from airweave.models import Filter, FieldCondition, MatchAny results = client.collections.search_advanced( readable_id=COLLECTION_ID, query="customer feedback about pricing", expansion_strategy="llm", # AI query expansion search_method="hybrid", # Best search method filter=Filter( must=[FieldCondition( key="source_name", match=MatchAny(any=["Zendesk", "Slack"]) )] ), recency_bias=0.5, # Prefer recent content score_threshold=0.7, # High confidence only enable_reranking=True, # AI reranking response_type="raw", # Raw results limit=50, # Pagination offset=0 ) print(f"Advanced search completed!") print(f"Results: {len(results.results)}") print("This example demonstrates:") print("- AI query expansion") print("- Hybrid search method") print("- Source filtering") print("- Recency bias") print("- Score threshold") print("- AI reranking") print("- Pagination") except Exception as e: print(f"Error: {e}") print("Note: This example requires proper filter imports and valid data") print() print("🎉 Tutorial completed! You now know how to use Airweave search effectively.") print() print("Next steps:") print("1. Try these examples with your own data") print("2. Experiment with different parameters") print("3. Check out the interactive API docs: https://docs.airweave.ai/api-reference") print("4. Read our blog for advanced tips: https://airweave.ai/blog") # ============================================================================ # HELPER FUNCTIONS & TIPS ``` -------------------------------- ### AI Answer Generation - Get Synthesized Responses Source: https://github.com/airweave-ai/airweave/blob/main/examples/search_concepts.ipynb Generate a synthesized answer based on search results for question-answering scenarios. Use `response_type="completion"` to get a direct AI-generated response instead of a list of documents. Perfect for chatbots. ```python print("💬 AI ANSWER GENERATION") print("=" * 50) print("Example 13: Get AI-generated answers") try: results = client.collections.search_advanced( readable_id=COLLECTION_ID, query="What are our customer refund policies?", response_type="completion" # Get AI-generated answer ) if hasattr(results, 'completion') and results.completion: print("AI Answer:") print(results.completion) else: print("No completion generated") except Exception as e: print(f"Error: {e}") print() ``` -------------------------------- ### API Client Usage Example Source: https://github.com/airweave-ai/airweave/blob/main/frontend/README.md Demonstrates correct usage of the `apiClient` for making requests to the backend. Use relative paths; the client handles URL construction. ```tsx import { apiClient } from '@/lib/api'; // Correct const response = await apiClient.get('/sources'); // Incorrect const response = await apiClient.get('api/v1/sources'); ```