Tools for intelligent interaction with knowledge bases
Project description
Athenaeum
Project Scope and Goals
The goal of this project is to build a Python library that equips AI agents with a robust set of tools for intelligent interaction with knowledge bases. The library focuses on document ingestion, semantic search, and structured access to content, making it suitable for agent-based systems, RAG pipelines, and automation workflows.
Once the module is fully tested and validated, the intended outcome is to package and publish it as a reusable Python library on PyPI.
Tools
load_doc
Load a document into the knowledge base, automatically extracting content, metadata, and embeddings.
load_doc(path: str) -> str
Parameters:
path: Path to the document file
Supported formats: PDF, PPTX, DOCX, XLSX, JSON, CSV, TXT, MD, HTML, XML, RTF, EPUB
Returns: A document identifier (doc_id) that can be used for subsequent operations.
list_docs
List all documents currently stored in the knowledge base.
list_docs() -> list[DocSearchHit]
Returns: A list of documents, including metadata (id, name, format, etc.) and, when available, a table of contents.
search_docs
Search across all documents in the knowledge base.
search_docs(
query: str,
top_k: int = 10,
scope: Literal["names", "contents"] = "contents",
strategy: Literal["hybrid", "bm25", "vector"] = "hybrid"
) -> list[DocSearchHit]
Parameters:
query: Search query texttop_k: Maximum number of results (default: 10)scope: Where to search"contents": Search within document contents (default)"names": Search only document names
strategy: Search strategy (only applies when scope is "contents")"hybrid": Combines vector and BM25 search (default)"bm25": Keyword-based search only"vector": Semantic similarity search only
Returns: A ranked list of documents matching the query.
search_doc_contents
Search within a specific document.
search_doc_contents(
doc_id: str,
query: str,
top_k: int = 5,
strategy: Literal["hybrid", "bm25", "vector"] = "hybrid"
) -> list[ContentSearchHit]
Parameters:
doc_id: Document identifierquery: Search query texttop_k: Maximum number of results (default: 5)strategy: Search strategy"hybrid": Combines vector and BM25 search (default)"bm25": Keyword-based search only"vector": Semantic similarity search only
Returns: A list of matching content fragments with relevance scores.
read_doc
Read a specific range of lines from a document.
read_doc(
doc_id: str,
start_line: int = 1,
end_line: int = 100
) -> Excerpt
Parameters:
doc_id: Document identifierstart_line: Starting line number (1-indexed, default: 1)end_line: Ending line number (1-indexed, inclusive, default: 100)
Returns: A document excerpt containing the requested lines.
Search Strategies
- Hybrid Search (Default): Combines vector similarity search with BM25 keyword search using Reciprocal Rank Fusion (RRF).
- Vector Search: Uses embedding models for semantic similarity search.
- BM25 Search: Traditional keyword-based search using the BM25 algorithm.
Document Ingestion Workflow
The ingestion pipeline is triggered by the load_doc(path) function and follows these steps:
- Validation
- Verify that the file exists.
- Confirm that the file format is supported.
- Content Extraction
- Run an OCR or parsing pipeline to convert the raw file into Markdown.
- If the document contains images:
- Replace them with placeholders in the Markdown.
- Store image references for later retrieval.
- Pre-processing
- Generate document metadata (e.g., id, name, format).
- Build a table of contents (TOC) from Markdown headings when possible.
- Indexing
- Generate vector embeddings using the configured embedding model.
- Store embeddings in the vector database for semantic retrieval.
Data Models
A preliminary set of domain models is defined in models.py. These classes are exploratory and serve as a conceptual starting point for the project.
They are not considered final and may be refactored, renamed, or removed as the overall architecture of Athenaeum evolves and solidifies.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file athenaeum_kb-0.1.0.tar.gz.
File metadata
- Download URL: athenaeum_kb-0.1.0.tar.gz
- Upload date:
- Size: 272.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d311924c2597e654c34cde573416855594edbea741416859d681b9936ef69eb0
|
|
| MD5 |
3ee6d4d1555e5d0bcc978de3417af3b8
|
|
| BLAKE2b-256 |
ade70f9628cb3be454ccd2e25935cbf0f9284330e72bbfd5a46bac4409678739
|
File details
Details for the file athenaeum_kb-0.1.0-py3-none-any.whl.
File metadata
- Download URL: athenaeum_kb-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94b4389de064612e89c403957e4d7b3ef03063baa203c522d36160f562cdf34d
|
|
| MD5 |
e99437141af97c0e7b98a35d2b0f4612
|
|
| BLAKE2b-256 |
0b2c3889b9896ae637828be11c214d56d9066669084a547b25b403264a9783f3
|