How zaidbagawan/ai_project works
This repository is a set of standalone Python experiments rather than one integrated application. Its main user-facing workflows are a Gemini chat loop and semantic document search, implemented in two variants: local cosine ranking and PostgreSQL/pgvector ranking. It also includes a sentence-similarity experiment and a small recent-history example. No README is provided, and the available excerpts do not show these scripts being orchestrated together; the graph therefore treats them as separate entry points.
Main entry points: semantic_search.py Local semantic search · chatbot.py Chat loop · postgres_vector_search.py Vector search CLI · similarity_experiment.py Sentence similarity demo
Components 11
Conversation
- Chat loop
chatbot.py - Recent history slice
history_management.py
Semantic retrieval
- Local semantic search
semantic_search.py - Sample documents
semantic_search.py - Cosine ranking
semantic_search.py - Vector search CLI
postgres_vector_search.py
Similarity examples
- Sentence similarity demo
similarity_experiment.py
Other components
- User
- Gemini interactions
- Gemini embeddings
- PostgreSQL pgvector
Connections 11
- User → Chat loop: enters messages
chatbot.py - Chat loop → Gemini interactions: sends interaction
chatbot.py - Chat loop → User: prints reply
chatbot.py - User → Vector search CLI: enters question
postgres_vector_search.py - Local semantic search → Gemini embeddings: embeds text
semantic_search.py - Local semantic search → PostgreSQL pgvector: inserts documents
semantic_search.py - Local semantic search → Cosine ranking: ranks embeddings
semantic_search.py - Cosine ranking → Local semantic search: returns best match
semantic_search.py - Vector search CLI → Gemini embeddings: embeds question
postgres_vector_search.py - Vector search CLI → PostgreSQL pgvector: queries vectors
postgres_vector_search.py - Sentence similarity demo → Gemini embeddings: embeds sentences
similarity_experiment.py