Algoherence: A Leap Towards Accessible Financial Literacy
Use of Cohere API
We used Cohere's Chat API to create agents through Langchain. When users send a message, Cohere's LLM helps us decide which tool to use. One of our tools used Cohere's RAG which searched the internet to get information. Using agents and Cohere, we were able to make a multi-function chatbot.
In creating Algoherence, we harnessed the power of Cohere's API alongside Langchain in a way that's truly groundbreaking for our financial chatbot. This innovative pairing allowed us to craft an Agent with a deep understanding of finance, capable of engaging users in meaningful conversations about the stock market, investments, and much more. The agent has access to tools including buy stock, sell a stock, mean reversion emulation, as well as RAG, which ensures that users' queries can be reasoned with evidence-backed responses to prevent hallucination but also fetch relevant information for mean reversion algorithm to be used when evaluating stocks.
The high level of intelligence that Cohere Chat API presents allows the users to interact with the model in very natural languages while fetching the desired information that doesn't have to be hard coded. The process of making Cohere Chat API an Agent was a very fruitful exploration where we tuned temperature and tried different command models, including nightly and lightly. After learning about ReAct and Structured Prompt, we were finally able to make the Cohere Chat API act as an agent, which is an approach that is not present in the current langchain or cohere community. We are confident that this is an innovative and technologically sophisticated project that is both useful to underprivileged people and provides a pleasant user interface.
Inspiration
In a world where financial literacy is a gateway to empowerment but remains inaccessible to many, our project, Algoherence, emerges as a beacon of hope. Our journey began with a simple yet powerful vision: to democratize access to advanced financial instruments and trading knowledge. Recognizing the barriers of complexity and resource scarcity faced by the underprivileged, we embarked on creating a tool that speaks the universal language of accessibility. Algoherence is the culmination of this vision, a stock trading chatbot designed to bridge the gap between complex financial products and those who stand to benefit from them the most.
Utilizing a robust tech stack comprising Python, Langchain, the Alpaca API, Cohere API, and Streamlit, we've crafted a solution that leverages the power of natural language processing to make financial literacy a reality for everyone. Algoherence is not just a tool; it's a movement towards inclusivity in financial education.
What it does
Algoherence is your financial ally, empowering you to navigate the world of stocks with ease and confidence. Through a simple conversational interface, users can engage in a variety of financial activities, including buying and selling stocks, accessing rich analytical insights through the Mean Reversion algorithm, and obtaining reliable financial advice backed by the Retrieval-Augmented Generation (RAG) technology. Whether you're executing trades on the Alpaca paper trading platform or seeking wisdom on your next financial move, Algoherence ensures accuracy, reliability, and simplicity at every step.
How we built it
Our journey to build Algoherence was fueled by innovation and collaboration. At its core, the project leverages Langchain and Cohere API to breathe life into our agent, crafted meticulously in Python. The RAG component, powered by Cohere RAG and Langchain's Cohere RAG retriever API, stands as a testament to our commitment to reliable and informed financial guidance. The user experience, designed with Streamlit, ensures a seamless interaction that bridges the complexity of backend processes with the simplicity needed for widespread accessibility. Our structured agent, inspired by the ReAct cycle logic, mirrors the human process of thought, observation, and action, bringing a touch of humanity to the digital realm.
We used Streamlit to create the front-end chatbot. We containerized our app using Docker through GitHub Actions and hosted it on Azure using Container Apps. By routing our domain to Azure, we were able to route traffic to our app along with a certificate for HTTPS.
Challenges we ran into
Our journey was not without its hurdles. The creation of Algoherence demanded an intricate balance of promo engineering and fine-tuning, a challenge compounded by the need to navigate through a myriad of models, prompting structures, and integrations. The fusion of the backend's complex logic with Streamlit's frontend posed significant challenges, pushing us to rethink how we preserve the agent's thought process in a user-friendly interface. Despite these obstacles, our dedication to innovation and accessibility remained unwavering.
Accomplishments that we're proud of
Standing at the forefront of technological innovation, we take immense pride in being pioneers in utilizing Cohere's command model to build a functional agent. Our journey through the labyrinth of agent-based development has not only yielded Algoherence but has also laid the groundwork for future explorations in this domain. The knowledge and experience gained through this project have opened new horizons for us and the broader community engaged in creating accessible financial technologies.
What we learned
The development of Algoherence has been a profound learning experience, providing us with invaluable insights into the mechanics of agents and the intricacies of prompting engineering. Delving deep into the functionalities offered by Langchain, we've gained a comprehensive understanding of the ReAct cycle, equipping us with the knowledge to navigate and innovate within the realm of agent-based solutions.
What's next for Algoherence
Looking ahead, we envision Algoherence evolving into an even more powerful tool, one that not only enhances its current capabilities but also introduces personalized trading algorithms tailored to individual user preferences and history. Our commitment to reducing the frequency of hallucinated outputs and improving consistency marks the next chapter in our journey. Algoherence stands as a testament to our belief in the transformative power of technology to make financial literacy accessible to all, and we are excited to continue pushing the boundaries of what is possible.
Join us in shaping the future of financial education, where accessibility, empowerment, and innovation converge to create a world where everyone has the opportunity to thrive financially. Algoherence is not just a project; it's a step towards a more inclusive and financially literate world.
Built With
- alpaca
- cohere
- langchain
- python
- streamlit




Log in or sign up for Devpost to join the conversation.