Back to projects

AI Engineering

Agentic tech-stack recommender

A conversational agent that interviews a team about a project, then recommends a technology stack grounded in a curated knowledge base.

Client work. The code is private, so this page covers the engineering approach only.

Python 3.11FastAPILangGraphLangChainOpenAIFAISSSQLAlchemyAlembicPydanticDocker

Problem

Picking a technology stack for a new solution is usually a conversation between an architect and a team: what is being built, what constraints exist, what the team already knows. A single chatbot prompt does that badly. It answers before it has asked enough, and it invents specifics because a general model has no grounding in the organisation’s own preferred tools and patterns.

The goal here was an assistant that behaves like the architect: it asks structured questions across the dimensions that decide a stack, it holds the answers as state across the conversation, and it grounds its final recommendation in a curated knowledge base, independent of what the base model absorbed during training.

How it works

The service is a FastAPI application built around a LangGraph StateGraph. Conversation state is a typed structure that accumulates the team’s answers as the dialogue progresses, and a MemorySaver checkpointer persists that state so a session can pause and resume without losing context.

The graph runs an assistant node in a loop with a tools node: the assistant decides whether it still needs information or is ready to act, a conditional edge routes to the tools node when a tool call is required, and control returns to the assistant afterward. The flow moves through staged, pillar-based questioning, then summary generation, then the stack recommendation itself.

Recommendations are retrieval-grounded. A knowledge base is chunked with a recursive splitter, embedded with OpenAI embeddings, and indexed into a FAISS vector store built and persisted offline; at recommendation time the agent retrieves the relevant guidance and reasons over it, so the output reflects the curated knowledge. Conversation logs persist to a relational database through SQLAlchemy with Alembic migrations, and external calls are wrapped in an async retry with exponential backoff.

User answers --> FastAPI --> LangGraph StateGraph
   START --> assistant <--> tools (conditional edge)
              |  staged pillar questions -> summary -> recommend
              v
   FAISS retrieval (OpenAI embeddings over curated KB)
              v
   Grounded tech-stack recommendation  (state checkpointed, logs persisted via SQLAlchemy)

Hard parts

  • Holding a multi-turn interview as state: the LangGraph State structure accumulates pillar answers across turns, and the MemorySaver checkpointer lets a conversation resume where it left off, so the agent asks before it answers.
  • Grounding the recommendation: a FAISS vector store over a curated knowledge base is built offline and queried at recommendation time, so each piece of stack advice traces back to the indexed guidance.
  • An assistant-tools loop: a conditional edge routes to tools only when a tool call is needed and returns to the assistant, so the agent gathers information and acts in the same graph.
  • Resilience on external calls: an async retry decorator with exponential backoff wraps model and database operations, and typed error classes separate database failures from workflow failures.
  • Durable conversation history: chat logs persist through SQLAlchemy with Alembic-managed schema, so a session is auditable and recoverable after a restart.

What it does

What it does is concrete even where benchmark numbers are not. It is a working conversational recommender: it asks staged questions across the solution-architecture pillars, grounds its recommendations in a FAISS-indexed knowledge base, checkpoints state so a session can pause and resume, and keeps conversation logs. A FastAPI service wraps it, with a test suite and CI.

Artifacts

A FastAPI service with a LangGraph agent module, a FAISS vector-store builder, SQLAlchemy models with Alembic migrations, a small web UI, and CI configuration. Built for an enterprise engagement, so the source is not public.

Back to projects