is an all-in-one embeddings database for semantic search, LLM orchestration and language model workflows.
txtai 8.0 was recently released and added the ability to run agents. Agents automatically create workflows to answer multi-faceted user requests.
Agents connect a series of tools with a reasoning engine (i.e. LLM). We're giving the agent a degree of latitude to go through it's own internal logic to address a user's request.
This is a huge paradigm shift. We're talking about handing over control to a program and hoping it makes the right decisions itself. Perhaps there are some parallels to sending your kid to college - we hope we've raised them the right way to be able to make smart decisions 😂.
This article will focus on examples that give agents autonomy to address requests. With this, we can start to the see the path ahead towards more and more automation of tasks.
Install dependencies
Install txtai and all dependencies.
CODE
pip install txtai[graph] autoawq
Let's get creative
In the first example, we'll define an agent that has access to the
💥 Interesting indeed. The fundamental concept of search is we need to know what to look for. In this case, we didn't have that (i.e. we're bored 😀).
Let's go to another example. This time we'll look at the . So while all of the examples have been using Llama 3.1 8B, other LLMs local and remote are supported (i.e. OpenAI, AWS Bedrock, Anthropic). To change it up, we'll use one of the
Last Week in Medical AI: Top Research Papers/Models (September 1 - September 7, 2024)
Outperforms industry giants like GPT-4, Gemini, Meditron-70B, Med-PaLM-1, and Med-PaLM-2 in the biomedical domain.
Last Week in Medical AI: Top Research Papers/Models (October 5 - October 12, 2024)
Introduces MMedAgent: Learning to Use Medical Tools with Multi-modal Agent.
🚀 Once again, very interesting! This time we asked the agent to go read about a topic and report back. The agent did that and left us with links to explore further.
Autonomous Embeddings
For our last example, we're going to give an agent free rein to control an embeddings database.
First, we will create an empty embeddings database and tell the agent how to add and search for data.
Next, we'll define a workflow process. This creates the rules we want the agent to follow. Then we'll run two requests.
CODE
prompt="""
Run the following process:
1. Search your internal knowledge for {topic}
2. If not found, find relevant urls and insert those as a list of strings ONLY. Then rerun the search for {topic}.
3. Write a detailed report about {topic} with Markdown sections covering the major topics. Include a section with hyperlink references. """
Run the following process:
1. Search your internal knowledge for txtai
2. If not found, find relevant urls and insert those as a list of strings ONLY. Then rerun the search for txtai.
3. Write a detailed report about txtai with Markdown sections covering the major topics. Include a section with hyperlink references.
=== Agent thoughts:
Thought: First, I will attempt to search for "txtai" in my internal knowledge base.
>>> Calling tool: 'search' with arguments: {'query': 'txtai'}
=== Agent thoughts:
Thought: Since the search for "txtai" did not yield any results, I will proceed to find relevant URLs and insert them as a list of strings.
>>> Calling tool: 'web_search' with arguments: {'query': 'txtai'}
=== Agent thoughts:
Thought: Now that I have found relevant URLs, I will insert them into the database as a list of strings.
>>> Calling tool: 'insert' with arguments: {'elements': ['https://github.com/neuml/txtai', 'https://pypi.org/project/txtai/', 'https://neuml.github.io/txtai/', 'https://neuml.com/', 'https://medium.com/neuml/introducing-txtai-the-all-in-one-embeddings-database-c721f4ff91ad', 'https://neuml.github.io/txtai/embeddings/', 'https://neuml.github.io/txtai/examples/']}
=== Agent thoughts:
Thought: Now that the relevant URLs have been inserted, I will rerun the search for "txtai".
>>> Calling tool: 'search' with arguments: {'query': 'txtai'}
=== Agent thoughts:
>>> Calling tool: 'final_answer' with arguments: {'answer': '# txtai Overview\n\ntxtai is an all-in-one open-source embeddings database designed for semantic search, LLM orchestration, and language model workflows. It combines vector indexes (both sparse and dense), graph networks, and relational databases to offer a comprehensive solution for various tasks.\n\n## Semantic Search\n\ntxtai supports semantic search, enabling users to find relevant information based on the meaning of the text rather than just keywords. This makes it suitable for applications such as recommendation systems, content retrieval, and more.\n\n## LLM Orchestration\n\ntxtai includes support for Large Language Models (LLMs) orchestration, which allows users to integrate and manage different LLMs within their workflows. This feature is particularly useful for tasks such as prompt chaining, summarization, transcription, translation, and more.\n\n## Embeddings Databases\n\ntxtai provides a unified interface for embedding, indexing, searching, and processing text and multimedia data. Users can create, index, and search embeddings using code snippets and examples provided in the documentation.\n\n## Hyperlink References\n\n- [txtai on GitHub](https://github.com/neuml/txtai)\n- [PyPI - txtai](https://pypi.org/project/txtai/)\n- [txtai Documentation](https://neuml.github.io/txtai/)\n- [txtai Examples](https://neuml.github.io/txtai/examples/)\n- [txtai Embeddings](https://neuml.github.io/txtai/embeddings/)'}
[Output shown below]
txtai Overview
txtai is an all-in-one open-source embeddings database designed for semantic search, LLM orchestration, and language model workflows. It combines vector indexes (both sparse and dense), graph networks, and relational databases to offer a comprehensive solution for various tasks.
Semantic Search
txtai supports semantic search, enabling users to find relevant information based on the meaning of the text rather than just keywords. This makes it suitable for applications such as recommendation systems, content retrieval, and more.
LLM Orchestration
txtai includes support for Large Language Models (LLMs) orchestration, which allows users to integrate and manage different LLMs within their workflows. This feature is particularly useful for tasks such as prompt chaining, summarization, transcription, translation, and more.
Embeddings Databases
txtai provides a unified interface for embedding, indexing, searching, and processing text and multimedia data. Users can create, index, and search embeddings using code snippets and examples provided in the documentation.
Hyperlink References
🔥 Amazing.
Remember, we started with an empty embeddings database. Then we gave basic instructions on how to use the available tools. From there, the agent autonomously operated and answered user requests. The agent also stored what it learned for future requests. This gave the agent it's own internal memory.
Of course, we could program a process that implements this workflow. But think about the productivity gains we're opening up to so many more people. We're enabling people to control a process simply by pairing a set of tools with a description of what they want, in English.
Exciting times!
Wrapping up
This article demonstrated ways to run agents in a more autonomous fashion. While the technology isn't perfect, we can certainly see the path ahead where new models will continue to do a better job. With the right agents and targeted tools, much can be done now though.
Think about the differences between now and 6-12 months ago. Where will we be in another 6-12 months!
Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
SOCIAL SHARE CARD GENERATOR