Code, samples, and a working streamlit app for demonstrating:
- multiagent and human collaboration
- the use of langgraph to coordinate the interaction
- the mating of the langgraph and streamlit state machines (non-trivial)
The agents are prompted to create a newsstory in collaboration with a human(you)from a meeting transcript or minutes which you either provide a URL to or upload. The input agent uploads or downloads the document as appropriate and extracts text from it; the writer agent drafts; the critique agent critiques; you can edit either the draft or the critique. the cycle continues until you are satisfied with a draft at which point it ia giiven to the output agent to display.
This concept could easily be extended to different types of news stories as well as different sources ands could include fact checking, RAG from an archive etc.
I started with meetings because there are many more public meetings than there are reporters to cover them.
langgraphis a library for building stateful, multi-actor applications with LLMs, built on top of (and intended to be used with) LangChain. It is low-code but not no-code.
The depository is set up so that an application can be uploaded to the Streamlit cloud. That has been done and the application is here. The .gitignore and requirements.txt are specific to streamlit cloud.
mm_agent.py in this repository contains the main logic and all of the langchain speciifc code for the application. If you run it as a main program in your own Python environment, it will use tkinter rather than streamlit for UI.
mm_st.py is the main program of the streamlit version and contains all the streamlit specific logic
mytools.py are a few miscellaneous uilities of mine.
mm_tkinter.py contains the tkinter specific code. It is not used in the streamliit version.
Click the URL https://meeting-reporter.streamlit.app/. You will need an OPENAI api key in the paid tier. The free api key will not work because the agents use GPT4.
- clone the repository.
- make any changes you want to make.
- be sure to update .gitignore and requirements.txt as needed.
- deploy from Streamlit (you need an acount, of course).
- download the mm_agent, mytools, and mm_tkinter modules
- Set up a .env file with an entry for OPENAI_API_KEY set equal to your paid OpenAI key or otherwise set an environmental variable with that name
- Run mm_agent.py.
click the URL https://chatgpt.com/g/g-roNR24Ty6-collaborative-meeting-reporter.
- Select a prompt depending on the content of the source
- Incorporate fact checking via browsing
- Include a process for improving the prompts based on frequent critiqes
- add sources and stories to a database (a morgue in news terms)
- use RAG to consult the morgue and get background
- embed in a larger collaborative newsroom process
- acccept audio files for input
- incorporate graphics
pull requests welcome
No code here explititly collects any information of any kind. However, some usage stastics are available from both github and Streamlit.
This all comes with no warranty of any kind nor any promise to fix problems or maintain compatabity with the code it uses. However, bug reports, issues, and enhancement pull requests are welcome.