A project for versatile AI agents that can run with proprietary models or completely open-source. The meta expert has two agents: a basic Meta Agent, and Jar3d, a more sophisticated and versatile agent.
- Core Concepts
- Prerequisites
- Repository Setup
- API Key Configuration
- Basic Meta Agent Setup
- Jar3d Setup
- Working with Ollama
- On the Roadmap for Jar3d
This project leverages three core concepts:
- Meta prompting: For more information, refer to the paper on Meta-Prompting (source). Read our notes on Meta-Prompting Overview for a more concise overview.
- Chain of Reasoning: For Jar3d, we also leverage an adaptation of Chain-of-Reasoning
- Jar3d uses retrieval augmented generation, which isn't used within the Basic Meta Agent. Read our notes on Overview of Agentic RAG.
-
Install Anaconda:
Download Anaconda from https://www.anaconda.com/. -
Create a Virtual Environment:
conda create -n agent_env python=3.11 pip
-
Activate the Virtual Environment:
conda activate agent_env
-
Clone the Repository:
git clone https://github.com/brainqub3/meta_expert.git
-
Navigate to the Repository:
cd /path/to/your-repo/meta_expert
-
Install Requirements:
pip install -r requirements.txt
-
Open the
config.yaml
file:nano config.yaml
-
Enter API Keys:
- Serper API Key: Get it from https://serper.dev/
- OpenAI API Key: Get it from https://openai.com/
- Gemini API Key: Get it from https://ai.google.dev/gemini-api
- Claude API Key: Get it from https://docs.anthropic.com/en/api/getting-started
- Groq API Key: Get it from https://console.groq.com/keys
The basic meta agent is an early iteration of the project. It demonstrates meta prompting rather than being a useful tool for research. It uses a naive approach of scraping the entirety of a web page and feeding that into the context of the meta agent, who either continues the task or delivers a final answer.
python -m agents.meta_agent
Then enter your query.
Jar3d is a more sophisticated agent that uses RAG, Chain-of-Reasoning, and Meta-Prompting to complete long-running research tasks.
Note: Currently, th best results are with Claude 3.5 Sonnet and Llama 3.1 70B. Results with GPT-4o are inconsistent
Try Jar3d with:
- Writing a newsletter - Example
- Writing a literature review
- As a holiday assistant
Jar3d is in active development, and its capabilities are expected to improve with better models. Feedback is greatly appreciated.
Jar3d is capable of running 100% locally. However, the setup itself is non-trivial. There are two components to set up:
- The nlm-ingestor server
- Running the application
Running Jar3d requires you to set up your own backend server to run the document parsing. We leverage the nlm-ingestor and llm-sherpa from NLMatics to do this.
The nlm-ingestor uses a modified version of Apache Tika for parsing documents. The server will be deployed locally on whatever machine you run the Docker image.
The server provides an easy way to parse and intelligently chunk a variety of documents including "HTML", "PDF", "Markdown", and "Text". There is an option to turn on OCR; check out the docs.
-
Ensure you have Docker installed on your machine. Once installed, ensure you have started the Docker daemon.
-
Next, pull the Docker image from nlmatics:
docker pull jamesmtc/nlm-ingestor:latest
Note this version of the docker image is unofficial, it is being used as a stop-gap until the library authors fix bugs in the official version
-
Once you have pulled the image, you can run the container:
docker run -p 5010:5001 jamesmtc/nlm-ingestor:latest
-
Navigate to
config/config.yaml
and check that theLLM_SHERPA_SERVER
variable is exactly like this:http://localhost:5010/api/parseDocument?renderFormat=all
Note: You can change the port mapping from 5010 to whatever mapping you want. You must ensure that it is consistent with the mapping you select in the
docker run
command. -
Once you're ready, you can kickstart the Jar3d web-app by running the following from the meta_expert directory.
chainlit run chat.py
Note that you will need to ensure that you uncomment the relevant agent_kwargs in the chat.py script
-
There is a CLI version of Jar3d you can run if you would prefer to. Simply run the following command from the meta_expert directory.
python -m agents.jar3d
Note that you will need to ensure that you uncomment the relevant agent_kwargs in the jar3d.py script
Once you're setup, Jar3d will proceed to introduce itself and ask some questions. The questions are designed to help you refine your requirements. When you feel you have provided all the relevant information to Jar3d, you can end the questioning part of the workflow play typing /end
.
-
Download Ollama: Download from https://ollama.com/download
-
Download an Ollama Model:
curl http://localhost:11434/api/pull -d "{\"name\": \"llama3\"}"
For more information, refer to the Ollama API documentation.
- Feedback to Jar3d so that final responses can be iterated on and amended.
- Long term memory.
- Frontend.
- Integrations to RAG platforms for more intelligent document processing and faster RAG.