RAG + Custom Agents

I already have a RAG application build with elastic search and OpenAI embedddings. I also need to create a custom agent to get the chat with the data over the stardog which we use for knowledge graph. Can these both be in a single runnable/chains or we should split it into two separate applications?

If i can combine both how can i do it?

Thanks in advance :slight_smile: