DEV Community

Cover image for Building PoC Agents in Minutes
Nghi Danh
Nghi Danh

Posted on • Edited on

Building PoC Agents in Minutes

Last time I attended a manufacturing conference, I noticed that customers were eager for AI innovation in their businesses(They hungry to join the AI Race). They wanted customizable AI solutions that could be implemented immediately in their production chains. That’s why building quick prototypes or Proof of Concepts (PoCs) is exactly what AI engineers(Me) and software developers(Also me) need to focus on right now to my boss what we can do :))

For me, using a framework that Inherited multiple technologies is the key solution. When creating rapid prototypes for AI chatbots or AI agents, I use Parlant—a production-ready engine for AI chat agents that generates aligned responses and follows instructions.

Follow along with this example, and I’ll show you how to build an AI agent in just minutes using Parlant. (As long as you know Python, you’ll be good to go). I know an AI Engineer, it's me, just import Python library and it just run :D).

Also you need an AI Provider API Key (You can register on OpenAI Platform or Anthropic). For this example i will use my own Claude api key. (Put it in .env file)

Anthropic

For context, we will building a simple Travel Concierge name Danh Hoang Hieu Nghi (It's me, i love travel but no money)

if load_dotenv is not None:
    load_dotenv()

anthropic_key: Optional[str] = os.getenv("ANTHROPIC_API_KEY")
nlp_service = (
    p.NLPServices.anthropic if anthropic_key else p.NLPServices.openai
)

async with p.Server(nlp_service=nlp_service) as server:
    agent = await create_travel_concierge_agent(server)
Enter fullscreen mode Exit fullscreen mode

Here the core heart of the Agent, we will create Agent, the condition and the action that the AI will follow (Guideline):

agent = await server.create_agent(
    name="Aurora Concierge",
    description="You are a friendly, detail-oriented travel concierge..."
)

await agent.create_guideline(
    condition="the customer greets you",
    action="Greet warmly... ask for destination, dates, budget, preferences."
)
Enter fullscreen mode Exit fullscreen mode

To handle the whole flow without some infinite loop we will need a fall-back.

agent = await server.create_agent(
    name="Aurora Concierge",
    description="You are a friendly, detail-oriented travel concierge..."
)

await agent.create_guideline(
    condition="the customer greets you",
    action="Greet warmly... ask for destination, dates, budget, preferences."
)
Enter fullscreen mode Exit fullscreen mode

You can customize your own coding my just adding new guideline :

await agent.create_guideline(
    condition="the customer asks for visa requirements",
    action="Summarize typical visa requirements and suggest official sources."
)

Enter fullscreen mode Exit fullscreen mode

After all the coding you just

pip install -r requirements.txt
python main.py

Open your browser and type http://localhost:8800

Enjoy testing :)

Demo_Chat

Full-source code detailed here - read Readme.md: Parlant Example

Check out more about Parlant here, i use some code from these source:

Many more feature to need put on real project here.

Future

A lots of cool knowledge to implementing on AI Agent (Agentic Design Methodology, Custom NLP Models, Tools,..)

You can using this Learn Library here to learn more about Parlant :
https://www.parlant.io/docs/quickstart/motivation

Thank you for your reading, Nghi!!!!

Top comments (0)