fastapi-chat-skill

Provide a FastAPI chat backend with conversation persistence and MCP tool orchestration.

Updated Dec 31, 2025
One-click install
npx skills add https://github.com/Aqsagull99/hackathon-2-todo-app --skill fastapi-chat-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fastapi-chat-skill
Source: https://github.com/Aqsagull99/hackathon-2-todo-app/tree/main/.claude/skills/fastapi-chat-skill
Command: npx skills add https://github.com/Aqsagull99/hackathon-2-todo-app --skill fastapi-chat-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a production-ready FastAPI backend to handle AI-powered chat conversations, persist conversations, and orchestrate MCP tool execution for Todo-style chatbots.

Core Features & Use Cases

  • Chat Endpoint: Stateless API to process user messages and return AI responses with optional tool calls.
  • Request/Response Models: Clear schemas for chat requests and structured responses including tool call logs.
  • Database Models: Lightweight persistence for conversations and messages enabling history-aware interactions.
  • Chat Service: Orchestrates conversation lifecycle, history retrieval, and agent execution.
  • Agent Integration: Integrates OpenAI Agents SDK to drive task automation via MCP tools, returning tool results and final responses.

Quick Start

Install dependencies and start the FastAPI server. For example, install the package, set OPENAI_API_KEY, and run the app with Uvicorn:

  • Install dependencies: pip install -e .
  • Set environment variables: OPENAI_API_KEY, OPENAI_MODEL, DATABASE_URL
  • Run the app: uvicorn app.main:app --reload You can then access API docs at http://localhost:8000/docs

Frequently Asked Questions about fastapi-chat-skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a FastAPI backend for AI chat conversations with tool orchestration?

You can build a FastAPI AI chat backend by deploying a stateless chat endpoint that orchestrates MCP tool execution and persists conversation history. This approach integrates the OpenAI Agents SDK to drive task automation.

How do I persist chat history in a FastAPI application?

Persist chat history in FastAPI by utilizing lightweight database models for conversations and messages. This enables history-aware interactions by retrieving past context during the chat service orchestration.

Can I use MCP tools with OpenAI Agents SDK in a FastAPI server?

Yes, you can use MCP tools with the OpenAI Agents SDK within a FastAPI server. The chat service orchestrates agent execution, returning both tool call logs and the final AI responses.

How do I set up a production-ready FastAPI chat backend?

Set up a production-ready FastAPI chat backend by installing dependencies, setting environment variables like OPENAI_API_KEY and DATABASE_URL, and running the Uvicorn server to access API docs.

Do I need an OpenAI API key to run a FastAPI chat backend?

Yes, you need an OpenAI API key to run this FastAPI chat backend. You must set the OPENAI_API_KEY and OPENAI_MODEL environment variables to enable agent execution and AI conversation processing.

What is the best way to structure request and response models for an AI chat API?

Structure AI chat API models by defining clear schemas for chat requests and structured responses. This ensures consistent processing of user messages and includes optional tool call logs in the output.