Cognosa Component Stack
Runtime processes, the packages inside them, the libraries they are built on, and the stores they talk to
The platform is three runtime pieces plus a set of offline tools. The React single-page app runs in the browser. The app process serves it and the REST API. The rt process executes the RAG pipeline. All Python code shares the common package. LangChain lives only in rt and the ingestion tools: it is the retrieval and chat abstraction, never part of the web API.
Browser
app process
rt process
Offline tools
Shared package
Data store
Third-party libraries
Where LangChain is used
| Package | Used in | For |
|---|---|---|
langchain_core | tasks_lib/llm_lib/llm_type_*.py | PromptTemplate, RunnablePassthrough, RunnableLambda, StrOutputParser; the chain is {context, question} | prompt | llm | parser, run with .stream() |
langchain_openai | llm_type_openai.py | ChatOpenAI for OpenAI, Qwen (DashScope), and Ollama local or remote through the OpenAI-compatible endpoint |
langchain_anthropic, langchain_google_genai | llm_type_claude.py, llm_type_gemini.py | ChatAnthropic, ChatGoogleGenerativeAI |
langchain_huggingface + sentence-transformers | vdb_lib/emb_models.py, loaders | HuggingFaceEmbeddings, preloaded per model name from RT_VDB_EMB_MODELS_PRELOAD |
langchain_qdrant, langchain_chroma, langchain_community PGVector | vdb_lib/*_ops.py | Vector store wrappers; as_retriever(search_type, search_kwargs) with a Qdrant payload filter built from the group's retrieval filters |
langchain_community loaders, langchain_text_splitters | document_loader_*.py, tools/ingest_dev/ | PDF, DOCX, PPTX, XLSX, TXT loading and chunking at ingestion time |
Runtime processes
| Process | Entry point | Concurrency | Talks to |
|---|---|---|---|
| React SPA | frontend/src/main.tsx, built by Vite into backend/static | Browser; polls GET /api/v1/doc_tasks/{uuid} until the task finishes | app only, over HTTPS with a JWT bearer |
| app | backend/webapp.py under uvicorn | Async; one worker | PostgreSQL (async SQLAlchemy); reads VDB and LLM health from api_processes |
| rt | backend/run_tasks.py | Main loop; RT_VDB_PROCESS_NUM VDB worker processes; one LLM thread per task; watchdog threads | PostgreSQL (sync SQLAlchemy), Qdrant, Ollama hosts, cloud LLM APIs, Hugging Face Hub on first model load |
| Offline tools | Run by hand from backend/ | Loaders use a multiprocessing pool per file | Qdrant (ingestion), PostgreSQL (init, migrate, backup) |