How subeesesh/lenny works
Lenny Growth Assistant is a transcript-grounded chat product that answers with timestamped citations and can produce essays and one-pagers. Users enter through the React chat, which sends messages to FastAPI; the backend routes the turn, retrieves transcript passages, generates a response, and persists messages, citations, and artifacts. A separate ingestion workflow prepares transcript chunks and embeddings for retrieval. The README documents the provider options and sandboxed artifact rendering; some subsystem links rely on that documentation because their implementation was not sampled.
Main entry points: skills.py Answer skills · App.tsx Chat interface · sessions.py Session messaging · search.py Transcript retrieval
Components 25
Chat client
- Chat interface
web/src/App.tsx - HTTP and SSE client
web/src/api.ts - Answer and citations
web/src/components/MessageView.tsx - Artifact viewer
web/src/components/ArtifactPane.tsx - Safe rendering
web/src/render.ts
API and orchestration
- FastAPI application
backend/app/main.py - Session messaging
backend/app/api/sessions.py - Turn routing
backend/app/agent/router.py - Answer skills
backend/app/agent/skills.py - Prompt and citations
backend/app/agent/context.py - One-pager generation
backend/app/agent/artifact.py - Essay generation
backend/app/agent/essay.py
Transcript knowledge
- Transcript retrieval
backend/app/retrieval/search.py - Retrieval guards
backend/app/retrieval/guards.py - Ingestion pipeline
backend/app/ingest/pipeline.py - Clean and chunk
backend/app/ingest/clean.py - Transcript embeddings
backend/app/ingest/embed.py
Generation
- Provider selection
backend/app/llm/providers.py - Ollama provider
backend/app/llm/ollama.py - Anthropic provider
backend/app/llm/anthropic.py
Persistent data
- Session repositories
backend/app/db/repo.py - PostgreSQL and pgvector
backend/app/db/pool.py
Other components
- Assistant user
- Ollama service
- Anthropic service
Connections 27
- Assistant user → Chat interface: asks or creates
README.md - Chat interface → HTTP and SSE client: sends messages
web/src/App.tsx - HTTP and SSE client → Session messaging: HTTP and SSE
README.md - Session messaging → Answer skills: runs turn
backend/app/api/sessions.py - Answer skills → Turn routing: routes request
backend/app/agent/skills.py - Answer skills → Transcript retrieval: retrieves passages
README.md - Transcript retrieval → Retrieval guards: checks request
backend/app/retrieval/search.py - Transcript retrieval → Ollama service: embeds query
README.md - Transcript retrieval → PostgreSQL and pgvector: searches vectors
README.md - Answer skills → Prompt and citations: builds context
backend/app/agent/skills.py - Answer skills → Provider selection: selects provider
README.md - Provider selection → Ollama provider: creates provider
backend/app/llm/providers.py - Provider selection → Anthropic provider: creates provider
backend/app/llm/providers.py - Ollama provider → Ollama service: streams generation
backend/app/llm/ollama.py - Anthropic provider → Anthropic service: streams generation
README.md - Answer skills → Essay generation: writes essays
README.md - Answer skills → One-pager generation: creates one-pagers
README.md - Session messaging → Session repositories: loads and saves
backend/app/api/sessions.py - Session repositories → PostgreSQL and pgvector: reads and writes
README.md - Ingestion pipeline → Clean and chunk: cleans and chunks
backend/app/ingest/pipeline.py - Ingestion pipeline → Transcript embeddings: embeds chunks
backend/app/ingest/pipeline.py - Ingestion pipeline → PostgreSQL and pgvector: stores transcripts
README.md - Session messaging → Chat interface: streams events
README.md - Chat interface → Answer and citations: renders answers
web/src/App.tsx - Chat interface → Artifact viewer: opens artifacts
web/src/App.tsx - Answer and citations → Safe rendering: formats response
web/src/components/MessageView.tsx - Artifact viewer → Safe rendering: renders sandbox
web/src/components/ArtifactPane.tsx