| |
|---|
| Status | [ ] Draft | [ ] In Review | [ ] Approved |
| Version | 0.4 |
| Related PRD | Section 7 Non-Functional Requirements (Deployment, Security) |
| Item | Requirement |
|---|
| Python | 3.11+ |
| OS | Linux (Recommended) / Windows Server / Container |
| Memory | Minimum 4GB, Recommended 8GB+ (for local LLM/Vector DB) |
| CPU | 2+ Cores (AVX support for some vector libs) |
| Disk | SSD recommended for Vector DB I/O |
| Service | Usage | Required |
|---|
| Vector DB | Knowledge Base retrieval (Chroma/Qdrant) | Yes |
| LLM Endpoint | OpenAI / Ollama / Claude / Qwen | Yes |
| Redis | Session/Cache (Optional for MVP) | Optional |
| PostgreSQL | Task/User data (Future) | Optional |
| AAD | Identity & SSO | Recommended for Prod |
Suitable for Development, PoC, or Small Teams. Includes API and optional Ollama.
# Clone repo
git clone https://github.com/arthurpanhku/DocSentinel.git
cd DocSentinel
# Run script
chmod +x deploy.sh
./deploy.sh
See Dockerfile and docker-compose.yml in repo.
Compose Example:
services:
agent:
build: .
ports: ["8000:8000"]
env_file: .env
volumes: ["./data:/app/data"]
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
uvicorn app.main:app --host 0.0.0.0 --port 8000
For environments without public internet access:
- LLM: Use Ollama or vLLM deployed internally.
- Identity: Use local accounts or internal IdP (LDAP/AD) if AAD is unreachable.
- Dependencies: Mirror PyPI packages or use pre-built Docker images.
Run the integration test script to verify core functions (API, Skills, Orchestrator) in an isolated environment:
./test_integration.sh
After deployment, you can run a quick self-check using pytest (requires python environment):
# Install test deps
pip install -r requirements-dev.txt
# Run integration tests against your local instance (mocking LLM)
pytest tests/test_health.py tests/test_assessments_api.py
If you see PASSED, the core API and orchestration logic are working correctly.
See .env.example for the template.
| Variable | Description | Example |
|---|
ENV | Environment | production |
LOG_LEVEL | Logging level | INFO |
API_PREFIX | API path prefix | /api/v1 |
CORS_ORIGINS | Comma-separated allowed browser origins | Local console origins |
SECRET_KEY | Session/Sign key | Random String |
| Variable | Description |
|---|
AAD_TENANT_ID | Azure Tenant ID |
AAD_CLIENT_ID | App Client ID |
AAD_CLIENT_SECRET | Client Secret |
AAD_REDIRECT_URI | OIDC Callback |
| Variable | Description | Example |
|---|
LLM_PROVIDER | Backend choice | openai / ollama |
OPENAI_API_KEY | Key for OpenAI | sk-... |
OLLAMA_BASE_URL | Local LLM URL | http://localhost:11434 |
OLLAMA_MODEL | Model name | llama3 |
| Variable | Description | Example |
|---|
CHROMA_PERSIST_DIR | Data path | ./data/chroma |
EMBEDDING_MODEL | HuggingFace model | all-MiniLM-L6-v2 |
| Variable | Description | Default |
|---|
UPLOAD_MAX_FILE_SIZE_MB | Max file size | 50 |
UPLOAD_MAX_FILES | Max files per req | 10 |
KB_REINDEX_ROOTS | Server directories allowed for KB reindex | ./examples |
MCP_DOCUMENT_ROOTS | Directories accessible to MCP document tools | ./examples |
AGENT_GATEWAY_ENABLED | Enable remote MCP and A2A endpoints | true |
AGENT_GATEWAY_TOKEN | Bearer token for remote agent access; empty means loopback-only | empty |
AGENT_GATEWAY_PUBLIC_URL | Public base URL advertised by the A2A Agent Card | http://localhost:8000 |
AGENT_GATEWAY_ALLOWED_HOSTS | MCP Host allow-list; add the exact deployment host and port | local hosts |
AGENT_GATEWAY_ALLOWED_ORIGINS | MCP browser Origin allow-list; add trusted web origins only | local origins |
AGENT_GATEWAY_TASK_TIMEOUT_SECONDS | Compatibility MCP wait timeout | 300 |
When running through Docker or a reverse proxy, configure
AGENT_GATEWAY_TOKEN; forwarded traffic is not considered loopback.
| Variable | Description | Default |
|---|
PARSER_ENGINE | auto, docling, or legacy | auto |
| Variable | Description | Default |
|---|
ENABLE_GRAPH_RAG | Enable graph-based retrieval | true |
LIGHTRAG_WORKING_DIR | LightRAG data directory | ./data/lightrag |
GRAPH_RAG_QUERY_MODE | Query mode: naive/local/global/hybrid | hybrid |
| Variable | Description | Default |
|---|
EVIDENCE_CRITIC_ENABLED | Run inference-time evidence verification for Design threats | true |
EVIDENCE_CRITIC_MAX_CANDIDATES | Current-document passages supplied per threat | 5 |
EVIDENCE_CRITIC_MAX_THREATS | Threats included in one verifier request | 20 |
The critic never uses policy or assessment-history chunks as proof of a current
design fact. If inference is unavailable or a returned evidence ID does not
resolve to an allowed current-document passage, the affected threat is marked
insufficient_evidence and remains subject to human review.
| Variable | Description | Default |
|---|
SSDLC_DEFAULT_STAGE | Default SSDLC stage when not specified: auto or a specific stage name | auto |
Valid stage values: requirements, design, development, testing, deployment, operations.
When set to auto, the SSDLC Router attempts to detect the stage from document content.
- Liveness:
GET /health (Returns 200 OK with version and environment info)
- LLM Config:
GET /config/llm (Shows current LLM provider and model)
- Format: JSON or Text (Standard Output).
- Privacy: Do not log sensitive document content or full user tokens.
- Fields: Request ID, User ID, Task ID, Duration, Error Stack.
- Scope: Who initiated assessment? Who accessed reports?
- Retention: Comply with organization policy (e.g. 90 days).
- Vector DB: Backup the
CHROMA_PERSIST_DIR regularly.
- Config: Backup
.env (securely).
| Issue | Possible Cause | Suggestion |
|---|
| Login Loop / 401 | AAD Config mismatch | Check Client ID, Secret, and Redirect URI in Azure Portal. |
| Task Pending Forever | Worker stuck / LLM timeout | Check logs for LLM connection errors or parser hangs. |
| Empty KB Results | Embeddings mismatch | Ensure ingestion and query use the same embedding model. |
| ServiceNow Error | Network / Auth | Verify instance URL reachability and credentials. |
| Version | Date | Changes |
|---|
| 0.4 | 2026-03 | Added SSDLC Pipeline config section. |
| 0.3 | 2026-03 | Removed Streamlit references. Added Parser Engine and Graph RAG config sections. Fixed section numbering. Updated health check endpoints. |
| 0.2 | 2025-03 | Added Docker Compose and standalone deployment options. |
| 0.1 | Initial | Draft Deployment and Runbook. |