How i-junaidkhan/notebook_llm works
CogniFlow is a privacy-first research and knowledge platform: users collect sources, organize them into notebooks, then search or ask questions and synthesize findings into notes, transformations, mind maps, and podcasts. The backend exposes these capabilities through FastAPI routes, with LangGraph workflows and domain services using SurrealDB and configurable AI models. The graph preserves documented product branches, but several are represented at their exact enclosing directories because their implementation was not sampled; those links are marked unverified rather than inferred as confirmed calls.
Main entry points: routers Feature routes · repository.py SurrealDB repository · notebook.py Notebooks and notes · chat.py Knowledge chat
Components 21
User experience
- Web application
frontend/src/app
API and services
- FastAPI application
api/main.py - Feature routes
api/routers - API services
api
Knowledge workflows
- Source ingestion
api/sources_service.py - Notebooks and notes
open_notebook/domain/notebook.py - Knowledge chat
api/routers/chat.py - Source chat
api/routers/source_chat.py - Context assembly
open_notebook/utils/context_builder.py - Search and ask
api/routers/search.py - Transformations
api/transformations_service.py - Mind maps
open_notebook/graphs - Podcast generation
api/podcast_service.py - Embedding jobs
commands/embedding_commands.py
Models and storage
- Embedding utilities
open_notebook/utils/embedding.py - AI model manager
open_notebook/ai/models.py - Domain records
open_notebook/domain - SurrealDB repository
open_notebook/database/repository.py
Other components
- Researcher
- SurrealDB
- AI providers
Connections 29
- Researcher → Web application: uses
- Web application → FastAPI application: requests
- FastAPI application → Feature routes: registers
api/main.py - Feature routes → API services: delegates
api/routers/embedding_rebuild.py - Feature routes → Source ingestion: ingests
- Feature routes → Notebooks and notes: manages
api/routers/embedding.py - Feature routes → Knowledge chat: routes chat
api/main.py - Knowledge chat → Notebooks and notes: loads records
api/routers/chat.py - Knowledge chat → Context assembly: uses context
- Knowledge chat → SurrealDB repository: queries
api/routers/chat.py - Feature routes → Source chat: routes chat
api/main.py - Source chat → Context assembly: builds context
- Feature routes → Search and ask: routes search
api/main.py - Search and ask → Notebooks and notes: loads records
api/routers/search.py - Search and ask → AI model manager: selects models
api/routers/search.py - Search and ask → SurrealDB repository: searches records
- Feature routes → Transformations: applies patterns
- Feature routes → Mind maps: generates maps
api/routers/search.py - Feature routes → Podcast generation: generates audio
- Feature routes → Embedding jobs: submits jobs
api/routers/embedding.py - Embedding jobs → Notebooks and notes: loads content
commands/embedding_commands.py - Embedding jobs → Embedding utilities: generates vectors
commands/embedding_commands.py - Embedding utilities → AI model manager: embeds text
open_notebook/utils/embedding.py - Embedding utilities → SurrealDB repository: stores vectors
- AI model manager → SurrealDB repository: loads configuration
open_notebook/ai/models.py - AI model manager → AI providers: creates models
- Notebooks and notes → SurrealDB repository: persists records
open_notebook/domain/notebook.py - Domain records → SurrealDB repository: uses persistence
open_notebook/domain/base.py - SurrealDB repository → SurrealDB: queries
open_notebook/database/repository.py