The Agent Config
microservice is responsible for managing agents, their configurations, and tools. It serves as an intermediary for the Converse
microservice, providing necessary agent context and tools for communication with AI systems like OpenAI or Amazon Bedrock.
Puedes encontrar la colección completa de Postman con todos los endpoints aquí: Colección Postman
- Construir la imagen Docker (incluye la compilación):
docker build -t agent-config-ms .
- Ejecutar el contenedor:
docker run -p 8080:8080 agent-config-ms
- Para detener el contenedor:
docker stop $(docker ps -q --filter ancestor=agent-config-ms)
El servicio estará disponible en http://localhost:8080
Si prefieres construir y ejecutar localmente sin Docker:
./gradlew clean build
./gradlew run
This microservice is written in Kotlin and uses PostgreSQL as its database. It has three main tables:
- agent_configs: Stores the configuration details of each agent.
- tools: Stores the details of various tools.
- agent_tool: Represents the relationship between agents and their tools.
- Agent Configuration Management: Create and manage agent configurations.
- Tool Management: Add, associate, and remove tools for agents.
- Agent Retrieval:
- Retrieve an agent by its
agent_id
. - Retrieve an agent by query similarity via a separate microservice called
Vector DB
.
- Retrieve an agent by its
Endpoint:
POST /api/ms/agent/config
Request Headers:
Content-Type: application/json
Request Body:
{
"agent_id": "mi_primer_agente",
"preferences": {
"example_response": "dasdasdas"
}
}
Description: Creates a new agent configuration.
Endpoint:
POST /api/ms/agent/tool
Request Headers:
Content-Type: application/json
Request Body:
{
"name": "mi_primera_herramienta",
"description": "Descripción de la herramienta",
"type": "Tipo de la herramienta",
"config": {"xasxa": "xaaz"}
}
Description: Creates a new tool.
Endpoint:
POST /api/ms/agent/config/{agent_id}/tools/{tool_name}
Description: Associates an existing tool with a specific agent.
Example:
curl --location --request POST 'http://localhost:8080/api/ms/agent/config/mi_primer_agente/tools/mi_primera_herramienta'
Endpoint:
DELETE /api/ms/agent/config/{agent_id}/tools/{tool_name}
Description: Removes the association between a tool and an agent.
Example:
curl --location --request DELETE 'http://localhost:8080/api/ms/agent/config/mi_primer_agente/tools/mi_primera_herramienta'
Description:
To retrieve an agent by query similarity, the Agent Config
microservice communicates with the Vector DB
microservice. This external microservice handles the similarity search and returns the most relevant agent.
- Programming Language: Kotlin
- Database: PostgreSQL
- API Framework: Micronaut
- Containerization: Docker
- Clone the repository.
- Ensure PostgreSQL is installed and running.
- Update the database configuration in the application properties.
- Run the application using:
./gradlew run
- Make sure the
Vector DB
microservice is up and running to use the query similarity feature. - Customize the database schema and table names as needed.
- Add more detailed logging.
- Enhance security features such as authentication and authorization.
- Implement rate limiting for API endpoints.