{"id":31618037,"url":"https://github.com/klhenams/silver-computing-machine","last_synced_at":"2025-10-06T13:45:12.586Z","repository":{"id":317835192,"uuid":"1069030145","full_name":"klhenams/silver-computing-machine","owner":"klhenams","description":"Senamatic search using vector databases","archived":false,"fork":false,"pushed_at":"2025-10-03T09:50:04.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-03T11:40:02.721Z","etag":null,"topics":["docker","docker-compose","embeddings","fastapi","llms","pgvec","pgvector","python-3","vector-search"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/klhenams.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-03T09:42:40.000Z","updated_at":"2025-10-03T09:49:06.000Z","dependencies_parsed_at":"2025-10-03T11:40:06.526Z","dependency_job_id":null,"html_url":"https://github.com/klhenams/silver-computing-machine","commit_stats":null,"previous_names":["klhenams/silver-computing-machine"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/klhenams/silver-computing-machine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klhenams%2Fsilver-computing-machine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klhenams%2Fsilver-computing-machine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klhenams%2Fsilver-computing-machine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klhenams%2Fsilver-computing-machine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/klhenams","download_url":"https://codeload.github.com/klhenams/silver-computing-machine/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klhenams%2Fsilver-computing-machine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278621844,"owners_count":26017253,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["docker","docker-compose","embeddings","fastapi","llms","pgvec","pgvector","python-3","vector-search"],"created_at":"2025-10-06T13:45:08.195Z","updated_at":"2025-10-06T13:45:12.580Z","avatar_url":"https://github.com/klhenams.png","language":"Python","readme":"# Support System API\n\nA modern support system that combines REST APIs with Large Language Models (LLMs) and vector databases to deliver context-aware answers from company documentation, tickets, and FAQs.\n\n## Features\n\n- 🤖 **AI-Powered Responses**: Uses Hugging Face LLMs for intelligent query processing\n- 🔍 **Vector Search**: Semantic search using pgvector for finding relevant content\n- 📚 **Multi-Source Knowledge**: Combines documents, FAQs, and tickets for comprehensive answers\n- 🏗️ **Clean Architecture**: Domain-driven design with clear separation of concerns\n- 🐳 **Containerized**: Docker and Docker Compose for easy deployment\n- 📊 **Analytics**: Query analytics and feedback tracking\n- 🔄 **Real-time**: Async FastAPI for high performance\n\n## Tech Stack\n\n- **Framework**: FastAPI (Python)\n- **Database**: PostgreSQL with pgvector extension\n- **LLM Provider**: Hugging Face Inference API\n- **Embeddings**: Sentence Transformers\n- **Containerization**: Docker \u0026 Docker Compose\n- **Reverse Proxy**: Nginx\n- **Architecture**: Clean Architecture (Domain, Application, Infrastructure, Presentation)\n\n## Project Structure\n\n```\nsrc/support_system/\n├── domain/                 # Business logic and entities\n│   ├── entities/          # Domain models\n│   ├── repositories/      # Repository interfaces\n│   └── services/          # Domain service interfaces\n├── application/           # Use cases and application logic\n│   ├── dtos/             # Data transfer objects\n│   ├── interfaces/       # Application service interfaces\n│   └── use_cases/        # Business use cases implementation\n├── infrastructure/       # External concerns\n│   ├── database/         # Database models and configuration\n│   ├── external_services/# Hugging Face integration\n│   ├── repositories/     # Repository implementations\n│   ├── config.py         # Configuration management\n│   └── container.py      # Dependency injection\n└── presentation/         # API layer\n    ├── api/              # FastAPI endpoints\n    ├── schemas/          # Request/response schemas\n    └── main.py           # Application entry point\n```\n\n## Quick Start\n\n### Prerequisites\n\n- Docker and Docker Compose\n- Python 3.9+ (for local development)\n- Hugging Face API key (optional, for LLM features)\n\n### 1. Clone and Setup\n\n```bash\ngit clone \u003crepository-url\u003e\ncd special-pancake\ncp .env.example .env\n```\n\n### 2. Configure Environment\n\nEdit `.env` file with your configuration:\n\n```bash\n# Required\nDATABASE_URL=postgresql://postgres:password@localhost:5432/support_system\n\n# Optional - for LLM features\nHUGGINGFACE_API_KEY=your-huggingface-api-key-here\n```\n\n### 3. Start with Docker Compose\n\n```bash\ndocker-compose up -d\n```\n\nThis will start:\n- PostgreSQL with pgvector extension (port 5432)\n- Support System API (port 8000)\n- Nginx reverse proxy (port 80)\n\n### 4. Verify Installation\n\n```bash\ncurl http://localhost/health\n```\n\nExpected response:\n```json\n{\n  \"status\": \"healthy\",\n  \"version\": \"1.0.0\",\n  \"timestamp\": \"2024-01-01T00:00:00Z\"\n}\n```\n\n## API Documentation\n\nOnce the application is running, you can access:\n\n- **API Documentation**: http://localhost/docs (Swagger UI)\n- **Alternative Docs**: http://localhost/redoc (ReDoc)\n- **Health Check**: http://localhost/health\n\n## API Endpoints\n\n### Documents\n- `POST /api/v1/documents/` - Create document\n- `GET /api/v1/documents/{id}` - Get document\n- `GET /api/v1/documents/` - List documents\n- `PUT /api/v1/documents/{id}` - Update document\n- `DELETE /api/v1/documents/{id}` - Delete document\n- `POST /api/v1/documents/search` - Search documents\n\n### FAQs\n- `POST /api/v1/faqs/` - Create FAQ\n- `GET /api/v1/faqs/{id}` - Get FAQ\n- `GET /api/v1/faqs/` - List FAQs\n- `GET /api/v1/faqs/popular/` - Get popular FAQs\n- `PUT /api/v1/faqs/{id}` - Update FAQ\n- `DELETE /api/v1/faqs/{id}` - Delete FAQ\n- `POST /api/v1/faqs/search` - Search FAQs\n- `POST /api/v1/faqs/{id}/helpful` - Mark FAQ as helpful\n\n### Tickets\n- `POST /api/v1/tickets/` - Create ticket\n- `GET /api/v1/tickets/{id}` - Get ticket\n- `GET /api/v1/tickets/` - List tickets\n- `GET /api/v1/tickets/user/{user_id}` - Get user tickets\n- `PUT /api/v1/tickets/{id}` - Update ticket\n- `DELETE /api/v1/tickets/{id}` - Delete ticket\n\n### Queries (AI-Powered)\n- `POST /api/v1/queries/` - Process query with AI\n- `GET /api/v1/queries/{id}` - Get query\n- `GET /api/v1/queries/` - List queries\n- `GET /api/v1/queries/user/{user_id}` - Get user queries\n- `POST /api/v1/queries/{id}/feedback` - Provide feedback\n- `GET /api/v1/queries/analytics/` - Get analytics\n\n## Usage Examples\n\n### Create a Document\n\n```bash\ncurl -X POST \"http://localhost/api/v1/documents/\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"title\": \"Getting Started Guide\",\n    \"content\": \"This guide helps you get started with our platform...\",\n    \"category\": \"tutorials\",\n    \"tags\": [\"beginner\", \"setup\"]\n  }'\n```\n\n### Ask an AI-Powered Query\n\n```bash\ncurl -X POST \"http://localhost/api/v1/queries/\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"query_text\": \"How do I reset my password?\",\n    \"user_id\": \"user123\"\n  }'\n```\n\nThe AI will search through documents, FAQs, and tickets to provide a contextual answer.\n\n### Search Documents\n\n```bash\ncurl -X POST \"http://localhost/api/v1/documents/search\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"query\": \"password reset\",\n    \"limit\": 5,\n    \"category\": \"tutorials\"\n  }'\n```\n\n## Development\n\n### Local Development Setup\n\n```bash\n# Create virtual environment\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n\n# Install dependencies\npip install -r requirements.txt\n\n# Set up database (requires PostgreSQL with pgvector)\nexport DATABASE_URL=postgresql://postgres:password@localhost:5432/support_system\n\n# Run the application\nuvicorn src.support_system.main:app --reload --host 0.0.0.0 --port 8000\n```\n\n### Database Setup\n\nFor local development, you need PostgreSQL with the pgvector extension:\n\n```sql\n-- Connect to PostgreSQL and run:\nCREATE DATABASE support_system;\n\\c support_system;\nCREATE EXTENSION vector;\n```\n\n### Environment Variables\n\nKey environment variables:\n\n- `DATABASE_URL`: PostgreSQL connection string\n- `HUGGINGFACE_API_KEY`: Optional, for LLM features\n- `DEBUG`: Enable debug mode (true/false)\n- `LOG_LEVEL`: Logging level (DEBUG, INFO, WARNING, ERROR)\n\n## Architecture\n\nThis project follows Clean Architecture principles:\n\n1. **Domain Layer**: Core business logic, entities, and interfaces\n2. **Application Layer**: Use cases and application services\n3. **Infrastructure Layer**: External integrations (database, APIs)\n4. **Presentation Layer**: HTTP endpoints and request/response handling\n\n### Key Design Patterns\n\n- **Dependency Injection**: Using a container for loose coupling\n- **Repository Pattern**: Abstracting data access\n- **Service Layer**: Encapsulating business logic\n- **DTO Pattern**: Separating internal models from API contracts\n\n## Production Considerations\n\n### Security\n- Change default passwords and secret keys\n- Use environment variables for sensitive configuration\n- Implement authentication and authorization\n- Set up HTTPS with proper certificates\n- Configure CORS appropriately\n\n### Performance\n- Set up connection pooling for the database\n- Implement caching for frequently accessed data\n- Use CDN for static assets\n- Monitor and optimize query performance\n\n### Monitoring\n- Set up logging aggregation\n- Implement health checks\n- Monitor API metrics and performance\n- Set up alerts for system issues\n\n### Scaling\n- Use horizontal scaling for the API service\n- Implement database read replicas\n- Set up load balancing\n- Consider message queues for async processing\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes following the existing architecture\n4. Add tests for new functionality\n5. Submit a pull request\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Support\n\nFor questions and support, please:\n1. Check the API documentation at `/docs`\n2. Review existing issues and discussions\n3. Create a new issue with detailed information\n\n## Roadmap\n\n- [ ] Authentication and authorization\n- [ ] Rate limiting\n- [ ] Caching layer\n- [ ] Enhanced analytics dashboard\n- [ ] Multi-language support\n- [ ] Advanced search filters\n- [ ] Automated testing suite\n- [ ] Performance monitoring","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklhenams%2Fsilver-computing-machine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fklhenams%2Fsilver-computing-machine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklhenams%2Fsilver-computing-machine/lists"}