The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.
Python agentic-memoryagentic-memory-systemagentsaiai-agentschatgptgenaillmlong-term-memorymemorymemory-managementpythonragstate-management
Add docs for slack and add missing datatype (#1023)
Sidharth Mohantybee4e834b16b
diff --git a/docs/components/data-sources/slack.mdx b/docs/components/data-sources/slack.mdxindex 1285f5335..f899fdd20 100644--- a/docs/components/data-sources/slack.mdx+++ b/docs/components/data-sources/slack.mdx@@ -9,15 +9,33 @@ title: '🤖 Slack'- Make sure your slack user token includes [search](https://api.slack.com/scopes/search:read) scope.## Example++### Get Started++This will automatically retrieve data from the workspace associated with the user's token.++```python+import os+from embedchain import Pipeline as App++os.environ["SLACK_USER_TOKEN"] = "xoxp-xxx"+app = App()++app.add("in:general", data_type="slack")++result = app.query("what are the messages in general channel?")++print(result)+```+++### Customize your SlackLoader1. Setup the Slack loader by configuring the Slack Webclient.```Pythonfrom embedchain.loaders.slack import SlackLoaderos.environ["SLACK_USER_TOKEN"] = "xoxp-*"-loader = SlackLoader()--"""config = {'base_url': slack_app_url,'headers': web_headers,@@ -25,7 +43,6 @@ config = {}loader = SlackLoader(config)-"""```NOTE: you can also pass the `config` with `base_url`, `headers`, `team_id` to setup your SlackLoader.diff --git a/embedchain/data_formatter/data_formatter.py b/embedchain/data_formatter/data_formatter.pyindex 0187bc409..6d3ce57eb 100644--- a/embedchain/data_formatter/data_formatter.py+++ b/embedchain/data_formatter/data_formatter.py@@ -75,6 +75,7 @@ class DataFormatter(JSONSerializable):DataType.RSSFEED: "embedchain.loaders.rss_feed.RSSFeedLoader",DataType.BEEHIIV: "embedchain.loaders.beehiiv.BeehiivLoader",DataType.DIRECTORY: "embedchain.loaders.directory_loader.DirectoryLoader",+ DataType.SLACK: "embedchain.loaders.slack.SlackLoader",}if data_type == DataType.CUSTOM or loader is not None:@@ -118,6 +119,7 @@ class DataFormatter(JSONSerializable):DataType.RSSFEED: "embedchain.chunkers.rss_feed.RSSFeedChunker",DataType.BEEHIIV: "embedchain.chunkers.beehiiv.BeehiivChunker",DataType.DIRECTORY: "embedchain.chunkers.common_chunker.CommonChunker",+ DataType.SLACK: "embedchain.chunkers.common_chunker.CommonChunker",}if chunker is not None:diff --git a/embedchain/models/data_type.py b/embedchain/models/data_type.pyindex 3b4ce6a09..93ed71f46 100644--- a/embedchain/models/data_type.py+++ b/embedchain/models/data_type.py@@ -36,6 +36,7 @@ class IndirectDataType(Enum):RSSFEED = "rss_feed"BEEHIIV = "beehiiv"DIRECTORY = "directory"+ SLACK = "slack"class SpecialDataType(Enum):@@ -71,3 +72,4 @@ class DataType(Enum):RSSFEED = IndirectDataType.RSSFEED.valueBEEHIIV = IndirectDataType.BEEHIIV.valueDIRECTORY = IndirectDataType.DIRECTORY.value+ SLACK = IndirectDataType.SLACK.value