How jikongabc/cogdoc works
CogDoc is a RAG knowledge-base platform for teams and individuals. Its main workflow is to ingest documents into a knowledge base, retrieve scoped evidence for a question, generate a grounded response, and validate citations before presenting results. The graph also preserves documented branches for Deep Research, connectors, derived-knowledge review, enterprise access control, and optional high-availability storage. Several relationships come from the README or source-index import references; unsampled implementation details are not inferred.
Main entry points: app.py HTTP API · chat_service.py Chat service · workflow.py Agent workflow · retrieval_pipeline.py Hybrid retrieval
Components 20
User workspace
- Next.js workspace
web/app/(workspace)/chat/page.tsx - Compatibility console
src/cogdoc/frontend/app.py
API and governance
- HTTP API
src/cogdoc/api/app.py - Accounts and access
src/cogdoc/api/auth_store.py - Derived knowledge review
src/cogdoc/api/derived_knowledge_store.py
Knowledge lifecycle
- Ingestion jobs
src/cogdoc/api/ingest.py - Index generation
src/cogdoc/service/ingest_service.py - Connector sync
src/cogdoc/connectors/manager.py - Sync state
src/cogdoc/connectors/sync_store.py
Retrieval and answers
- Chat service
src/cogdoc/service/chat_service.py - Agent workflow
src/cogdoc/graph/workflow.py - Hybrid retrieval
src/cogdoc/service/retrieval_pipeline.py - Evidence assembly
src/cogdoc/service/evidence_unit_pipeline.py - Citation ledger
src/cogdoc/tools/citation_ledger.py - Conversation memory
src/cogdoc/memory/manager.py - Rust retrieval core
rust_core/src/lib.rs
Platform extensions
- Deep Research
src/cogdoc/service/research_execution.py - Distributed control plane
src/cogdoc/ha/runtime.py - Runtime settings
src/cogdoc/config/settings.py
Other components
- User
Connections 22
- User → Next.js workspace: uses
README.md - User → Compatibility console: uses
README.md - Next.js workspace → HTTP API: calls
README.md - Compatibility console → HTTP API: calls
src/cogdoc/frontend/app.py - HTTP API → Accounts and access: uses
src/cogdoc/api/app.py - HTTP API → Ingestion jobs: routes
src/cogdoc/api/app.py - HTTP API → Derived knowledge review: uses
src/cogdoc/api/app.py - Ingestion jobs → Index generation: delegates
src/cogdoc/api/ingest.py - Connector sync → Sync state: persists sync
src/cogdoc/connectors/manager.py - User → Chat service: asks question
README.md - HTTP API → Chat service: serves chat
README.md - Chat service → Agent workflow: orchestrates
- Agent workflow → Hybrid retrieval: retrieves evidence
README.md - Hybrid retrieval → Evidence assembly: assembles context
src/cogdoc/service/evidence_unit_pipeline.py - Evidence assembly → Citation ledger: binds citations
src/cogdoc/service/evidence_unit_pipeline.py - Agent workflow → Rust retrieval core: validates citations
README.md - Chat service → Conversation memory: uses memory
README.md - User → Deep Research: starts research
README.md - Deep Research → Hybrid retrieval: uses retrieval
README.md - HTTP API → Connector sync: manages sources
README.md - HTTP API → Distributed control plane: optional coordination
README.md - Runtime settings → Distributed control plane: configures
src/cogdoc/config/settings.py