# knowledge_hub **Repository Path**: nojun/knowledge_hub ## Basic Information - **Project Name**: knowledge_hub - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-05-01 - **Last Updated**: 2026-05-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Knowledge Hub Knowledge Hub is an internal knowledge retrieval platform. The current implementation starts with the base infrastructure needed before building `v1-ingestion`. ## External Dependencies This project connects to externally managed infrastructure. It does not create or run these services locally: - PostgreSQL - Redis - MinIO - Milvus Copy `.env.example` to `.env` and fill in the real connection values before running API, worker, or migrations. ## Backend Setup ```bash python3 -m venv .venv .venv/bin/pip install -r requirements.txt ``` ## Database Migrations ```bash PYTHONPATH=. .venv/bin/alembic upgrade head PYTHONPATH=. .venv/bin/alembic revision --autogenerate -m "message" ``` ## Run API ```bash .venv/bin/uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload ``` Health and metrics: ```bash curl http://localhost:8000/health curl http://localhost:8000/metrics ``` ## Run Worker ```bash .venv/bin/celery -A workers.celery_worker worker --loglevel=info --concurrency=2 ``` ## Run Tests ```bash .venv/bin/pytest tests/unit -v ``` ## Auth Run migrations, then create the initial admin: ```bash PYTHONPATH=. .venv/bin/alembic upgrade head INITIAL_ADMIN_PASSWORD=Admin1234 PYTHONPATH=. .venv/bin/python scripts/create_initial_admin.py ``` Login: ```bash curl -X POST http://localhost:8000/api/v1/auth/login \ -H "Content-Type: application/json" \ -d '{"username_or_email": "admin", "password": "Admin1234"}' ``` Protected API calls require a Bearer token: ```bash curl http://localhost:8000/api/v1/data-sources \ -H "Authorization: Bearer " ``` Roles: - `admin`: create/edit data sources, run scans, browse files. - `viewer`: browse data sources and files. ## v1 Ingestion Create a filesystem data source: ```bash curl -X POST http://localhost:8000/api/v1/data-sources \ -H "Content-Type: application/json" \ -H "Authorization: Bearer " \ -d '{ "name": "Local Docs", "type": "filesystem", "connection_config": {"root_path": "/tmp/knowledge-hub-docs"}, "credential_ref": "local_filesystem", "owner_team": "engineering" }' ``` Trigger a scan: ```bash curl -X POST http://localhost:8000/api/v1/data-sources//scan \ -H "Content-Type: application/json" \ -H "Authorization: Bearer " \ -d '{"mode": "incremental", "options": {"path": "."}}' ``` Query ingestion state: ```bash curl http://localhost:8000/api/v1/data-objects \ -H "Authorization: Bearer " curl http://localhost:8000/api/v1/ingestion-records \ -H "Authorization: Bearer " ``` Run integration smoke tests when PostgreSQL is configured and migrated: ```bash RUN_INTEGRATION_TESTS=1 .venv/bin/pytest tests/integration/modules/ingestion -v ``` ## Docker Docker Compose is only for this project's services: ```bash docker compose up -d api worker web ``` It expects `.env` to point at external PostgreSQL, Redis, MinIO, and Milvus.