How reachlin/almanac works
Almanac is a Slack knowledge-answering bot: a mention reaches the Lambda, is verified and handled, retrieves relevant knowledge, and produces a threaded reply. Its separate ingestion workflow chunks Markdown, embeds it, and stores vectors for later retrieval. The graph also preserves the optional SNS async route and the tool-calling scaffold. Edges are based on the excerpts and README; infrastructure provisioning is excluded because it is deployment tooling, not runtime product behavior.
Main entry points: handler.py Lambda handler · ai.py Answer orchestration · slack_app.py Slack event handling · ingest_knowledge.py Markdown ingestion
Components 16
Event handling
- Lambda handler
src/handler.py - Secret loading
src/config.py - Slack event handling
src/slack_app.py
Answer generation
- Answer orchestration
src/ai.py - Tool dispatch
src/tools.py
Knowledge memory
- Markdown ingestion
scripts/ingest_knowledge.py - Knowledge Markdown
knowledge - Memory retrieval
src/memory.py
External services
- API Gateway
- SNS topic
- Slack
- OpenAI
- S3 Vectors index
- Secrets Manager
Other components
- Slack user
- Knowledge editor
Connections 18
- Slack user → API Gateway: mentions bot
README.md - API Gateway → Lambda handler: invokes
README.md - Lambda handler → Secret loading: loads secrets
src/handler.py - Secret loading → Secrets Manager: reads secret
src/config.py - Lambda handler → Slack event handling: routes event
src/handler.py - Lambda handler → SNS topic: publishes event
src/handler.py - SNS topic → Lambda handler: invokes async
README.md - Slack event handling → Answer orchestration: requests answer
src/slack_app.py - Slack event handling → Slack: posts reply
src/slack_app.py - Answer orchestration → Memory retrieval: queries memory
src/ai.py - Answer orchestration → OpenAI: requests completion
src/ai.py - Answer orchestration → Tool dispatch: dispatches tools
src/ai.py - Memory retrieval → OpenAI: embeds query
src/memory.py - Memory retrieval → S3 Vectors index: queries vectors
src/memory.py - Knowledge editor → Knowledge Markdown: edits
README.md - Knowledge Markdown → Markdown ingestion: reads Markdown
scripts/ingest_knowledge.py - Markdown ingestion → OpenAI: embeds chunks
scripts/ingest_knowledge.py - Markdown ingestion → S3 Vectors index: upserts vectors
scripts/ingest_knowledge.py