Welcome to the exciting world of AI with the Elixir LangChain Demo App! This guide will walk you through the steps to set up and run your very own demo application using the Elixir LangChain library and Phoenix LiveView. Think of this as building a cozy little workshop where you can tinker with your very own AI tools. Ready to dive in? Let’s get started!
Step-by-Step Instructions
To kick off your journey, follow these simple steps to bring your Elixir LangChain Demo App to life:
- Run mix setup – This command will install and set up the necessary dependencies for your project.
- Set up your API key – Use the command
export OPENAI_API_KEY=. You can learn how to acquire your key here. - Start the Phoenix server – Use the command
mix phx.serveror launch it inside IEx withiex -S mix phx.server.
Once you have completed these steps, you are all set to visit your app in the browser at localhost:4400.
Engaging in Conversations
Your app includes a dedicated page for conversations powered by ChatGPT. You can find this engaging page at localhost:4004/conversations.
Here are some key features you can enjoy:
- You can cancel ongoing requests, delete messages, and edit/resubmit conversations.
- All conversations are recorded in a SQLite database located in your project directory.
- Experience Elixir LangChain powered conversations.
- Utilize Phoenix LiveView’s Async Operations for real-time interaction.
- Press ctrl+enter to submit a message seamlessly.
Introducing the Personal Fitness AI Agent
The Personal Fitness AI Agent is a remarkable feature that acts as your own fitness coach. Think of it as having a training buddy right in your pocket, always ready to assist! You can access this feature at localhost:4004/agent_chat.
This agent empowers you to create a personalized workout plan, log workout details, and provides insights into your fitness journey. To get started, simply ask your agent, “How do we start?”!
Features of the Personal Fitness AI Agent
Here’s what makes your Personal AI Fitness Trainer so special:
- User data is securely stored in a local SQLite database.
- The AI composes structured information based on your fitness needs.
- Historical logs of your workouts are maintained for future reference.
- Offers a powerful yet straightforward example of integrating AI into your app with Elixir.
For a visual demonstration, you can check out this video on YouTube or read the companion blog post to delve deeper into how this all works.
Troubleshooting Your Setup
Sometimes, technology tries to play tricks on us! Here are some troubleshooting tips to help you handle common issues:
- If the server does not start, ensure that all dependencies installed properly using
mix setup. - Double-check your OPENAI_API_KEY setup to make sure it’s correctly set. A misplaced character could be the culprit!
- If the app doesn’t appear at localhost, make sure you are running the server and check for any error messages in your terminal.
- If you are unable to save conversations, confirm that SQLite is being correctly written to in the specified project directory.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

