{"id":26345769,"url":"https://github.com/anqorithm/api-documentation-ai-assistant","last_synced_at":"2025-03-16T06:20:14.019Z","repository":{"id":281634259,"uuid":"945888402","full_name":"anqorithm/api-documentation-ai-assistant","owner":"anqorithm","description":"An AI-powered assistant for API documentation that helps users understand and interact with API specifications.","archived":false,"fork":false,"pushed_at":"2025-03-10T09:55:51.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T10:37:21.406Z","etag":null,"topics":["ai","api","documentation","query","swagger"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anqorithm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-10T09:34:04.000Z","updated_at":"2025-03-10T09:57:06.000Z","dependencies_parsed_at":"2025-03-10T10:37:24.318Z","dependency_job_id":"7adc7386-1c1f-406f-8153-360577958a05","html_url":"https://github.com/anqorithm/api-documentation-ai-assistant","commit_stats":null,"previous_names":["anqorithm/swagger-ai-agent"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anqorithm%2Fapi-documentation-ai-assistant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anqorithm%2Fapi-documentation-ai-assistant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anqorithm%2Fapi-documentation-ai-assistant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anqorithm%2Fapi-documentation-ai-assistant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anqorithm","download_url":"https://codeload.github.com/anqorithm/api-documentation-ai-assistant/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243832255,"owners_count":20355074,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","api","documentation","query","swagger"],"created_at":"2025-03-16T06:20:13.438Z","updated_at":"2025-03-16T06:20:13.981Z","avatar_url":"https://github.com/anqorithm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API Documentation AI Assistant\n\nAn AI-powered assistant for API documentation that helps users understand and interact with API specifications.\n\n## Features\n\n- Upload and parse OpenAPI/Swagger specifications\n- Query specific endpoint details\n- Ask natural language questions about the API\n- AI-powered responses using OpenAI\n\n## Project Structure\n\n```\napi-documentation-ai-assistant/\n├── .env                  # Environment variables\n├── .gitignore            # Git ignore file\n├── src/                  # Source code\n│   ├── __init__.py       # Package initialization\n│   ├── config.py         # Configuration settings\n│   ├── main.py           # FastAPI application and routes\n│   ├── models.py         # Pydantic data models\n│   └── services.py       # Service implementations\n├── docker-compose.yml    # Docker Compose configuration\n├── Dockerfile            # Docker configuration\n├── LICENSE               # MIT License\n├── pyproject.toml        # Poetry dependency management\n└── README.md             # This file\n```\n\n## Installation\n\n### Prerequisites\n\n- Python 3.13+\n- Poetry (for dependency management)\n- Docker and Docker Compose (optional, for containerized deployment)\n\n### Setup\n\n1. Clone the repository:\n\n```bash\ngit clone git@github.com:anqorithm/api-documentation-ai-assistant.git\ncd api-documentation-ai-assistant\n```\n\n2. Install dependencies:\n\n```bash\npoetry install\n```\n\n3. Create a `.env` file in the project root with the following content:\n\n```\nOPENAI_API_KEY=your_openai_api_key_here\n```\n\n## Running the Application\n\n### Using Poetry\n\nStart the application:\n\n```bash\npoetry run uvicorn src.main:app --host 0.0.0.0 --port 8080 --reload\n```\n\nThe API will be available at http://localhost:8080\n\n### Using Docker\n\nBuild and run using Docker:\n\n```bash\n# Build the Docker image\ndocker build -t api-documentation-ai-assistant .\n\n# Run the container\ndocker run -p 8080:8080 -e OPENAI_API_KEY=your_openai_api_key_here api-documentation-ai-assistant\n```\n\n### Using Docker Compose\n\nRun with Docker Compose:\n\n```bash\n# Set your OpenAI API key in the environment or .env file\nexport OPENAI_API_KEY=your_openai_api_key_here\n\n# Start the service\ndocker-compose up -d\n\n# View logs\ndocker-compose logs -f\n```\n\n#### Docker Compose Features\n\nThe enhanced Docker Compose configuration provides:\n\n- **Health checks** - Automatic monitoring of service health\n- **Resource management** - CPU and memory limits to prevent resource exhaustion\n- **Persistent volumes** - Data persistence across container restarts\n- **Network isolation** - Dedicated bridge network for security\n- **Environment configuration** - Support for .env files and variable defaults\n- **Robust restart policy** - Automatic service recovery\n\nTo check the service health:\n\n```bash\ndocker-compose ps\n```\n\nTo stop the service:\n\n```bash\ndocker-compose down\n```\n\nTo stop the service and remove volumes:\n\n```bash\ndocker-compose down -v\n```\n\n## API Endpoints\n\n### Upload API Specification\n\n```\nPOST /v1/specifications\n```\n\nUpload an OpenAPI/Swagger JSON file.\n\n**Example:**\n```bash\ncurl -X 'POST' \\\n  'http://localhost:8080/v1/specifications' \\\n  -H 'accept: application/json' \\\n  -F 'file=@path/to/your/swagger.json'\n```\n\n### Query Endpoint Details\n\n```\nGET /v1/endpoints/{endpoint_path}\n```\n\nGet detailed information about a specific API endpoint.\n\n**Example:**\n```bash\ncurl -X 'GET' \\\n  'http://localhost:8080/v1/endpoints/users' \\\n  -H 'accept: application/json'\n```\n\n### Ask the AI Assistant\n\n```\nPOST /v1/assistant/query\n```\n\nAsk a natural language question about the API.\n\n**Example:**\n```bash\ncurl -X 'POST' \\\n  'http://localhost:8080/v1/assistant/query' \\\n  -H 'accept: application/json' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n  \"question\": \"What endpoints are available for user management?\"\n}'\n```\n\n### Health Check\n\n```\nGET /v1/health\n```\n\n**Example:**\n```bash\ncurl -X 'GET' \\\n  'http://localhost:8080/v1/health' \\\n  -H 'accept: application/json'\n```\n\n## Implementation Details\n\n- Built with FastAPI for high-performance API endpoints\n- Pydantic for data validation and settings management\n- Langchain integration for AI-powered responses\n- OpenAI's language models for natural language understanding\n\n## Development\n\nTo run tests:\n\n```bash\npytest\n```\n\n## License\n\n[MIT License](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanqorithm%2Fapi-documentation-ai-assistant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanqorithm%2Fapi-documentation-ai-assistant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanqorithm%2Fapi-documentation-ai-assistant/lists"}