{
  "name": "psyche-knowledge-base",
  "$schema": "../../../node_modules/nx/schemas/project-schema.json",
  "sourceRoot": "apps/psyche/knowledge-base/src",
  "projectType": "application",
  "tags": ["scope:psyche", "layer:service", "type:python", "runtime:fastapi", "feature:rag"],
  "targets": {
    "serve": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/knowledge-base",
        "command": "poetry run uvicorn knowledge_base.main:app --reload --host 0.0.0.0 --port 8008"
      }
    },
    "serve-prod": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/knowledge-base",
        "command": "poetry run uvicorn knowledge_base.main:app --host 0.0.0.0 --port 8008 --workers 2"
      }
    },
    "build": {
      "executor": "nx:run-commands",
      "outputs": ["{projectRoot}/dist"],
      "options": {
        "cwd": "apps/psyche/knowledge-base",
        "commands": ["poetry build"]
      }
    },
    "install": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/knowledge-base",
        "command": "poetry install"
      }
    },
    "install-all": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/knowledge-base",
        "command": "poetry install --extras all"
      }
    },
    "install-pinecone": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/knowledge-base",
        "command": "poetry install --extras pinecone"
      }
    },
    "install-qdrant": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/knowledge-base",
        "command": "poetry install --extras qdrant"
      }
    },
    "install-pgvector": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/knowledge-base",
        "command": "poetry install --extras pgvector"
      }
    },
    "lint": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/knowledge-base",
        "commands": ["poetry run ruff check src/", "poetry run mypy src/"]
      }
    },
    "format": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/knowledge-base",
        "commands": ["poetry run black src/", "poetry run ruff check --fix src/"]
      }
    },
    "test": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/knowledge-base",
        "command": "poetry run pytest"
      }
    },
    "test-unit": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/knowledge-base",
        "command": "poetry run pytest -m 'not integration and not requires_api_key'"
      }
    },
    "test-integration": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/knowledge-base",
        "command": "poetry run pytest -m integration"
      }
    },
    "test-cov": {
      "executor": "nx:run-commands",
      "outputs": ["{projectRoot}/htmlcov"],
      "options": {
        "cwd": "apps/psyche/knowledge-base",
        "command": "poetry run pytest --cov=knowledge_base --cov-report=html"
      }
    },
    "docker-build": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/knowledge-base",
        "command": "docker build -t psyche-knowledge-base:latest ."
      }
    },
    "docker-run": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/knowledge-base",
        "command": "docker run -p 8008:8008 -v $(pwd)/documents:/app/documents --env-file .env psyche-knowledge-base:latest"
      }
    }
  }
}
