SAG
A new SOTA for RAG — an original retrieval architecture and an open-source knowledge base for humans and agents.
File Explorer
Download Latest Version (.zip)- ci.yml
- desktop-release.yml
- fnos-release.yml
- CODEOWNERS
- dependabot.yml
- sag-api.spec
- __init__.py
- loop.py
- py.typed
- runtime.py
- store.py
- tools.py
- types.py
- __init__.py
- activity.py
- agents.py
- attachments.py
- auth.py
- dify.py
- documents.py
- insights.py
- jobs.py
- knowledge.py
- octx.py
- openai.py
- search.py
- sources.py
- system.py
- universe.py
- __init__.py
- __init__.py
- base.py
- file_upload.py
- registry.py
- web.py
- __init__.py
- config.py
- db.py
- deps.py
- error_taxonomy.py
- errors.py
- litellm_policy.py
- logging.py
- model_providers.py
- security.py
- __init__.py
- agent.py
- document.py
- job.py
- octx.py
- setting.py
- source.py
- universe.py
- user.py
- __init__.py
- base.py
- __init__.py
- llm.py
- prompt.py
- __init__.py
- control.py
- inproc.py
- octx_tasks.py
- queue.py
- scheduling.py
- tasks.py
- __init__.py
- mount.py
- server.py
- __init__.py
- _worker.py
- decision_token.py
- errors.py
- limits.py
- runner.py
- semver.py
- storage.py
- __init__.py
- mineru.py
- mineru_official.py
- service.py
- text.py
- __init__.py
- _timings_probe.py
- chunk_heading_vectors.py
- compat.py
- config_builder.py
- document_cleanup.py
- dto.py
- engine_manager.py
- errors.py
- incremental_processor.py
- octx_ids.py
- octx_importer.py
- octx_plan_store.py
- octx_smoke_test.py
- octx_snapshot.py
- octx_vector_manifest.py
- octx_vector_protocol.py
- octx_vector_rebuilder.py
- octx_vector_reuse.py
- __init__.py
- agent.py
- auth.py
- chunk.py
- common.py
- dify.py
- document.py
- insight.py
- job.py
- octx.py
- search.py
- source.py
- system.py
- universe.py
- __init__.py
- llm_judge.py
- __init__.py
- agent_domain.py
- agent_service.py
- auth_service.py
- document_service.py
- insight_service.py
- octx_conflict_service.py
- octx_diagnostics_service.py
- octx_gc_service.py
- octx_recovery_service.py
- octx_transfer_service.py
- query_analysis.py
- retrieval_service.py
- settings_service.py
- source_operation_service.py
- source_service.py
- universe_service.py
- __init__.py
- base.py
- builtin.py
- mcp.py
- registry.py
- __init__.py
- branding.py
- desktop.py
- enums.py
- main.py
- eval_retrieval.py
- conftest.py
- test_agent_runtime.py
- test_agent_tools.py
- test_agentic.py
- test_agents.py
- test_api_smoke.py
- test_ask_stream.py
- test_chunk_heading_vectors.py
- test_client_form.py
- test_connectors.py
- test_dependency_policy.py
- test_dify_retrieval.py
- test_dify_setup.py
- test_document_cleanup_coordinator.py
- test_document_job_retry.py
- test_document_parsing.py
- test_document_priority_queue.py
- test_document_resume.py
- test_error_taxonomy.py
- test_experience.py
- test_gaps.py
- test_hardening.py
- test_insights.py
- test_local_onboarding.py
- test_mcp.py
- test_message_pagination.py
- test_message_status_enum.py
- test_octx_conflict_and_lease.py
- test_octx_diagnostics.py
- test_octx_domain.py
- test_octx_gc.py
- test_octx_jobs.py
- test_octx_plan_store.py
- test_octx_runtime.py
- test_octx_snapshot.py
- test_octx_transfer_service.py
- test_octx_vector_manifest.py
- test_octx_vector_protocol.py
- test_postgres_schema_e2e.py
- test_query_analysis.py
- test_quick_model_setup.py
- test_retrieval_relevance.py
- test_search_strategy.py
- test_search_stream.py
- test_settings.py
- test_thread_pagination.py
- test_timestamps.py
- test_traceability.py
- test_units.py
- test_universe.py
- test_universe_engine.py
- test_universe_rebuild_queue.py
- test_upload_limits.py
- .dockerignore
- .env.example
- Dockerfile
- pyproject.toml
- README.md
- uv.lock
- icon-master.png
- icon.icns
- icon.ico
- splash.html
- build-backend.mjs
- build-web.mjs
- clean.mjs
- dev.mjs
- prepare-resources.mjs
- verify-preload.mjs
- channels.ts
- config.ts
- main.ts
- preload.ts
- runtime-state.ts
- runtime.ts
- updater-error.ts
- updater.ts
- web-runtime.ts
- runtime-state.test.mts
- updater-error.test.mts
- electron-builder.config.cjs
- package-lock.json
- package.json
- README.md
- tsconfig.json
- page.tsx
- page.test.tsx
- page.tsx
- page.tsx
- page.tsx
- page.tsx
- layout.tsx
- page.tsx
- layout.tsx
- fonts.ts
- globals.css
- icon.png
- icon.svg
- layout.tsx
- agent-activity-timeline.tsx
- citation-block.tsx
- conversation-panel.tsx
- conversation-provider.tsx
- conversation-transcript.tsx
- prompt-preview.tsx
- search-panel-sections.tsx
- search-panel.tsx
- search-provider.tsx
- search-state.test.ts
- search-state.ts
- account-settings.tsx
- agent-settings-card.tsx
- app-shell.test.ts
- app-shell.tsx
- app-sidebar.tsx
- app-version-badge.test.tsx
- app-version-badge.tsx
- appearance-settings.tsx
- archived-threads-card.tsx
- auth-image.tsx
- code-block.tsx
- copy-button.tsx
- create-source-dialog.tsx
- desktop-update-indicator.test.tsx
- desktop-update-indicator.tsx
- detail-panel-octx-preview.test.tsx
- detail-panel.tsx
- diagnostics-settings.tsx
- document-detail-workspace.tsx
- document-list.tsx
- edit-source-dialog.tsx
- empty-state.tsx
- event-entity-graph-model.test.ts
- event-entity-graph-model.ts
- event-entity-selection-card.tsx
- folder-import-dialog.test.tsx
- folder-import-dialog.tsx
- folder-import-upload.test.ts
- folder-import-upload.ts
- graph-canvas.tsx
- knowledge-config-form.tsx
- knowledge-provider.tsx
- knowledge-source-workspace.tsx
- knowledge-universe-model.test.ts
- knowledge-universe-model.ts
- knowledge-universe-overlays.tsx
- knowledge-universe.test.ts
- knowledge-universe.tsx
- knowledge-workspace.module.css
- knowledge-workspace.test.tsx
- knowledge-workspace.tsx
- language-toggle.tsx
- markdown-content.tsx
- mcp-service-settings.tsx
- mcp-settings-card.tsx
- mcp-tool-list.tsx
- model-config-form.tsx
- octx-export-decision-dialog.tsx
- octx-export-provider.test.ts
- octx-export-provider.tsx
- octx-export-task-center.test.tsx
- octx-export-task-center.tsx
- octx-import-decision-dialog.test.tsx
- octx-import-decision-dialog.tsx
- octx-import-provider.tsx
- octx-import-task-center.tsx
- orbital-graph-3d.tsx
- page-header.tsx
- particle-galaxy.tsx
- pet-appearance-settings.tsx
- pet-head-avatar.tsx
- pet-mini-workspace.tsx
- pet.tsx
- quick-model-setup-dialog.tsx
- retrieval-test-dialog.tsx
- search-graph.tsx
- search-strategy-control.tsx
- settings-section.tsx
- site-header.tsx
- source-card.test.tsx
- source-card.tsx
- source-create-form.tsx
- source-graph.tsx
- source-id-copy.test.tsx
- source-id-copy.tsx
- source-mcp-card.tsx
- space-backdrop.test.ts
- space-backdrop.tsx
- space-particles.tsx
- status-badge.tsx
- sync-panel.tsx
- theme-toggle.tsx
- universe-scene-contract.ts
- universe-scene-engine.ts
- universe-scene.test.ts
- universe-scene.tsx
- universe-view-settings-drawer.test.ts
- universe-view-settings-drawer.tsx
- universe-view-settings-panel.tsx
- upload-zone.tsx
- use-source-content.ts
- window-mode-toggle.tsx
- workspace-section-icon.tsx
- alert-dialog.tsx
- alert.tsx
- avatar.tsx
- badge.tsx
- breadcrumb.tsx
- button.tsx
- card.tsx
- checkbox.tsx
- command.tsx
- confirm-dialog.tsx
- dialog.tsx
- dropdown-menu.tsx
- empty.tsx
- field.tsx
- input.tsx
- label.tsx
- progress.tsx
- resizable.tsx
- scroll-area.tsx
- select.tsx
- separator.tsx
- sheet.tsx
- sidebar.tsx
- skeleton.tsx
- slider.tsx
- sonner.tsx
- spinner.tsx
- switch.tsx
- tabs.tsx
- textarea.tsx
- toggle-group.tsx
- toggle.tsx
- tooltip.tsx
- providers.tsx
- use-diagnostics.ts
- use-mobile.tsx
- client-errors.test.ts
- client-errors.ts
- client.ts
- config.test.ts
- config.ts
- global.d.ts
- request.ts
- agent-run-activity.test.ts
- agent-run-activity.ts
- api-octx.test.ts
- api-search-stream.test.ts
- api-source-graph.test.ts
- api.test.ts
- api.ts
- app-initialization.test.ts
- app-initialization.ts
- auth-cookie.test.ts
- auth-cookie.ts
- auth.ts
- avatar.ts
- branding.ts
- citation-presentation.test.ts
- citation-presentation.ts
- clipboard.ts
- composer-keyboard.test.ts
- composer-keyboard.ts
- conversation-runtime.test.ts
- conversation-runtime.ts
- desktop-bridge.d.ts
- diagnostics.test.ts
- diagnostics.ts
- document-activity.test.ts
- document-activity.ts
- document-metadata.test.ts
- document-metadata.ts
- document-parser-status.test.ts
- document-parser-status.ts
- folder-import.test.ts
- folder-import.ts
- format.ts
- markdown-blocks.test.ts
- markdown-blocks.ts
- mcp-config.ts
- mcp-server-key.test.ts
- mcp-server-key.ts
- mineru-config.test.ts
- mineru-config.ts
- model-config-lock.test.ts
- model-config-lock.ts
- octx-export-decision.test.ts
- octx-export-decision.ts
- octx-export-dismissal.test.ts
- octx-export-dismissal.ts
- octx-export-manager.test.ts
- octx-export-manager.ts
- octx-export-tasks.test.ts
- octx-export-tasks.ts
- octx-import-manager.test.ts
- octx-import-manager.ts
- octx-import-progress.test.ts
- octx-import-tasks.ts
- pet-agent.ts
- pet-appearance-preferences.test.ts
- pet-appearance-preferences.ts
- pet-events.ts
- pet-placement.test.ts
- pet-placement.ts
- pet-preferences.ts
- retrieval-config.ts
- search-result-sort.test.ts
- search-result-sort.ts
- settings-config.ts
- source-graph-document-scope.test.ts
- source-graph-document-scope.ts
- sse.test.ts
- sse.ts
- types.ts
- universe-accumulation.test.ts
- universe-accumulation.ts
- universe-event-bundle-adapter.test.ts
- universe-event-bundle-adapter.ts
- universe-event-cache.test.ts
- universe-event-cache.ts
- universe-events.test.ts
- universe-events.ts
- universe-expansion-admission.test.ts
- universe-expansion-admission.ts
- universe-keyboard-navigation.test.ts
- universe-keyboard-navigation.ts
- universe-prefetch-controller.test.ts
- universe-prefetch-controller.ts
- universe-presentation.test.ts
- universe-presentation.ts
- universe-preview-plan.test.ts
- universe-preview-plan.ts
- universe-scene-projection.test.ts
- universe-scene-projection.ts
- universe-scene-transition.test.ts
- universe-scene-transition.ts
- universe-scene-window.test.ts
- universe-scene-window.ts
- universe-session-state.test.ts
- universe-session-state.ts
- universe-temporal-axis.test.ts
- universe-temporal-axis.ts
- universe-temporal-flight.test.ts
- universe-temporal-flight.ts
- universe-timeline-admission.test.ts
- universe-timeline-admission.ts
- universe-timeline-deque.test.ts
- universe-timeline-deque.ts
- universe-timeline-playback.test.ts
- universe-timeline-playback.ts
- universe-timeline-window.test.ts
- universe-timeline-window.ts
- universe-view-preferences.test.ts
- universe-view-preferences.ts
- universe-webgl-capability.test.ts
- universe-webgl-capability.ts
- universe-working-set.test.ts
- universe-working-set.ts
- upload-guidance.test.ts
- upload-guidance.ts
- utils.ts
- window-layout.test.ts
- window-layout.ts
- workspace.test.ts
- workspace.ts
- en-US.json
- zh-CN.json
- robots.txt
- sag-icon.png
- check-i18n.cjs
- require-npm.cjs
- .dockerignore
- .env.local.example
- .eslintignore
- .eslintrc.json
- components.json
- Dockerfile
- middleware.ts
- next-env.d.ts
- next.config.mjs
- package-lock.json
- package.json
- postcss.config.mjs
- tailwind.config.ts
- tsconfig.json
- vitest.config.ts
- 01-init.sql
- discord-community-qr.jpg
- main-result.png
- paper-first-page.png
- paper-sag-architecture.png
- product-chat.png
- product-explore-mode.gif
- product-graph-3d.png
- product-graph.png
- product-import.png
- product-mcp.png
- product-search.png
- repository-architecture-cn.png
- repository-architecture.png
- wechat-community-qr.png
- zleap-readme-header.png
- dify-integration.en.md
- dify-integration.md
- sag-cli.en.md
- sag-cli.md
- release-public.test.mjs
- release-public.mjs
- setup_dify.py
- .env.example
- .gitignore
- .public-sync-state.json
- CHANGELOG.md
- compose.dify.yaml
- compose.postgres.yaml
- compose.yaml
- CONTRIBUTING.md
- LICENSE
- Makefile
- README-CN.md
- README.md
# Installation Guide
git clone https://github.com/Zleap-AI/SAG
Downloads the entire project code from GitHub to your computer.
cd SAG
Moves into the project folder you just downloaded.
2. Official Install Script
Easy Recommendednpm install --global @zleap-ai/sag-cli
Installs the package published on the npm registry globally — no need to clone the source.
pip install zleap-sag
Installs the package published on PyPI directly — no need to clone the source.
Pulled directly from this repo's README.
3. Docker
Easy- Git Needed to download the project code from GitHub.
- Docker Desktop Needed to build and run containers. Install it and keep it running in the background.
docker compose up -d --build
Builds and starts all defined containers (server, database, etc.) at once, in the background.
docker compose ps # api and web should be healthy
Runs the command against the services defined in the compose file.
docker compose logs -f api web # follow logs
Runs the command against the services defined in the compose file.
docker compose restart # restart services
Runs the command against the services defined in the compose file.
docker compose down # stop and keep all data
Runs the command against the services defined in the compose file.
Pulled directly from this repo's README.
4. Node.js
Easynpm install --global @zleap-ai/sag-cli
Installs the package published on the npm registry globally — no need to clone the source.
SKILL_SRC="$(npm root -g)/@zleap-ai/sag-cli"
Type this command into your terminal and run it.
npm install
Downloads and installs the libraries listed in package.json.
npm run dev
Starts the development/run server.
cd apps/web && npm run typecheck
Moves into the project folder you just downloaded.
Pulled directly from this repo's README.
5. Python
Easypython -m venv .venv
Runs the Python script (or module).
pip install -e ".[dev]"
Installs the Python libraries listed in requirements.txt (or similar).
pip install zleap-sag
Installs the package published on PyPI directly — no need to clone the source.
Pulled directly from this repo's README.
6. Make
Medium- Git Needed to download the project code from GitHub.
- Make Usually pre-installed on Linux/macOS. On Windows, install separately (e.g. via MSYS2 or WSL).
make
Compiles the code based on the generated build configuration to produce an executable.
