How muhammederbay10/savely works
Savely turns Instagram saves into searchable personal memory: webhook events become normalized captures, queued indexing extracts and enriches each item, and chat questions retrieve matching saves for a reply. The graph also shows the model, media, vocabulary, and persistence layers, plus deletion. Search and future place/movie lookups are documented capabilities, but the README says the chat agent and external lookups are not yet complete. Some implementation files were not excerpted, so edges involving them are limited to relationships stated in the README or SOURCE INDEX.
Main entry points: indexer.py Item indexer · webhooks.py Webhook handler · service.py Ingestion service · worker.py Pipeline worker
Components 25
Capture and ingestion
- Webhook handler
app/api/webhooks.py - Instagram adapter
app/adapters/instagram.py - Ingestion service
app/ingestion/service.py - Ingestion state
app/ingestion/session_state.py - Job queue
app/ingestion/jobs.py
Indexing pipeline
- Pipeline worker
app/pipeline/worker.py - Item indexer
app/pipeline/indexer.py - Extraction steps
app/pipeline/steps - Media storage and tools
app/pipeline/media - Open vocabulary
app/pipeline/vocabulary/normalize.py - Content type registry
app/types/registry.py
Chat and retrieval
- Agent worker
app/agent/worker.py - Chat agent and tools
app/agent/tools.py - Hybrid retrieval
app/agent/search/retrieval.py - Search planning
app/agent/search/query.py - Reply sender
app/agent/replies/messenger.py
Models and integrations
- Model factory
app/models/factory.py - Model interfaces
app/models/base.py
Persistence and state
- Postgres database
app/db/models.py - Data deletion
app/agent/deletion_requests.py - Conversation memory
app/memory/conversation.py
Other components
- Instagram user
- Meta Messaging API
- Model providers
- Redis
Connections 30
- Instagram user → Meta Messaging API: sends saves
- Meta Messaging API → Webhook handler: delivers events
- Webhook handler → Instagram adapter: parses payload
app/api/webhooks.py - Webhook handler → Ingestion service: forwards events
app/api/webhooks.py - Ingestion service → Postgres database: stores captures
app/ingestion/service.py - Ingestion service → Ingestion state: saves payloads
app/ingestion/service.py - Ingestion service → Job queue: queues work
app/ingestion/service.py - Job queue → Pipeline worker: dispatches jobs
app/pipeline/worker.py - Pipeline worker → Item indexer: runs indexing
app/pipeline/worker.py - Item indexer → Extraction steps: runs steps
- Item indexer → Media storage and tools: stores media
- Item indexer → Open vocabulary: normalizes values
- Item indexer → Content type registry: uses schemas
- Pipeline worker → Postgres database: persists indexing
- Instagram user → Meta Messaging API: sends questions
- Webhook handler → Agent worker: routes chat
- Agent worker → Chat agent and tools: dispatches chat
app/agent/worker.py - Chat agent and tools → Hybrid retrieval: searches saves
app/agent/tools.py - Hybrid retrieval → Search planning: plans query
app/agent/search/retrieval.py - Hybrid retrieval → Postgres database: reads saves
app/agent/search/retrieval.py - Agent worker → Reply sender: sends replies
app/agent/worker.py - Reply sender → Meta Messaging API: delivers reply
- Pipeline worker → Model factory: builds clients
app/pipeline/worker.py - Model factory → Model interfaces: implements roles
app/models/factory.py - Model factory → Model providers: calls models
- Chat agent and tools → Model factory: uses models
- Ingestion state → Redis: stores state
- Agent worker → Conversation memory: uses memory
app/agent/worker.py - Data deletion → Postgres database: deletes user data
app/agent/deletion_requests.py - Data deletion → Media storage and tools: erases media