A chat-based agent for analyzing Substack RSS feeds using MemMachine as the AI memory layer.
This agent ingests Substack posts, extracts topics using OpenAI, stores them in MemMachine's episodic memory, and provides a question-answering interface with citations.
Status: 🚧 Under active development
- ✅ RSS feed ingestion from Substack
- ✅ Content extraction and cleaning
- ✅ Topic extraction using OpenAI
- ✅ Episodic memory storage via MemMachine REST API
- ✅ Question answering with citations
- ✅ FastAPI REST API
- Python 3.12+
- MemMachine running at
http://localhost:8080(default) - OpenAI API key
git clone https://github.com/trilogy-group/ai-coe-mem.git
cd ai-coe-mem
# Install dependencies
make setup
# Edit .env with your OpenAI API key
nano .envCopy .env.example to .env and configure:
# Application settings
APP_PORT=8088
FEED_URL=https://trilogyai.substack.com
MEM_GROUP_ID=feed:trilogyai
# MemMachine REST API URL
MEMMACHINE_BASE_URL=http://localhost:8080
# OpenAI API Key (required)
OPENAI_API_KEY=sk-your-actual-key-heremake runThe API will be available at http://localhost:8088
curl http://localhost:8088/healthcurl http://localhost:8088/POST /ingest- Ingest posts from RSS feedGET /overview- Get overview of topics and trendsPOST /ask- Ask questions about the feed
ai-coe-mem/
├── app/
│ ├── main.py # FastAPI application
│ ├── settings.py # Configuration
│ ├── mem/ # MemMachine integration
│ ├── ingest/ # RSS ingestion (coming soon)
│ ├── analysis/ # Topic analysis (coming soon)
│ ├── agent/ # Q&A agent (coming soon)
│ └── web/ # API routers (coming soon)
├── tests/ # Test suite
├── requirements.txt # Python dependencies
├── Makefile # Automation commands
└── README.md
make testThis agent uses MemMachine's REST API for memory operations:
- Episodic Memory: Stores full post content with metadata
- Query API: Retrieves relevant posts for answering questions
Key dependencies:
- FastAPI: Web framework
- httpx: HTTP client for MemMachine REST API
- OpenAI: Topic extraction and narrative generation
- feedparser: RSS parsing
- trafilatura: Content extraction
See requirements.txt for complete list.
- Project structure
- MemMachine REST API client
- FastAPI application skeleton
- Configuration management
- Episodic memory integration
- RSS ingestion pipeline
- Topic extraction with OpenAI
- API routers (ingest, overview, ask)
- Q&A agent with citations
Note: This is a work in progress. The core infrastructure is in place, and we're actively implementing the business logic.